Commit f07d834
[1.12] IteratorAggregate for Cookie (#653)
* IteratorAggregate for Cookie
Was in a situation where I wanted a plain-array version of Cookie, was a little sad that I couldn't unpack it.
Previously:
var_dump([...$cookie]);
object(TypeError)#1261 (7) {
["message":protected]=>
string(44) "Only arrays and Traversables can be unpacked"
["string":"Error":private]=>
string(0) ""
["code":protected]=>
int(0)
(...)
Now:
var_dump([...$cookie]);
array(13) {
["name"]=>
string(9) "PHPSESSID"
["value"]=>
string(26) "<censored>"
["domain"]=>
string(13) "<censored>"
["path"]=>
string(1) "/"
["expires"]=>
int(-1)
["size"]=>
int(35)
["httpOnly"]=>
bool(true)
["secure"]=>
bool(false)
["session"]=>
bool(true)
["priority"]=>
string(6) "Medium"
["sameParty"]=>
bool(false)
["sourceScheme"]=>
string(6) "Secure"
["sourcePort"]=>
int(443)
}
* Properly declare return type
* Add missing backlash
---------
Co-authored-by: Graham Campbell <GrahamCampbell@users.noreply.github.com>1 parent fa06bc3 commit f07d834
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
105 | 110 | | |
0 commit comments