Skip to content

Commit 2791c3c

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 6d6a23f commit 2791c3c

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
@@ -14,7 +14,6 @@
1414
namespace Staffbase\plugins\sdk\Validation;
1515

1616
use Lcobucci\JWT\Token;
17-
use Lcobucci\JWT\Token\Plain;
1817
use Lcobucci\JWT\UnencryptedToken;
1918
use Lcobucci\JWT\Validation\Constraint;
2019
use Lcobucci\JWT\Validation\ConstraintViolation;
@@ -36,7 +35,7 @@ public function assert(Token $token): void
3635
}
3736
}
3837

39-
private function hasInstanceId(Plain $token): bool
38+
private function hasInstanceId(UnencryptedToken $token): bool
4039
{
4140
return (bool) $token->claims()->get(SSODataClaimsInterface::CLAIM_INSTANCE_ID);
4241
}

test/SSOData/SSODataTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ public function testAccessorsGiveCorrectValues(): void
3737
$this->assertEquals(
3838
$tokenData[$key],
3939
$ssoData->$fn(),
40-
"called $fn expected " .
41-
(is_array($tokenData[$key]) ? print_r($tokenData[$key], true) : (string) $tokenData[$key]),
40+
"called $fn expected " . print_r($tokenData[$key], true),
4241
);
4342
}
4443
}

test/SSOTokenTest.php

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

162162
$sso = new SSOToken($this->publicKey, $token, $leeway);
163163

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

167167
/**

0 commit comments

Comments
 (0)