This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Adding a new static ::fromTime($time) method to AbstractDate #6338
Closed
beryllium
wants to merge
278
commits into
zendframework:develop
from
beryllium:abstractdate_header_fromtime
Closed
Adding a new static ::fromTime($time) method to AbstractDate #6338
beryllium
wants to merge
278
commits into
zendframework:develop
from
beryllium:abstractdate_header_fromtime
Conversation
This file contains 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
… develop Close zendframework#6071 Forward Port zendframework#6071
…t' into develop Close zendframework#6070 Forward Port zendframework#6070
…ests' into develop Close zendframework#6047 Forward Port zendframework#6047
…er' into develop Close zendframework#6046 Forward Port zendframework#6046
…rowing' into develop Close zendframework#6041 Forward Port zendframework#6041
… into develop Close zendframework#6032 Forward Port zendframework#6032
…ilter-values' into develop Close zendframework#6028 Forward Port zendframework#6028
…tus-code' into develop Close zendframework#6027 Forward Port zendframework#6027
…fixes' into develop Close zendframework#6026 Forward Port zendframework#6026
…ariable-name' into develop Close zendframework#6021 Forward Port zendframework#6021
…' into develop Close zendframework#6012 Forward Port zendframework#6012
…nto develop Close zendframework#6007 zendframework#6006 Forward Port zendframework#6007
…validator-plugin-manager' into develop Close zendframework#5998
…form-elements' into develop Close zendframework#5989 Forward Port zendframework#5989
…-service-factory-without-intl' into develop Close zendframework#5979 zendframework#5978 Forward Port zendframework#5979 zendframework#5978
…ork#6051-di-abstract-factory-without-instantiators-fallback' into develop Close zendframework#5959 zendframework#6022 zendframework#6051 Forward Port zendframework#5959 zendframework#6022 zendframework#6051
…rced-as-array' into develop Close zendframework#5956
…module-manager-init' into develop Close zendframework#5948 Forward Port zendframework#5948
…tionServiceInterface Use AuthenticationServiceInterface as type
…callable that was instantiated Also moving success path to the end of the code block
…-hinting' into develop Optional type hints as of phpDocumentor/phpDocumentor#1194 Close zendframework#6038 Forward Port zendframework#6038
…oleans' into develop Close zendframework#6277 Forward Port zendframework#6277
…sts-stability' into develop Close zendframework#6303 Close zendframework#5144 Forward Port zendframework#6303 Forward Port zendframework#5144
…ice-config' into develop Close zendframework#6266 Forward Port zendframework#6266
…velop Close zendframework#6325 Forward Port zendframework#6325
This will enable users to quickly set "future" headers (e.g., Expires): ```php $headers->addHeader(Expires::fromTime('+12 hours')); ``` Includes tests :)
@@ -89,6 +89,34 @@ public static function fromString($headerLine) | |||
} | |||
|
|||
/** | |||
* Create date-based header from Unix time or strtotime()-compatible string | |||
* | |||
* @param $time |
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.
Missing type.
I think that method name is a bit misguiding. Name it something like |
{ | ||
$dateHeader = new static(); | ||
|
||
if (!is_int($time)) { |
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.
Do we really want to accept 2 different formats in a single method?
… and updating tests accordingly.
Ocramius
added a commit
that referenced
this pull request
Nov 14, 2014
…me' into develop Close #6338
I've manually merged this into See 3e1e0e2 Thanks @beryllium |
gianarb
pushed a commit
to zendframework/zend-http
that referenced
this pull request
May 15, 2015
…e` docblocks/code, simplified logic as well
gianarb
pushed a commit
to zendframework/zend-http
that referenced
this pull request
May 15, 2015
…header-from-time-and-datetime' into develop Close zendframework/zendframework#6338
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This will enable users to quickly set "future" headers (e.g., Expires):
Includes tests :)