-
Notifications
You must be signed in to change notification settings - Fork 59
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
PSR-15 Support #105
PSR-15 Support #105
Conversation
@adriansuter sorry, this is a big PR. Had to literally rewrite everything.. |
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.
Wonderful. Some comments.
@adriansuter great review. Will fix all of it and re-request approval. Thank you for your attention to detail 😂 |
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.
Readme review.
|
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.
Appreciate your work. Thanks. I still have some minor comments.
@adriansuter there's only a couple PHPStan errors to fix but I think this is fine honestly:
That's actually not true, if
Not sure if we can do a workaround for this, it's because we use
PHPStan sucks, that's all I can say. It doesn't parse the condition. |
While you are right, there is a scenario where if (session_status() !== PHP_SESSION_ACTIVE) {
How about if (is_array($this->storage) && empty($this->storage)) {
return null;
}
if ($this->storage instanceof ArrayAccess) {
if (!($this->storage instanceof Countable)) {
throw new RuntimeException('The Csrf storage is not countable.');
}
if (count($this->storage) < 1) {
return null;
}
} |
@adriansuter instead of this: if ($this->storage instanceof ArrayAccess) {
if (!($this->storage instanceof Countable)) {
throw new RuntimeException('The Csrf storage is not countable.');
}
if (count($this->storage) < 1) {
return null;
}
} I went with making This is what the if (
(is_array($this->storage) && empty($this->storage))
|| ($this->storage instanceof Countable && count($this->storage) < 1)
) {
return null;
} |
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.
Great work!!
Closes #102