Skip to content

Commit

Permalink
ENH Remove unused properties and deprecation notices (#11543)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Jan 15, 2025
1 parent b842972 commit 8b0c6ed
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 27 deletions.
8 changes: 0 additions & 8 deletions src/Control/HTTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
1 change: 0 additions & 1 deletion src/ORM/Search/BasicSearchContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/ORM/Search/SearchContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Exception;
use LogicException;
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\Deprecation;
use SilverStripe\ORM\DataQuery;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/Security/RememberLoginHash.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 0 additions & 4 deletions tests/php/Logging/MonologErrorHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Psr\Log\LoggerInterface;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Logging\MonologErrorHandler;
use SilverStripe\Dev\Deprecation;

class MonologErrorHandlerTest extends SapphireTest
{
Expand All @@ -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);

Expand Down
2 changes: 0 additions & 2 deletions tests/php/ORM/SQLSelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class SQLSelectTest extends SapphireTest
SQLSelectTest\CteRecursiveObject::class,
];

protected $oldDeprecation = null;

public function testCount()
{

Expand Down
2 changes: 0 additions & 2 deletions tests/php/Security/PasswordEncryptorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 0 additions & 7 deletions tests/php/Security/RememberLoginHashTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -111,19 +110,13 @@ 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;

// 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);
Expand Down

0 comments on commit 8b0c6ed

Please sign in to comment.