Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH Remove unused properties and deprecation notices #11543

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this need to be deprecated in CMS 5 first?

Copy link
Member Author

@GuySartorelli GuySartorelli Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not used but I guess technically it should be deprecated. Though nothing will actually change for people who are trying to use it - it does nothing now and it will continue to do nothing (with no error) in CMS 6.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased


/**
* 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
Loading