Skip to content

Commit d4d218a

Browse files
committed
Fix up deprecation texts.
1 parent 9cb1182 commit d4d218a

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/AuthenticationService.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use Psr\Http\Message\ResponseInterface;
3131
use Psr\Http\Message\ServerRequestInterface;
3232
use RuntimeException;
33+
use function Cake\Core\deprecationWarning;
3334

3435
/**
3536
* Authentication Service
@@ -164,9 +165,15 @@ public function loadAuthenticator(string $name, array $config = []): Authenticat
164165
* @param string $name Name or class name.
165166
* @param array $config Identifier configuration.
166167
* @return \Authentication\Identifier\IdentifierInterface Identifier instance
168+
* @deprecated 3.3.0: loadIdentifier() usage is deprecated. Directly pass Identifier to Authenticator.
167169
*/
168170
public function loadIdentifier(string $name, array $config = []): IdentifierInterface
169171
{
172+
deprecationWarning(
173+
'3.3.0',
174+
'loadIdentifier() usage is deprecated. Directly pass Identifier to Authenticator.',
175+
);
176+
170177
return $this->identifiers()->load($name, $config);
171178
}
172179

src/AuthenticationServiceInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function loadAuthenticator(string $name, array $config = []): Authenticat
3939
* @param string $name Name or class name.
4040
* @param array $config Identifier configuration.
4141
* @return \Authentication\Identifier\IdentifierInterface
42+
* @deprecated 3.3.0: loadIdentifier() usage is deprecated. Directly pass Identifier to Authenticator.
4243
*/
4344
public function loadIdentifier(string $name, array $config = []): IdentifierInterface;
4445

src/Authenticator/AuthenticatorCollection.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ public function __construct(IdentifierCollection $identifiers, array $config = [
4444
{
4545
$this->_identifiers = $identifiers;
4646
if ($identifiers->count() > 0) {
47-
deprecationWarning('3.3.0', 'Directly pass Identifier to Authenticator.');
47+
deprecationWarning(
48+
'3.3.0',
49+
'loadIdentifier() usage is deprecated. Directly pass Identifier to Authenticator.',
50+
);
4851
}
4952

5053
parent::__construct($config);
@@ -67,7 +70,7 @@ protected function _create(object|string $class, string $alias, array $config):
6770
} else {
6871
deprecationWarning(
6972
'3.3.0',
70-
'IdentifierCollection is deprecated. Directly pass `\'identifier\'` config to Authenticator.',
73+
'loadIdentifier() usage is deprecated. Directly pass `\'identifier\'` config to Authenticator.',
7174
);
7275
}
7376

0 commit comments

Comments
 (0)