-
Notifications
You must be signed in to change notification settings - Fork 62
Conversation
You will need to provide unit tests to cover the changes you are proposing to this component. Your fix extends the public API of SessionManager (by adding a new constructor argument) and adds a new class so it will need closer scrutiny before a decision can be made. |
Ok, I'll add tests asap. |
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
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.
2005-2016
Needs #28 to avoid tests fall. |
* @param array $options | ||
* @return SessionManager | ||
*/ | ||
public function setOptions(array $options) |
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.
The point of your pull request is to allow having default validators enabled, not to expose arbitrary options. As such, I plan to remove the setOptions
/getOptions
methods on merge, as they are not part of that goal, and because the side-effects of options passed to the constructor can be determined programmatically already.
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 agree.
- Removed `set`/`getOptions()`, as they were unnecessary to the pull request, and unwanted items to the public API. - Do not store options; unneeded after instantiation. - Merge default validators before passing to parent constructor. - Use `::class` notation wherever possible. - Store session id as `$id` property in `Id` validator; naming is now consistent with purpose. - Provide the delimiters to regex patterns when defining them; prevents need for concatenation later. - Provide guaranteed invalid identifier value when testing ID validator. - Updated SessionManagerFactory to allow detecting and utilizing options when creating SessionManager instance.
Merged to develop for release with 2.7.0 |
Issue #21 fix. Now if session id invalid, the exception
Exception\RuntimeException('Session validation failed')
will thrown.