Skip to content

Commit

Permalink
Merge pull request #9356 from edsrzf/setrawcookie-impure
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Feb 21, 2023
2 parents 471a8c6 + a03299f commit 28db105
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Codebase/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ public function isCallMapFunctionPure(
'call_user_func', 'call_user_func_array', 'define', 'create_function',

// http
'header', 'header_remove', 'http_response_code', 'setcookie',
'header', 'header_remove', 'http_response_code', 'setcookie', 'setrawcookie',

// output buffer
'ob_start', 'ob_end_clean', 'ob_get_clean', 'readfile', 'printf', 'var_dump', 'phpinfo',
Expand Down
7 changes: 7 additions & 0 deletions tests/UnusedCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,13 @@ function makesACounter(int $i) : Counter {
return $c;
}',
],
'setRawCookieImpure' => [
'code' => '<?php
setrawcookie(
"name",
"value",
);',
],
'usedUsort' => [
'code' => '<?php
/** @param string[] $arr */
Expand Down

0 comments on commit 28db105

Please sign in to comment.