Skip to content

Commit

Permalink
Merge pull request #9435 from vimeo/revert-9434-array_pop-is-impure
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Mar 1, 2023
2 parents 83051cf + 5130563 commit 839dc10
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
1 change: 0 additions & 1 deletion src/Psalm/Internal/Codebase/Functions.php
Expand Up @@ -476,7 +476,6 @@ public function isCallMapFunctionPure(
'date_default_timezone_set', 'assert_options', 'setlocale',
'set_exception_handler', 'set_time_limit', 'putenv', 'spl_autoload_register',
'spl_autoload_unregister', 'microtime', 'array_rand', 'set_include_path',
'array_pop',

// logging
'openlog', 'syslog', 'error_log', 'define_syslog_variables',
Expand Down
24 changes: 0 additions & 24 deletions tests/PureAnnotationTest.php
Expand Up @@ -902,30 +902,6 @@ function (): void {}
',
'error_message' => 'ImpureFunctionCall',
],
'array_popIsNotMutationFree' => [
'code' => <<<'PHP'
<?php
class Stack
{
/** @var array<string> */
private array $stack = [];
public function push(string $item): void
{
$this->stack[] = $item;
}
/** @psalm-mutation-free */
public function next(): string|null
{
return array_pop($this->stack);
}
}
PHP,
'error_message' => 'ImpureFunctionCall',
'ignored_issues' => [],
'php_version' => '8.0',
],
];
}
}

0 comments on commit 839dc10

Please sign in to comment.