Uh oh!
There was an error while loading. Please reload this page.
Add request header accessors (à la PSR-7) - #103
Conversation
| * there's only a single value or an array of strings if this header has | ||
| * multiple values. | ||
| * | ||
| * Note that this differs from the PSR-7 implementation of this method. |
There was a problem hiding this comment.
It's probably worth mentioning in which way it differs.
| * there's only a single value or an array of strings if this header has | ||
| * multiple values. | ||
| * | ||
| * Note that this differs from the PSR-7 implementation of this method. |
| foreach ($this->headers as $key => $value) { | ||
| if (strtolower($key) === $name) { | ||
| foreach((array)$value as $one) { | ||
| $found []= $one; |
There was a problem hiding this comment.
Shouldn't this be $found[] = $one;?
There was a problem hiding this comment.
There are valid reasons for both styles IMO, but I have no real preference here, so yeah 👍
There was a problem hiding this comment.
Not used to this syntax, but I prefer to be consistent 😄
clue
commented
Feb 9, 2017
Updated |
kelunik
commented
Feb 9, 2017
@clue What's the reason for differing from PSR-7 here? I think the PSR-7 behavior makes more sense. |
WyriHaximus
commented
Feb 9, 2017
@kelunik mainly that this will go into 0.4.3 and PSR-7 will come in 0.5 so this is more a step in the right direction 😄 |
kelunik
commented
Feb 9, 2017
@WyriHaximus I missed that |
WyriHaximus
commented
Feb 10, 2017
@kelunik np 😄 |
clue
commented
Feb 10, 2017
Rebased on current master to resolve merge conflicts |
Note that this PR does not implement the PSR-7 interfaces, but follows its method signatures for the header methods to ease a future switch to PSR-7 via #28.
This is also the base for an upcoming PR that fixes#51.