Implement some changes based on parent branch PR review #1
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.
Implement some requested changes from the parent branch's PR. I went ahead and took a stab at this based on this your comment here @dpi: thephpleague#866 (comment)
This adds two new interfaces:
ClockInterface
This is basically the spec from https://github.com/php-fig/fig-standards/blob/master/proposed/clock.md except without a return typehint to support PHP 5.6 for nowClockAwareInterface
- this may not be necessary but it seemed reasonable to have agetClock(): ClockInterface
contract, given that we expect to be able to get a clock in bothAccessToken
andAbstractProvider
.This also removes some methods added in thephpleague#852, specifically:
-
AccessToken::setTimeNow()
-
AccessToken::getTimeNow()
-
AccessToken::resetTimeNow()
-
AccessToken::$timeNow
That technically represents a BC break, but:
For the existing
AccessTokenInterface
:- remove the
setClock()
andgetTimeNow()
-
getTimeNow()
is no longer needed anyway-
setClock()
better not to have a setter on an interface inthis case
- both of these changes were BC breaks so they were removed
I believe the rest of the changes here are just cleaning up tests that used the older static method of setting the current time. The previous hack
tearDownForBackwardsCompatibility()
is no longer needed so it was removed.