refactor: Code cleanup Pt1#37
Merged
Ninerian merged 16 commits intorefactor/code-cleanupfrom Apr 1, 2026
Merged
Conversation
Contributor
Ninerian
commented
Oct 29, 2025
- added code quality dependencies
- raised phpstan level to 5 and fixed all errors
- updated phpunit to 10
e88e6fe to
3300537
Compare
- Updated phpstan.neon.dist to level 4 - Removed unused expressions in PluginSessionTest - Fixed always-true ternary in SSODataTest - Refined assertion in SSOTokenTest to avoid redundant type check - Removed unreachable code after markTestSkipped statements - Added proper assertions to make mock object usage meaningful 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- 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>
acc47ef to
0ed5e27
Compare
m-seidel
requested changes
Oct 29, 2025
Comment on lines
+5
to
+7
| branches: | ||
| - 'main' | ||
| - '**/**' |
Contributor
There was a problem hiding this comment.
What is the goal here? Why not just
Suggested change
| branches: | |
| - 'main' | |
| - '**/**' | |
| branches: | |
| - '**' |
Comment on lines
+10
to
+12
| branches: | ||
| - 'main' | ||
| - '**/**' |
| * @see \Staffbase\plugins\sdk\SSOToken::CLAIM_AUDIENCE | ||
| */ | ||
| const CLAIM_AUDIENCE = 'aud'; | ||
| public const CLAIM_AUDIENCE = 'aud'; |
Contributor
There was a problem hiding this comment.
Why do we want to switch to public when it is already marked as deprecated? 🤔
Contributor
Author
There was a problem hiding this comment.
Just for the sake of lint error fixing 😬
| @@ -460,84 +472,10 @@ public function testSessionIdCheck() | |||
| public function testDestroyOtherSession() | |||
Contributor
There was a problem hiding this comment.
What is the plan for this empty test?
| $session->destroySession($sessionHash); | ||
| } | ||
|
|
||
| public function testDestroyOwnSession() |
Contributor
There was a problem hiding this comment.
What is the plan for this empty test?
| # CodeSniffer | ||
| phpcs.xml | ||
|
|
||
| /vendor/* |
Contributor
There was a problem hiding this comment.
this one is already covered by line 13
Restored testDestroyOtherSession and testDestroyOwnSession which had been emptied with markTestSkipped due to PHPUnit 10 incompatibilities. - Replace removed setMethodsExcept()->getMock() with getMock() (PHPUnit 10) - Add gc() stub required by SessionHandlerInterface - Set mock expectations before destroySession() call for correct isolation Co-authored-by: opencode <opencode@noreply.opencode.ai> Co-authored-by: GitHub Copilot <copilot@noreply.github.com>
m-seidel
approved these changes
Apr 1, 2026
| # CodeSniffer | ||
| phpcs.xml | ||
|
|
||
| /vendor/* |
Contributor
There was a problem hiding this comment.
Line 13 is already excluyding the vendor folder
Suggested change
| /vendor/* |
| - Do not create code outside of src/ and test/ unless explicitly requested. Never create example or playground code that is not integrated into the SDK or its tests. | ||
|
|
||
| ## Documentation | ||
| - Consult CLAUDE.md at project root for further architectural guidance and standard commands. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.