mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix callable negation
This commit is contained in:
parent
3df758d75f
commit
2e32a18222
@ -376,7 +376,8 @@ abstract class Atomic implements TypeNode
|
||||
|| $this instanceof TCallableString
|
||||
|| $this instanceof TCallableArray
|
||||
|| $this instanceof TCallableList
|
||||
|| $this instanceof TCallableKeyedArray;
|
||||
|| $this instanceof TCallableKeyedArray
|
||||
|| $this instanceof TClosure;
|
||||
}
|
||||
|
||||
public function isIterable(Codebase $codebase): bool
|
||||
|
@ -971,14 +971,16 @@ class ConditionalTest extends TestCase
|
||||
}
|
||||
strlen($a);',
|
||||
],
|
||||
'removeCallable' => [
|
||||
'removeCallableString' => [
|
||||
'<?php
|
||||
$s = rand(0,1) ? "strlen" : [1];
|
||||
if (!is_callable($s)) {
|
||||
array_pop($s);
|
||||
}
|
||||
|
||||
$a = rand(0, 1) ? (function(): void {}) : 1.1;
|
||||
}',
|
||||
],
|
||||
'removeCallableClosure' => [
|
||||
'<?php
|
||||
$a = rand(0, 1) ? (function(): void {}) : 1;
|
||||
if (!is_callable($a)) {
|
||||
echo $a;
|
||||
}',
|
||||
|
Loading…
Reference in New Issue
Block a user