Browse Source

remove unavailable/unused methods/lines

saeid 7 years ago
parent
commit
fc9a303ca4
2 changed files with 3 additions and 34 deletions
  1. 0 18
      src/Core/Plugin.php
  2. 3 16
      src/TestSuite/Fixture/FixtureManager.php

+ 0 - 18
src/Core/Plugin.php

@@ -15,8 +15,6 @@ declare(strict_types=1);
  */
 namespace Cake\Core;
 
-use DirectoryIterator;
-
 /**
  * Plugin is used to load and locate plugins.
  *
@@ -125,22 +123,6 @@ class Plugin
     }
 
     /**
-     * Include file, ignoring include error if needed if file is missing
-     *
-     * @param string $file File to include
-     * @param bool $ignoreMissing Whether to ignore include error for missing files
-     * @return mixed
-     */
-    protected static function _includeFile(string $file, bool $ignoreMissing = false)
-    {
-        if ($ignoreMissing && !is_file($file)) {
-            return false;
-        }
-
-        return include $file;
-    }
-
-    /**
      * Get the shared plugin collection.
      *
      * @internal

+ 3 - 16
src/TestSuite/Fixture/FixtureManager.php

@@ -366,19 +366,10 @@ class FixtureManager
         $dbs = $this->_fixtureConnections($fixtures);
         foreach ($dbs as $connection => $fixtures) {
             $db = ConnectionManager::get($connection);
-            $newMethods = method_exists($db, 'isQueryLoggingEnabled');
-            if ($newMethods) {
-                $logQueries = $db->isQueryLoggingEnabled();
-            } else {
-                $logQueries = $db->logQueries();
-            }
+            $logQueries = $db->isQueryLoggingEnabled();
 
             if ($logQueries && !$this->_debug) {
-                if ($newMethods) {
-                    $db->enableQueryLogging(false);
-                } else {
-                    $db->logQueries(false);
-                }
+                $db->enableQueryLogging(false);
             }
             $db->transactional(function ($db) use ($fixtures, $operation) {
                 $db->disableConstraints(function ($db) use ($fixtures, $operation) {
@@ -386,11 +377,7 @@ class FixtureManager
                 });
             });
             if ($logQueries) {
-                if ($newMethods) {
-                    $db->enableQueryLogging(true);
-                } else {
-                    $db->logQueries(true);
-                }
+                $db->enableQueryLogging(true);
             }
         }
     }