File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 46
46
use function count ;
47
47
use function in_array ;
48
48
use function method_exists ;
49
- use function preg_split ;
50
49
use function str_starts_with ;
51
50
use function substr ;
52
51
@@ -423,18 +422,13 @@ public function resolveParamImmediatelyInvokedCallable(PhpDocNode $phpDocNode):
423
422
public function resolveParamPureUnlessCallableIsImpure (PhpDocNode $ phpDocNode ): array
424
423
{
425
424
$ 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 ;
432
427
}
433
428
434
429
return $ parameters ;
435
430
}
436
431
437
-
438
432
/**
439
433
* @return array<string, ParamClosureThisTag>
440
434
*/
You can’t perform that action at this time.
0 commit comments