Skip to content

Commit 3300537

Browse files
Ninerianclaude
andcommitted
chore: raise phpstan to level 5 and fix type mismatch
- Updated phpstan.neon.dist to level 5 - Fixed type parameter in HasInstanceId::hasInstanceId() method from Plain to UnencryptedToken - Removed unused Plain token import - Aligns with lcobucci/jwt library token type hierarchy 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 46d0603 commit 3300537

4 files changed

Lines changed: 4 additions & 6 deletions

File tree

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
parameters:
2-
level: 4
2+
level: 5
33
paths:
44
- ./src
55
- ./test

src/Validation/HasInstanceId.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
namespace Staffbase\plugins\sdk\Validation;
1717

1818
use Lcobucci\JWT\Token;
19-
use Lcobucci\JWT\Token\Plain;
2019
use Lcobucci\JWT\UnencryptedToken;
2120
use Lcobucci\JWT\Validation\Constraint;
2221
use Lcobucci\JWT\Validation\ConstraintViolation;
@@ -38,7 +37,7 @@ public function assert(Token $token): void
3837
}
3938
}
4039

41-
private function hasInstanceId(Plain $token): bool
40+
private function hasInstanceId(UnencryptedToken $token): bool
4241
{
4342
return (bool) $token->claims()->get(SSODataClaimsInterface::CLAIM_INSTANCE_ID);
4443
}

test/SSOData/SSODataTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ public function testAccessorsGiveCorrectValues(): void
3939
$this->assertEquals(
4040
$tokenData[$key],
4141
$ssoData->$fn(),
42-
"called $fn expected " .
43-
(is_array($tokenData[$key]) ? print_r($tokenData[$key], true) : (string) $tokenData[$key]),
42+
"called $fn expected " . print_r($tokenData[$key], true),
4443
);
4544
}
4645
}

test/SSOTokenTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function testConstructorAcceptsLeewayForTokenIssuedInTheFuture()
163163

164164
$sso = new SSOToken($this->publicKey, $token, $leeway);
165165

166-
// Test passes if no exception is thrown during instantiation
166+
$this->assertEquals("testPlugin", $sso->getAudience());
167167
}
168168

169169
/**

0 commit comments

Comments
 (0)