-
Notifications
You must be signed in to change notification settings - Fork 4
refactor: Code cleanup Pt4 #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Ninerian
wants to merge
9
commits into
refactor/code-cleanup
Choose a base branch
from
code-cleanup-pt4
base: refactor/code-cleanup
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
346851e
chore: raise phpstan to level 8 and fix null safety
Ninerian 0871513
chore: raise phpstan to level 8 and fix null safety
Ninerian 6358c21
chore: raise phpstan to level 9 (highest) and fix all issues
Ninerian 239e88f
Merge remote-tracking branch 'origin/refactor/code-cleanup' into code…
Ninerian 08bfd2f
refactor: address PR review feedback on types, grammar, and aud handling
Ninerian fd02600
revert: restore aud claim as string-only in SSOTokenGenerator
Ninerian 6b23810
refactor: extract session validation helpers in SessionHandlerTrait
Ninerian de5d16c
refactor: extract getSessionInstance helper and add default to getSes…
Ninerian 7652222
refactor: consolidate null-check into getSessionInstance and pass def…
Ninerian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| parameters: | ||
| level: 7 | ||
| level: 9 | ||
| paths: | ||
| - ./src | ||
| - ./test |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,7 +57,8 @@ public function getAudience(): ?string | |
| */ | ||
| public function getExpireAtTime(): ?DateTimeImmutable | ||
| { | ||
| return $this->getClaimSafe(SharedClaimsInterface::CLAIM_EXPIRE_AT); | ||
| $value = $this->getClaimSafe(SharedClaimsInterface::CLAIM_EXPIRE_AT); | ||
| return $value instanceof DateTimeImmutable ? $value : null; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -67,7 +68,8 @@ public function getExpireAtTime(): ?DateTimeImmutable | |
| */ | ||
| public function getNotBeforeTime(): ?DateTimeImmutable | ||
| { | ||
| return $this->getClaimSafe(SharedClaimsInterface::CLAIM_NOT_BEFORE); | ||
| $value = $this->getClaimSafe(SharedClaimsInterface::CLAIM_NOT_BEFORE); | ||
| return $value instanceof DateTimeImmutable ? $value : null; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -77,7 +79,8 @@ public function getNotBeforeTime(): ?DateTimeImmutable | |
| */ | ||
| public function getIssuedAtTime(): ?DateTimeImmutable | ||
| { | ||
| return $this->getClaimSafe(SharedClaimsInterface::CLAIM_ISSUED_AT); | ||
| $value = $this->getClaimSafe(SharedClaimsInterface::CLAIM_ISSUED_AT); | ||
| return $value instanceof DateTimeImmutable ? $value : null; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -87,7 +90,8 @@ public function getIssuedAtTime(): ?DateTimeImmutable | |
| */ | ||
| public function getIssuer(): ?string | ||
| { | ||
| return $this->getClaimSafe(SharedClaimsInterface::CLAIM_ISSUER); | ||
| $value = $this->getClaimSafe(SharedClaimsInterface::CLAIM_ISSUER); | ||
| return is_string($value) ? $value : null; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -97,7 +101,8 @@ public function getIssuer(): ?string | |
| */ | ||
| public function getId(): ?string | ||
| { | ||
| return $this->getClaimSafe(SharedClaimsInterface::CLAIM_JWT_ID); | ||
| $value = $this->getClaimSafe(SharedClaimsInterface::CLAIM_JWT_ID); | ||
| return is_string($value) ? $value : null; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -107,21 +112,23 @@ public function getId(): ?string | |
| */ | ||
| public function getSubject(): ?string | ||
| { | ||
| return $this->getClaimSafe(SharedClaimsInterface::CLAIM_SUBJECT); | ||
| $value = $this->getClaimSafe(SharedClaimsInterface::CLAIM_SUBJECT); | ||
| return is_string($value) ? $value : null; | ||
| } | ||
|
|
||
| /** | ||
| * Get the role of the accessing user. | ||
| * | ||
| * If this is set to “editor”, the requesting user may manage the contents | ||
| * If this is set to "editor", the requesting user may manage the contents | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| * of the plugin instance, i.e. she has administration rights. | ||
| * The type of the accessing entity can be either a “user” or a “editor”. | ||
| * The type of the accessing entity can be either a "user" or an "editor". | ||
| * | ||
| * @return null|string | ||
| */ | ||
| public function getRole(): ?string | ||
| { | ||
| return $this->getClaimSafe(SharedClaimsInterface::CLAIM_USER_ROLE); | ||
| $value = $this->getClaimSafe(SharedClaimsInterface::CLAIM_USER_ROLE); | ||
| return is_string($value) ? $value : null; | ||
| } | ||
|
|
||
| /** | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleteInstance()is documented as@return neverand it always terminates viaexitSuccess/exitFailurefollowed byexitRemoteCall(), but its signature is still: void. This mismatch makes the control-flow contract unclear for static analysis and readers. Consider changing the return type tonever(or, if it can return in some scenarios, adjust the docblock accordingly).