Skip to content

Commit 081f883

Browse files
committed
Replace with $phpDocNode->getPureUnlessCallableIsImpureTagValues()
1 parent a27956a commit 081f883

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/PhpDoc/PhpDocNodeResolver.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
use function count;
4747
use function in_array;
4848
use function method_exists;
49-
use function preg_split;
5049
use function str_starts_with;
5150
use function substr;
5251

@@ -423,18 +422,13 @@ public function resolveParamImmediatelyInvokedCallable(PhpDocNode $phpDocNode):
423422
public function resolveParamPureUnlessCallableIsImpure(PhpDocNode $phpDocNode): array
424423
{
425424
$parameters = [];
426-
// TODO: implement phpstan/phpdoc-parser
427-
foreach ($phpDocNode->getTagsByName('@pure-unless-callable-impure') as $tag) {
428-
$value = preg_split('/\s/u', (string)$tag->value)[0] ?? null;
429-
if ($value !== null && str_starts_with($value, '$')) {
430-
$parameters[substr($value, 1)] = true;
431-
}
425+
foreach ($phpDocNode->getPureUnlessCallableIsImpureTagValues() as $tag) {
426+
$parameters[$tag->parameterName] = true;
432427
}
433428

434429
return $parameters;
435430
}
436431

437-
438432
/**
439433
* @return array<string, ParamClosureThisTag>
440434
*/

0 commit comments

Comments
 (0)