Skip to content

Commit 8a1a979

Browse files
committed
update stan
1 parent 3583745 commit 8a1a979

File tree

7 files changed

+7
-71
lines changed

7 files changed

+7
-71
lines changed

.phive/phars.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="phpstan" version="1.11.9" installed="1.11.9" location="./tools/phpstan" copy="false"/>
4-
<phar name="psalm" version="5.25.0" installed="5.25.0" location="./tools/psalm" copy="false"/>
3+
<phar name="phpstan" version="2.0.1" installed="2.0.1" location="./tools/phpstan" copy="false"/>
4+
<phar name="psalm" version="5.26.1" installed="5.26.1" location="./tools/psalm" copy="false"/>
55
</phive>

psalm-baseline.xml

+1-63
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,2 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.20.0@3f284e96c9d9be6fe6b15c79416e1d1903dcfef4">
3-
<file src="src/AuthenticationService.php">
4-
<RiskyTruthyFalsyComparison>
5-
<code><![CDATA[empty($parsed['host'])]]></code>
6-
<code><![CDATA[empty($parsed['scheme'])]]></code>
7-
</RiskyTruthyFalsyComparison>
8-
</file>
9-
<file src="src/Authenticator/CookieAuthenticator.php">
10-
<RiskyTruthyFalsyComparison>
11-
<code>empty($identity)</code>
12-
</RiskyTruthyFalsyComparison>
13-
</file>
14-
<file src="src/Authenticator/EnvironmentAuthenticator.php">
15-
<RiskyTruthyFalsyComparison>
16-
<code>empty($data)</code>
17-
<code>empty($user)</code>
18-
</RiskyTruthyFalsyComparison>
19-
</file>
20-
<file src="src/Authenticator/FormAuthenticator.php">
21-
<RiskyTruthyFalsyComparison>
22-
<code>empty($user)</code>
23-
</RiskyTruthyFalsyComparison>
24-
</file>
25-
<file src="src/Authenticator/HttpDigestAuthenticator.php">
26-
<RiskyTruthyFalsyComparison>
27-
<code>empty($digest)</code>
28-
<code>empty($user)</code>
29-
</RiskyTruthyFalsyComparison>
30-
</file>
31-
<file src="src/Authenticator/JwtAuthenticator.php">
32-
<RiskyTruthyFalsyComparison>
33-
<code>empty($user)</code>
34-
</RiskyTruthyFalsyComparison>
35-
</file>
36-
<file src="src/Authenticator/Result.php">
37-
<RiskyTruthyFalsyComparison>
38-
<code>empty($data)</code>
39-
</RiskyTruthyFalsyComparison>
40-
</file>
41-
<file src="src/Authenticator/SessionAuthenticator.php">
42-
<RiskyTruthyFalsyComparison>
43-
<code>empty($user)</code>
44-
<code>empty($user)</code>
45-
</RiskyTruthyFalsyComparison>
46-
</file>
47-
<file src="src/Authenticator/TokenAuthenticator.php">
48-
<RiskyTruthyFalsyComparison>
49-
<code>empty($headerLine)</code>
50-
<code>empty($queryParam)</code>
51-
<code>empty($user)</code>
52-
</RiskyTruthyFalsyComparison>
53-
</file>
54-
<file src="src/Identifier/IdentifierCollection.php">
55-
<RiskyTruthyFalsyComparison>
56-
<code>$result</code>
57-
</RiskyTruthyFalsyComparison>
58-
</file>
59-
<file src="src/Middleware/AuthenticationMiddleware.php">
60-
<RiskyTruthyFalsyComparison>
61-
<code>$url</code>
62-
</RiskyTruthyFalsyComparison>
63-
</file>
64-
</files>
2+
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0"/>

psalm.xml

+1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@
2727

2828
<InvalidStringClass errorLevel="info" />
2929
<MissingClassConstType errorLevel="info" />
30+
<RiskyTruthyFalsyComparison errorLevel="info" />
3031
</issueHandlers>
3132
</psalm>

src/AuthenticationService.php

+2-2
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 stdClass;
3334

3435
/**
3536
* Authentication Service
@@ -492,8 +493,7 @@ public function isImpersonating(ServerRequestInterface $request): bool
492493
*/
493494
protected function getImpersonationProvider(): ImpersonationInterface
494495
{
495-
/** @var \Authentication\Authenticator\ImpersonationInterface $provider */
496-
$provider = $this->getAuthenticationProvider();
496+
$provider = $this->getAuthenticationProvider() ?? new stdClass();
497497
if (!($provider instanceof ImpersonationInterface)) {
498498
$className = get_class($provider);
499499
throw new InvalidArgumentException(

src/Authenticator/CookieAuthenticator.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ protected function _createToken(ArrayAccess|array $identity): string
192192

193193
$usernameField = $this->getConfig('fields.username');
194194

195-
/** @var string */
196-
return json_encode([$identity[$usernameField], $hash]);
195+
return json_encode([$identity[$usernameField], $hash]) ?: '';
197196
}
198197

199198
/**

src/Identity.php

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class Identity implements IdentityInterface
5252
*
5353
* @param \ArrayAccess|array $data Identity data
5454
* @param array $config Config options
55-
* @throws \InvalidArgumentException When invalid identity data is passed.
5655
*/
5756
public function __construct(ArrayAccess|array $data, array $config = [])
5857
{

src/Middleware/AuthenticationMiddleware.php

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ class AuthenticationMiddleware implements MiddlewareInterface
5656
*
5757
* @param \Authentication\AuthenticationServiceInterface|\Authentication\AuthenticationServiceProviderInterface $subject Authentication service or application instance.
5858
* @param \Cake\Core\ContainerInterface|null $container The container instance from the application.
59-
* @throws \InvalidArgumentException When invalid subject has been passed.
6059
*/
6160
public function __construct(
6261
AuthenticationServiceInterface|AuthenticationServiceProviderInterface $subject,

0 commit comments

Comments
 (0)