Skip to content

Commit 873f585

Browse files
committed
Replace with $phpDocNode->getPureUnlessCallableIsImpureTagValues()
1 parent 3331301 commit 873f585

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/PhpDoc/PhpDocNodeResolver.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
use function count;
4949
use function in_array;
5050
use function method_exists;
51-
use function preg_split;
5251
use function str_starts_with;
5352
use function substr;
5453

@@ -426,14 +425,8 @@ public function resolveParamImmediatelyInvokedCallable(PhpDocNode $phpDocNode):
426425
public function resolveParamPureUnlessCallableIsImpure(PhpDocNode $phpDocNode): array
427426
{
428427
$parameters = [];
429-
// TODO: implement phpstan/phpdoc-parser
430-
foreach ($phpDocNode->getTagsByName('@pure-unless-callable-impure') as $tag) {
431-
$value = preg_split('/\s/u', (string) $tag->value)[0] ?? null;
432-
if ($value === null || !str_starts_with($value, '$')) {
433-
continue;
434-
}
435-
436-
$parameters[substr($value, 1)] = true;
428+
foreach ($phpDocNode->getPureUnlessCallableIsImpureTagValues() as $tag) {
429+
$parameters[$tag->parameterName] = true;
437430
}
438431

439432
return $parameters;

0 commit comments

Comments
 (0)