From af02f109de308f7dd290b0c5ce5470302d5150c2 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Fri, 10 Jan 2025 13:24:49 +1300 Subject: [PATCH] ENH Remove unused properties and deprecation notices --- src/Control/HTTP.php | 8 -------- src/ORM/Search/BasicSearchContext.php | 1 - src/ORM/Search/SearchContext.php | 1 - .../MemberAuthenticator/CookieAuthenticationHandler.php | 1 - src/Security/RememberLoginHash.php | 1 - tests/php/Logging/MonologErrorHandlerTest.php | 4 ---- tests/php/ORM/SQLSelectTest.php | 2 -- tests/php/Security/PasswordEncryptorTest.php | 2 -- tests/php/Security/RememberLoginHashTest.php | 7 ------- 9 files changed, 27 deletions(-) diff --git a/src/Control/HTTP.php b/src/Control/HTTP.php index 2ac576e61a0..361e7bd5cd9 100644 --- a/src/Control/HTTP.php +++ b/src/Control/HTTP.php @@ -16,14 +16,6 @@ class HTTP { use Configurable; - /** - * Set to true to disable all deprecated HTTP Cache settings - * - * @var bool - * @deprecated 5.4.0 Will be removed without equivalent functionality to replace it. - */ - private static $ignoreDeprecatedCaching = false; - /** * Mapping of extension to mime types * diff --git a/src/ORM/Search/BasicSearchContext.php b/src/ORM/Search/BasicSearchContext.php index 34fd9ecc1d0..a60ef014aad 100644 --- a/src/ORM/Search/BasicSearchContext.php +++ b/src/ORM/Search/BasicSearchContext.php @@ -7,7 +7,6 @@ use SilverStripe\Core\Config\Config; use SilverStripe\Core\Config\Configurable; use SilverStripe\Core\Injector\Injector; -use SilverStripe\Dev\Deprecation; use SilverStripe\ORM\Filters\PartialMatchFilter; use SilverStripe\ORM\Filters\SearchFilter; use SilverStripe\Model\List\SS_List; diff --git a/src/ORM/Search/SearchContext.php b/src/ORM/Search/SearchContext.php index 6b6195cfca5..7fd9da243b2 100644 --- a/src/ORM/Search/SearchContext.php +++ b/src/ORM/Search/SearchContext.php @@ -19,7 +19,6 @@ use Exception; use LogicException; use SilverStripe\Core\Config\Config; -use SilverStripe\Dev\Deprecation; use SilverStripe\ORM\DataQuery; /** diff --git a/src/Security/MemberAuthenticator/CookieAuthenticationHandler.php b/src/Security/MemberAuthenticator/CookieAuthenticationHandler.php index b18d29a4597..e4ce0126bdf 100644 --- a/src/Security/MemberAuthenticator/CookieAuthenticationHandler.php +++ b/src/Security/MemberAuthenticator/CookieAuthenticationHandler.php @@ -10,7 +10,6 @@ use SilverStripe\Security\Member; use SilverStripe\Security\RememberLoginHash; use SilverStripe\Security\Security; -use SilverStripe\Dev\Deprecation; /** * Authenticate a member passed on a session cookie diff --git a/src/Security/RememberLoginHash.php b/src/Security/RememberLoginHash.php index e2f82c7f9dd..57304392e94 100644 --- a/src/Security/RememberLoginHash.php +++ b/src/Security/RememberLoginHash.php @@ -6,7 +6,6 @@ use DateTime; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\FieldType\DBDatetime; -use SilverStripe\Dev\Deprecation; /** * Persists a token associated with a device for users who opted for the "Remember Me" diff --git a/tests/php/Logging/MonologErrorHandlerTest.php b/tests/php/Logging/MonologErrorHandlerTest.php index 75affeceb78..a3a13d1c691 100644 --- a/tests/php/Logging/MonologErrorHandlerTest.php +++ b/tests/php/Logging/MonologErrorHandlerTest.php @@ -6,7 +6,6 @@ use Psr\Log\LoggerInterface; use SilverStripe\Dev\SapphireTest; use SilverStripe\Logging\MonologErrorHandler; -use SilverStripe\Dev\Deprecation; class MonologErrorHandlerTest extends SapphireTest { @@ -20,9 +19,6 @@ public function testStartThrowsExceptionWithoutLoggerDefined() public function testSetLoggerResetsStack() { - if (Deprecation::isEnabled()) { - $this->markTestSkipped('Test calls deprecated code'); - } /** @var LoggerInterface $logger */ $logger = $this->createMock(LoggerInterface::class); diff --git a/tests/php/ORM/SQLSelectTest.php b/tests/php/ORM/SQLSelectTest.php index 7dcf386bafc..5a4d470617b 100755 --- a/tests/php/ORM/SQLSelectTest.php +++ b/tests/php/ORM/SQLSelectTest.php @@ -29,8 +29,6 @@ class SQLSelectTest extends SapphireTest SQLSelectTest\CteRecursiveObject::class, ]; - protected $oldDeprecation = null; - public function testCount() { diff --git a/tests/php/Security/PasswordEncryptorTest.php b/tests/php/Security/PasswordEncryptorTest.php index 024bc235c3b..ab1c0703bd3 100644 --- a/tests/php/Security/PasswordEncryptorTest.php +++ b/tests/php/Security/PasswordEncryptorTest.php @@ -5,9 +5,7 @@ use SilverStripe\Security\PasswordEncryptor_Blowfish; use SilverStripe\Security\PasswordEncryptor; use SilverStripe\Core\Config\Config; -use SilverStripe\Dev\Deprecation; use SilverStripe\Dev\SapphireTest; -use SilverStripe\Security\PasswordEncryptor_LegacyPHPHash; use SilverStripe\Security\PasswordEncryptor_NotFoundException; use SilverStripe\Security\PasswordEncryptor_PHPHash; use SilverStripe\Security\Tests\PasswordEncryptorTest\TestEncryptor; diff --git a/tests/php/Security/RememberLoginHashTest.php b/tests/php/Security/RememberLoginHashTest.php index d8f7c5ac6e7..13e3af15b53 100644 --- a/tests/php/Security/RememberLoginHashTest.php +++ b/tests/php/Security/RememberLoginHashTest.php @@ -6,7 +6,6 @@ use SilverStripe\Security\Member; use SilverStripe\Security\RememberLoginHash; use SilverStripe\SessionManager\Models\LoginSession; -use SilverStripe\Dev\Deprecation; use PHPUnit\Framework\Attributes\DataProvider; class RememberLoginHashTest extends SapphireTest @@ -111,10 +110,6 @@ public function testRenew($replaceToken) $member = $this->objFromFixture(Member::class, 'main'); - Deprecation::withSuppressedNotice( - fn() => RememberLoginHash::config()->set('replace_token_during_session_renewal', $replaceToken) - ); - $hash = RememberLoginHash::generate($member); $oldToken = $hash->getToken(); $oldHash = $hash->Hash; @@ -122,8 +117,6 @@ public function testRenew($replaceToken) // Fetch the token from the DB - otherwise we still have the token from when this was originally created $storedHash = RememberLoginHash::get()->find('ID', $hash->ID); - Deprecation::withSuppressedNotice(fn() => $storedHash->renew()); - if ($replaceToken) { $this->assertNotEquals($oldToken, $storedHash->getToken()); $this->assertNotEquals($oldHash, $storedHash->Hash);