@@ -305,6 +305,9 @@ discard block |
||
305 | 305 | return true; |
306 | 306 | } |
307 | 307 | |
308 | + /** |
|
309 | + * @param string|null $keyed_array_var_id |
|
310 | + */ |
|
308 | 311 | private static function taintArrayFetch( |
309 | 312 | StatementsAnalyzer $statements_analyzer, |
310 | 313 | PhpParser\Node\Expr\ArrayDimFetch $stmt, |
@@ -1468,6 +1471,9 @@ discard block |
||
1468 | 1471 | return $array_access_type; |
1469 | 1472 | } |
1470 | 1473 | |
1474 | + /** |
|
1475 | + * @param null|string $array_var_id |
|
1476 | + */ |
|
1471 | 1477 | private static function checkLiteralIntArrayOffset( |
1472 | 1478 | Type\Union $offset_type, |
1473 | 1479 | Type\Union $expected_offset_type, |
@@ -1517,6 +1523,9 @@ discard block |
||
1517 | 1523 | } |
1518 | 1524 | } |
1519 | 1525 | |
1526 | + /** |
|
1527 | + * @param null|string $array_var_id |
|
1528 | + */ |
|
1520 | 1529 | private static function checkLiteralStringArrayOffset( |
1521 | 1530 | Type\Union $offset_type, |
1522 | 1531 | Type\Union $expected_offset_type, |
@@ -2,50 +2,26 @@ |
||
2 | 2 | namespace Psalm\Internal\Analyzer\Statements\Expression\Assignment; |
3 | 3 | |
4 | 4 | use PhpParser; |
5 | -use PhpParser\Node\Expr\PropertyFetch; |
|
6 | -use PhpParser\Node\Stmt\PropertyProperty; |
|
7 | 5 | use Psalm\Internal\Analyzer\ClassLikeAnalyzer; |
8 | -use Psalm\Internal\Analyzer\NamespaceAnalyzer; |
|
9 | 6 | use Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer; |
10 | 7 | use Psalm\Internal\Analyzer\Statements\Expression\ExpressionIdentifier; |
11 | -use Psalm\Internal\Analyzer\Statements\Expression\Fetch\InstancePropertyFetchAnalyzer; |
|
12 | 8 | use Psalm\Internal\Analyzer\StatementsAnalyzer; |
13 | 9 | use Psalm\Internal\Analyzer\TypeAnalyzer; |
14 | 10 | use Psalm\Internal\FileManipulation\FileManipulationBuffer; |
15 | 11 | use Psalm\CodeLocation; |
16 | 12 | use Psalm\Context; |
17 | -use Psalm\Issue\DeprecatedProperty; |
|
18 | 13 | use Psalm\Issue\ImplicitToStringCast; |
19 | -use Psalm\Issue\InaccessibleProperty; |
|
20 | -use Psalm\Issue\InternalProperty; |
|
21 | -use Psalm\Issue\InvalidPropertyAssignment; |
|
22 | 14 | use Psalm\Issue\InvalidPropertyAssignmentValue; |
23 | -use Psalm\Issue\LoopInvalidation; |
|
24 | -use Psalm\Issue\MixedAssignment; |
|
25 | -use Psalm\Issue\MixedPropertyAssignment; |
|
26 | 15 | use Psalm\Issue\MixedPropertyTypeCoercion; |
27 | -use Psalm\Issue\NoInterfaceProperties; |
|
28 | -use Psalm\Issue\NullPropertyAssignment; |
|
29 | -use Psalm\Issue\PossiblyFalsePropertyAssignmentValue; |
|
30 | -use Psalm\Issue\PossiblyInvalidPropertyAssignment; |
|
31 | 16 | use Psalm\Issue\PossiblyInvalidPropertyAssignmentValue; |
32 | -use Psalm\Issue\PossiblyNullPropertyAssignment; |
|
33 | -use Psalm\Issue\PossiblyNullPropertyAssignmentValue; |
|
34 | 17 | use Psalm\Issue\PropertyTypeCoercion; |
35 | -use Psalm\Issue\UndefinedClass; |
|
36 | 18 | use Psalm\Issue\UndefinedPropertyAssignment; |
37 | -use Psalm\Issue\UndefinedMagicPropertyAssignment; |
|
38 | -use Psalm\Issue\UndefinedThisPropertyAssignment; |
|
39 | 19 | use Psalm\IssueBuffer; |
40 | 20 | use Psalm\Type; |
41 | -use Psalm\Type\Atomic\TNamedObject; |
|
42 | -use Psalm\Type\Atomic\TNull; |
|
43 | -use Psalm\Type\Atomic\TObject; |
|
44 | 21 | use function count; |
45 | 22 | use function in_array; |
46 | 23 | use function strtolower; |
47 | 24 | use function explode; |
48 | -use Psalm\Internal\Taint\TaintNode; |
|
49 | 25 | |
50 | 26 | /** |
51 | 27 | * @internal |
@@ -884,6 +884,7 @@ discard block |
||
884 | 884 | |
885 | 885 | /** |
886 | 886 | * @param non-empty-string $function_id |
887 | + * @param \Psalm\Storage\FunctionStorage|null $function_storage |
|
887 | 888 | */ |
888 | 889 | private static function getFunctionCallReturnType( |
889 | 890 | StatementsAnalyzer $statements_analyzer, |
@@ -1189,6 +1190,9 @@ discard block |
||
1189 | 1190 | return true; |
1190 | 1191 | } |
1191 | 1192 | |
1193 | + /** |
|
1194 | + * @param \Psalm\Storage\FunctionStorage|null $function_storage |
|
1195 | + */ |
|
1192 | 1196 | private static function checkFunctionCallPurity( |
1193 | 1197 | StatementsAnalyzer $statements_analyzer, |
1194 | 1198 | \Psalm\Codebase $codebase, |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | |
589 | 589 | $array_values = array_map( |
590 | 590 | /** |
591 | - * @return PhpParser\Node\Expr\ArrayItem |
|
591 | + * @return boolean |
|
592 | 592 | */ |
593 | 593 | function (PhpParser\Node\Arg $arg) { |
594 | 594 | return new PhpParser\Node\Expr\ArrayItem($arg->value); |
@@ -1346,6 +1346,9 @@ discard block |
||
1346 | 1346 | return true; |
1347 | 1347 | } |
1348 | 1348 | |
1349 | + /** |
|
1350 | + * @param \Psalm\Storage\MethodStorage|null $method_storage |
|
1351 | + */ |
|
1349 | 1352 | private static function taintReturnType( |
1350 | 1353 | StatementsAnalyzer $statements_analyzer, |
1351 | 1354 | PhpParser\Node\Expr\StaticCall $stmt, |
@@ -2,11 +2,6 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace Psalm\Internal\Codebase; |
4 | 4 | |
5 | -use Psalm\CodeLocation; |
|
6 | -use Psalm\Internal\Analyzer\StatementsAnalyzer; |
|
7 | -use Psalm\Internal\Provider\ClassLikeStorageProvider; |
|
8 | -use Psalm\Internal\Provider\FileReferenceProvider; |
|
9 | -use Psalm\Internal\Provider\FileStorageProvider; |
|
10 | 5 | use Psalm\Internal\Taint\Path; |
11 | 6 | use Psalm\Internal\Taint\Sink; |
12 | 7 | use Psalm\Internal\Taint\Source; |
@@ -17,7 +12,6 @@ discard block |
||
17 | 12 | use function array_merge; |
18 | 13 | use function array_merge_recursive; |
19 | 14 | use function strtolower; |
20 | -use UnexpectedValueException; |
|
21 | 15 | use function count; |
22 | 16 | use function implode; |
23 | 17 | use function substr; |