Skip to content

Commit

Permalink
Merge pull request #471 from creative-commoners/pulls/4/depr-messages
Browse files Browse the repository at this point in the history
API Update deprecations
  • Loading branch information
GuySartorelli authored Nov 20, 2022
2 parents d47b84c + 4db34f6 commit 7c3f5a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
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

0 comments on commit 7c3f5a4

Please sign in to comment.