Skip to content

Commit 02959ca

Browse files
authored
Add PHP 8.5 partitioned cookie attribute to session_get_cookie_params() and the cookie option shapes (#6004)
1 parent 1476c1d commit 02959ca

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎resources/functionMap_php85delta.php‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,17 @@
1616
return [
1717
'new' => [
1818
'chr' => ['non-empty-string', 'ascii'=>'int<0,255>'],
19+
'session_get_cookie_params' => ['array{lifetime:0|positive-int,path:non-falsy-string,domain:string,secure:bool,httponly:bool,samesite:\'None\'|\'Lax\'|\'Strict\'|\'none\'|\'lax\'|\'strict\',partitioned:bool}'],
20+
'session_set_cookie_params\'1' => ['bool', 'options'=>'array{lifetime?:int,path?:string,domain?:string,secure?:bool,httponly?:bool,samesite?:\'None\'|\'Lax\'|\'Strict\'|\'none\'|\'lax\'|\'strict\',partitioned?:bool}'],
21+
'setcookie\'1' => ['bool', 'name'=>'string', 'value='=>'string', 'options='=>'array{ expires?:int, path?:string, domain?:string, secure?:bool, httponly?:bool, samesite?:\'None\'|\'Lax\'|\'Strict\'|\'none\'|\'lax\'|\'strict\', partitioned?:bool}'],
22+
'setrawcookie\'1' => ['bool', 'name'=>'string', 'value='=>'string', 'options='=>'array{ expires?:int, path?:string, domain?:string, secure?:bool, httponly?:bool, samesite?:\'None\'|\'Lax\'|\'Strict\'|\'none\'|\'lax\'|\'strict\', partitioned?:bool}'],
1923
'SQLite3Result::fetchAll' => ['($mode is SQLITE3_NUM ? list<non-empty-list<mixed>>|false : ($mode is SQLITE3_ASSOC ? list<non-empty-array<string,mixed>>|false : list<non-empty-array<int|string,mixed>>|false))', 'mode='=>'int'],
2024
],
2125
'old' => [
2226
'chr' => ['non-empty-string', 'ascii'=>'int'],
27+
'session_get_cookie_params' => ['array{lifetime:0|positive-int,path:non-falsy-string,domain:string,secure:bool,httponly:bool,samesite:\'None\'|\'Lax\'|\'Strict\'|\'none\'|\'lax\'|\'strict\'}'],
28+
'session_set_cookie_params\'1' => ['bool', 'options'=>'array{lifetime?:int,path?:string,domain?:string,secure?:bool,httponly?:bool,samesite?:\'None\'|\'Lax\'|\'Strict\'|\'none\'|\'lax\'|\'strict\'}'],
29+
'setcookie\'1' => ['bool', 'name'=>'string', 'value='=>'string', 'options='=>'array{ expires?:int, path?:string, domain?:string, secure?:bool, httponly?:bool, samesite?:\'None\'|\'Lax\'|\'Strict\'|\'none\'|\'lax\'|\'strict\'}'],
30+
'setrawcookie\'1' => ['bool', 'name'=>'string', 'value='=>'string', 'options='=>'array{ expires?:int, path?:string, domain?:string, secure?:bool, httponly?:bool, samesite?:\'None\'|\'Lax\'|\'Strict\'|\'none\'|\'lax\'|\'strict\'}'],
2331
]
2432
];
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php // lint >= 8.5
2+
3+
namespace SessionGetCookieParamsPhp85;
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
function test(): void
8+
{
9+
assertType("array{lifetime: int<0, max>, path: non-falsy-string, domain: string, secure: bool, httponly: bool, samesite: 'Lax'|'lax'|'None'|'none'|'Strict'|'strict', partitioned: bool}", session_get_cookie_params());
10+
assertType('true', array_key_exists('partitioned', session_get_cookie_params()));
11+
}

0 commit comments

Comments
 (0)