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
Make the session helper injectable #1197
Conversation
@ronan, thanks for your PR! By analyzing the blame information on this pull request, we identified @greg-1-anderson and @TeslaDethray to be potential reviewers |
2411920
to
b5b2ecb
Compare
$session = $this->cache->getData('session'); | ||
$this->data = $session; | ||
if (empty($session)) { | ||
$this->data = new \stdClass(); |
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.
Is an anonymous object the best way to represent this? If it needs any methods, could it be a full fledged class like Pantheon\Terminus\Session\Data
or would it be well served as an array?
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.
If you feel like being lazy with your types, could I recommend class SessionData extends \ArrayObject
? You can use it like an array today, but it can also be used for typehinting, and you can add accessors to it later. Win.
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.
I dunno. I think this should be an array probably but this thing was a pretty lazy copy from the old version. It'll need to be refactored once Auth()
is refactored to use it. For now I say leave this be.
+1 |
b5b2ecb
to
c03ef0c
Compare
* Test destroying the session | ||
*/ | ||
public function testDestroy() { | ||
$data = [ |
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.
Extraneous test data.
592469f
to
9dff715
Compare
No description provided.