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

API Update deprecations #471

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
7 changes: 5 additions & 2 deletions src/Report/EnabledMembers.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use SilverStripe\ORM\DataList;
use SilverStripe\Reports\Report;
use SilverStripe\Security\Member;
use SilverStripe\Dev\Deprecation;

if (!class_exists(Report::class)) {
return;
Expand Down Expand Up @@ -151,10 +152,11 @@ public function parameterFields(): FieldList
* @param null $_
* @param Member $record
* @return string
* @deprecated Will be removed in 5.0 use MemberExtension::getRegisteredMethodNames() instead
* @deprecated 4.7.0 Use MemberExtension::getRegisteredMethodNames() instead
*/
public function formatMethodsColumn($_, Member $record): string
{
Deprecation::notice('4.7.0', 'Use MemberExtension::getRegisteredMethodNames() instead');
/** @var Member&MemberExtension $record */
$methods = $this->getRegisteredMethodsForRecords();

Expand All @@ -169,10 +171,11 @@ public function formatMethodsColumn($_, Member $record): string
* @param null $_
* @param Member&MemberExtension $record
* @return string
* @deprecated Will be removed in 5.0 use MemberExtension::getDefaultRegisteredMethodName() instead
* @deprecated 4.7.0 Use MemberExtension::getDefaultRegisteredMethodName() instead
*/
public function formatDefaultMethodColumn($_, Member $record): string
{
Deprecation::notice('4.7.0', 'Use MemberExtension::getDefaultRegisteredMethodName() instead');
/** @var RegisteredMethod|null $method */
$method = $this->getRegisteredMethodsForRecords()->byID($record->DefaultRegisteredMethodID);

Expand Down
7 changes: 5 additions & 2 deletions src/Store/SessionStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use SilverStripe\MFA\Extension\MemberExtension;
use SilverStripe\ORM\DataObject;
use SilverStripe\Security\Member;
use SilverStripe\Dev\Deprecation;

/**
* This class provides an interface to store data in session during an MFA process. This is implemented as a measure to
Expand Down Expand Up @@ -235,10 +236,11 @@ public function __unserialize(array $data): void
* The __serialize() magic method will be automatically used instead of this
*
* @return string
* @deprecated will be removed in 5.0
* @deprecated 4.7.0 Use __serialize() instead
*/
public function serialize(): string
{
Deprecation::notice('4.7.0', 'Use __serialize() instead');
$data = $this->__serialize();
$str = json_encode($data);
if (!$str) {
Expand All @@ -253,10 +255,11 @@ public function serialize(): string
* and the PHP version used in less than PHP 9.0
*
* @param string $serialized
* @deprecated will be removed in 5.0
* @deprecated 4.7.0 Use __unserialize() instead
*/
public function unserialize($serialized): void
{
Deprecation::notice('4.7.0', 'Use __unserialize() instead');
$data = json_decode($serialized ?? '', true);
$this->__unserialize($data);
}
Expand Down