From c68b4e08086ce9f84871e5bdf30239b04530889f Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Mon, 10 Feb 2020 11:09:47 +0000 Subject: [PATCH] =?UTF-8?q?Issue=20#3111888=20by=20andypost,=20Hardik=5FPa?= =?UTF-8?q?tel=5F12,=20G=C3=A1bor=20Hojtsy:=20Remove=20all=20@deprecated?= =?UTF-8?q?=20code=20from=20Phpstorage=20and=20Version=20Components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Component/PhpStorage/FileStorage.php | 22 ---------------- .../Drupal/Component/Version/Constraint.php | 20 --------------- .../PhpStorage/FileStorageDeprecationTest.php | 25 ------------------- .../Component/Version/ConstraintTest.php | 13 ---------- 4 files changed, 80 deletions(-) delete mode 100644 core/tests/Drupal/Tests/Component/PhpStorage/FileStorageDeprecationTest.php diff --git a/core/lib/Drupal/Component/PhpStorage/FileStorage.php b/core/lib/Drupal/Component/PhpStorage/FileStorage.php index 95165a5f5450..704ae0067224 100644 --- a/core/lib/Drupal/Component/PhpStorage/FileStorage.php +++ b/core/lib/Drupal/Component/PhpStorage/FileStorage.php @@ -55,28 +55,6 @@ public function save($name, $code) { return (bool) file_put_contents($path, $code); } - /** - * Returns the standard .htaccess lines that Drupal writes to file directories. - * - * @param bool $private - * (optional) Set to FALSE to return the .htaccess lines for an open and - * public directory. The default is TRUE, which returns the .htaccess lines - * for a private and protected directory. - * - * @return string - * The desired contents of the .htaccess file. - * - * @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Instead use - * \Drupal\Component\FileSecurity\FileSecurity. - * - * @see https://www.drupal.org/node/3075098 - * @see \Drupal\Component\FileSecurity\FileSecurity::writeHtaccess() - */ - public static function htaccessLines($private = TRUE) { - @trigger_error("htaccessLines() is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Component\FileSecurity\FileSecurity::htaccessLines() instead. See https://www.drupal.org/node/3075098", E_USER_DEPRECATED); - return FileSecurity::htaccessLines($private); - } - /** * Ensures the directory exists, has the right permissions, and a .htaccess. * diff --git a/core/lib/Drupal/Component/Version/Constraint.php b/core/lib/Drupal/Component/Version/Constraint.php index d7b98e459253..36a53eabb72e 100644 --- a/core/lib/Drupal/Component/Version/Constraint.php +++ b/core/lib/Drupal/Component/Version/Constraint.php @@ -51,26 +51,6 @@ public function __toString() { return $this->constraint; } - /** - * A list of associative arrays representing the constraint. - * - * Each containing the keys: - * - 'op': can be one of: '=', '==', '!=', '<>', '<', '<=', '>', or '>='. - * - 'version': A complete version, e.g. '4.5-beta3'. - * - * @return array[] - * The constraint represented as an array. - * - * @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. - * Only exists to provide a backwards compatibility layer. - * - * @see https://www.drupal.org/node/2756875 - */ - public function toArray() { - @trigger_error(sprintf('%s() only exists to provide a backwards compatibility layer. See https://www.drupal.org/node/2756875', __METHOD__), E_USER_DEPRECATED); - return $this->constraintArray; - } - /** * Determines if the provided version is satisfied by this constraint. * diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageDeprecationTest.php b/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageDeprecationTest.php deleted file mode 100644 index 7ca8c5195507..000000000000 --- a/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageDeprecationTest.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Drupal\Tests\Component\PhpStorage; - -use Drupal\Component\PhpStorage\FileStorage; -use PHPUnit\Framework\TestCase; - -/** - * Tests FileStorage deprecations. - * - * @coversDefaultClass \Drupal\Component\PhpStorage\FileStorage - * @group legacy - * @group Drupal - * @group PhpStorage - */ -class FileStorageDeprecationTest extends TestCase { - - /** - * @expectedDeprecation htaccessLines() is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Component\FileSecurity\FileSecurity::htaccessLines() instead. See https://www.drupal.org/node/3075098 - */ - public function testHtAccessLines() { - $this->assertNotEmpty(FileStorage::htaccessLines()); - } - -} diff --git a/core/tests/Drupal/Tests/Component/Version/ConstraintTest.php b/core/tests/Drupal/Tests/Component/Version/ConstraintTest.php index b006113e342c..292fd123e654 100644 --- a/core/tests/Drupal/Tests/Component/Version/ConstraintTest.php +++ b/core/tests/Drupal/Tests/Component/Version/ConstraintTest.php @@ -149,19 +149,6 @@ public function providerIsCompatible() { return $tests; } - /** - * @covers ::toArray - * @group legacy - * @expectedDeprecation Drupal\Component\Version\Constraint::toArray() only exists to provide a backwards compatibility layer. See https://www.drupal.org/node/2756875 - */ - public function testToArray() { - $constraint = new Constraint('<8.x-4.x,>8.x-1.x', '8.x'); - $this->assertSame([ - ['op' => '<', 'version' => '4.x'], - ['op' => '>', 'version' => '2.x'], - ], $constraint->toArray()); - } - /** * Create testIsCompatible() test cases for constraints and versions. * -- GitLab