From 4db34f629e26184decc097bd1b2b1342be80fd1e Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 16 Nov 2022 11:47:01 +1300 Subject: [PATCH] API Update deprecations --- src/Report/EnabledMembers.php | 7 +++++-- src/Store/SessionStore.php | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Report/EnabledMembers.php b/src/Report/EnabledMembers.php index efa0c2e0..4ec80d00 100644 --- a/src/Report/EnabledMembers.php +++ b/src/Report/EnabledMembers.php @@ -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; @@ -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(); @@ -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); diff --git a/src/Store/SessionStore.php b/src/Store/SessionStore.php index 6d8e1d2a..1ce5882e 100644 --- a/src/Store/SessionStore.php +++ b/src/Store/SessionStore.php @@ -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 @@ -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) { @@ -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); }