Browse Source

Remove deprecated code.

ADmad 4 years ago
parent
commit
892da2548b

+ 0 - 26
src/Database/Driver.php

@@ -284,19 +284,6 @@ abstract class Driver implements DriverInterface
     }
 
     /**
-     * Returns true if the server supports common table expressions.
-     *
-     * @return bool
-     * @deprecated 4.3.0 Use `supports(DriverInterface::FEATURE_QUOTE)` instead
-     */
-    public function supportsCTEs(): bool
-    {
-        deprecationWarning('Feature support checks are now implemented by `supports()` with FEATURE_* constants.');
-
-        return $this->supports(static::FEATURE_CTE);
-    }
-
-    /**
      * @inheritDoc
      */
     public function quote($value, $type = PDO::PARAM_STR): string
@@ -307,19 +294,6 @@ abstract class Driver implements DriverInterface
     }
 
     /**
-     * Checks if the driver supports quoting, as PDO_ODBC does not support it.
-     *
-     * @return bool
-     * @deprecated 4.3.0 Use `supports(DriverInterface::FEATURE_QUOTE)` instead
-     */
-    public function supportsQuoting(): bool
-    {
-        deprecationWarning('Feature support checks are now implemented by `supports()` with FEATURE_* constants.');
-
-        return $this->supports(static::FEATURE_QUOTE);
-    }
-
-    /**
      * @inheritDoc
      */
     abstract public function queryTranslator(string $type): Closure;

+ 0 - 39
src/Database/Driver/Mysql.php

@@ -302,43 +302,4 @@ class Mysql extends Driver
 
         return $this->_version;
     }
-
-    /**
-     * Returns true if the server supports common table expressions.
-     *
-     * @return bool
-     * @deprecated 4.3.0 Use `supports(DriverInterface::FEATURE_CTE)` instead
-     */
-    public function supportsCTEs(): bool
-    {
-        deprecationWarning('Feature support checks are now implemented by `supports()` with FEATURE_* constants.');
-
-        return $this->supports(static::FEATURE_CTE);
-    }
-
-    /**
-     * Returns true if the server supports native JSON columns
-     *
-     * @return bool
-     * @deprecated 4.3.0 Use `supports(DriverInterface::FEATURE_JSON)` instead
-     */
-    public function supportsNativeJson(): bool
-    {
-        deprecationWarning('Feature support checks are now implemented by `supports()` with FEATURE_* constants.');
-
-        return $this->supports(static::FEATURE_JSON);
-    }
-
-    /**
-     * Returns true if the connected server supports window functions.
-     *
-     * @return bool
-     * @deprecated 4.3.0 Use `supports(DriverInterface::FEATURE_WINDOW)` instead
-     */
-    public function supportsWindowFunctions(): bool
-    {
-        deprecationWarning('Feature support checks are now implemented by `supports()` with FEATURE_* constants.');
-
-        return $this->supports(static::FEATURE_WINDOW);
-    }
 }

+ 0 - 26
src/Database/Driver/Sqlite.php

@@ -331,30 +331,4 @@ class Sqlite extends Driver
                 break;
         }
     }
-
-    /**
-     * Returns true if the server supports common table expressions.
-     *
-     * @return bool
-     * @deprecated 4.3.0 Use `supports(DriverInterface::FEATURE_CTE)` instead
-     */
-    public function supportsCTEs(): bool
-    {
-        deprecationWarning('Feature support checks are now implemented by `supports()` with FEATURE_* constants.');
-
-        return $this->supports(static::FEATURE_CTE);
-    }
-
-    /**
-     * Returns true if the connected server supports window functions.
-     *
-     * @return bool
-     * @deprecated 4.3.0 Use `supports(DriverInterface::FEATURE_WINDOW)` instead
-     */
-    public function supportsWindowFunctions(): bool
-    {
-        deprecationWarning('Feature support checks are now implemented by `supports()` with FEATURE_* constants.');
-
-        return $this->supports(static::FEATURE_WINDOW);
-    }
 }

+ 0 - 8
src/Database/DriverInterface.php

@@ -194,14 +194,6 @@ interface DriverInterface
     public function quote(mixed $value, int $type): string;
 
     /**
-     * Checks if the driver supports quoting.
-     *
-     * @return bool
-     * @deprecated 4.3.0 Use `supports(DriverInterface::FEATURE_QUOTE)` instead
-     */
-    public function supportsQuoting(): bool;
-
-    /**
      * Returns a callable function that will be used to transform a passed Query object.
      * This function, in turn, will return an instance of a Query object that has been
      * transformed to accommodate any specificities of the SQL dialect in use.

+ 0 - 15
tests/TestCase/Database/Driver/MysqlTest.php

@@ -246,19 +246,4 @@ class MysqlTest extends TestCase
 
         $this->assertFalse($driver->supports('this-is-fake'));
     }
-
-    /**
-     * Tests driver-specific feature support check.
-     */
-    public function testDeprecatedSupports(): void
-    {
-        $driver = ConnectionManager::get('test')->getDriver();
-        $this->skipIf(!$driver instanceof Mysql);
-
-        $this->deprecated(function () use ($driver) {
-            $this->assertSame($driver->supportsCTEs(), $driver->supports(DriverInterface::FEATURE_CTE));
-            $this->assertSame($driver->supportsNativeJson(), $driver->supports(DriverInterface::FEATURE_JSON));
-            $this->assertSame($driver->supportsWindowFunctions(), $driver->supports(DriverInterface::FEATURE_WINDOW));
-        });
-    }
 }

+ 0 - 14
tests/TestCase/Database/Driver/SqliteTest.php

@@ -171,18 +171,4 @@ class SqliteTest extends TestCase
 
         $this->assertFalse($driver->supports('this-is-fake'));
     }
-
-    /**
-     * Tests driver-specific feature support check.
-     */
-    public function testDeprecatedSupports(): void
-    {
-        $driver = ConnectionManager::get('test')->getDriver();
-        $this->skipIf(!$driver instanceof Sqlite);
-
-        $this->deprecated(function () use ($driver) {
-            $this->assertSame($driver->supportsCTEs(), $driver->supports(DriverInterface::FEATURE_CTE));
-            $this->assertSame($driver->supportsWindowFunctions(), $driver->supports(DriverInterface::FEATURE_WINDOW));
-        });
-    }
 }

+ 0 - 12
tests/TestCase/Database/DriverTest.php

@@ -97,18 +97,6 @@ class DriverTest extends TestCase
     }
 
     /**
-     * Tests deprecated supports checks.
-     */
-    public function testDeprecatedSupports(): void
-    {
-        $this->deprecated(function () {
-            $this->assertSame($this->driver->supportsCTEs(), $this->driver->supports(DriverInterface::FEATURE_CTE));
-            $this->assertSame($this->driver->supportsSavePoints(), $this->driver->supports(DriverInterface::FEATURE_SAVEPOINT));
-            $this->assertSame($this->driver->supportsQuoting(), $this->driver->supports(DriverInterface::FEATURE_QUOTE));
-        });
-    }
-
-    /**
      * Test schemaValue().
      * Uses a provider for all the different values we can pass to the method.
      *