1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Bypass bug

This commit is contained in:
Daniil Gentili 2022-12-16 19:18:33 +01:00
parent f5b6889c32
commit 2c00c64304
2 changed files with 5 additions and 67 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="dev-master@2b0e979ee9434afdeb9dd59a3219bf4029c62dc8"> <files psalm-version="dev-master@6eb37b9dc2321e4eaade9d3d2dca1aff6f2c0a8f">
<file src="examples/TemplateChecker.php"> <file src="examples/TemplateChecker.php">
<PossiblyUndefinedIntArrayOffset occurrences="2"> <PossiblyUndefinedIntArrayOffset occurrences="2">
<code>$comment_block-&gt;tags['variablesfrom'][0]</code> <code>$comment_block-&gt;tags['variablesfrom'][0]</code>
@ -390,6 +390,9 @@
<InvalidArgument occurrences="1"> <InvalidArgument occurrences="1">
<code>$class_strings ?: null</code> <code>$class_strings ?: null</code>
</InvalidArgument> </InvalidArgument>
<RedundantCondition occurrences="2">
<code>$is_replace</code>
</RedundantCondition>
</file> </file>
<file src="src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReduceReturnTypeProvider.php"> <file src="src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReduceReturnTypeProvider.php">
<PossiblyUndefinedIntArrayOffset occurrences="1"> <PossiblyUndefinedIntArrayOffset occurrences="1">
@ -593,10 +596,6 @@
<ImpurePropertyAssignment occurrences="1"> <ImpurePropertyAssignment occurrences="1">
<code>$key_type-&gt;possibly_undefined</code> <code>$key_type-&gt;possibly_undefined</code>
</ImpurePropertyAssignment> </ImpurePropertyAssignment>
<InvalidPropertyAssignmentValue occurrences="2">
<code>$fallback_params</code>
<code>$fallback_params</code>
</InvalidPropertyAssignmentValue>
<PossiblyUndefinedIntArrayOffset occurrences="3"> <PossiblyUndefinedIntArrayOffset occurrences="3">
<code>$this-&gt;properties[0]</code> <code>$this-&gt;properties[0]</code>
<code>$this-&gt;properties[0]</code> <code>$this-&gt;properties[0]</code>
@ -705,64 +704,4 @@
<code>$subNodes['expr']</code> <code>$subNodes['expr']</code>
</PossiblyUndefinedStringArrayOffset> </PossiblyUndefinedStringArrayOffset>
</file> </file>
<file src="vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php">
<InvalidPropertyAssignmentValue occurrences="1">
<code>$parts</code>
</InvalidPropertyAssignmentValue>
</file>
<file src="vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php">
<InvalidPropertyAssignmentValue occurrences="1">
<code>$conds</code>
</InvalidPropertyAssignmentValue>
</file>
<file src="vendor/nikic/php-parser/lib/PhpParser/Node/Name.php">
<InvalidPropertyAssignmentValue occurrences="1">
<code>self::prepareName($name)</code>
</InvalidPropertyAssignmentValue>
</file>
<file src="vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php">
<InvalidPropertyAssignmentValue occurrences="1">
<code>$stmts</code>
</InvalidPropertyAssignmentValue>
</file>
<file src="vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php">
<InvalidPropertyAssignmentValue occurrences="1">
<code>$stmts</code>
</InvalidPropertyAssignmentValue>
</file>
<file src="vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php">
<InvalidPropertyAssignmentValue occurrences="1">
<code>$stmts</code>
</InvalidPropertyAssignmentValue>
</file>
<file src="vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php">
<InvalidPropertyAssignmentValue occurrences="1">
<code>$stmts</code>
</InvalidPropertyAssignmentValue>
</file>
<file src="vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php">
<InvalidPropertyAssignmentValue occurrences="1">
<code>$stmts</code>
</InvalidPropertyAssignmentValue>
</file>
<file src="vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php">
<InvalidPropertyAssignmentValue occurrences="1">
<code>$stmts</code>
</InvalidPropertyAssignmentValue>
</file>
<file src="vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php">
<InvalidPropertyAssignmentValue occurrences="1">
<code>$stmts</code>
</InvalidPropertyAssignmentValue>
</file>
<file src="vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php">
<InvalidPropertyAssignmentValue occurrences="1">
<code>$stmts</code>
</InvalidPropertyAssignmentValue>
</file>
<file src="vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php">
<InvalidPropertyAssignmentValue occurrences="1">
<code>$stmts</code>
</InvalidPropertyAssignmentValue>
</file>
</files> </files>

View File

@ -22,7 +22,6 @@ use function array_values;
use function count; use function count;
use function is_string; use function is_string;
use function max; use function max;
use function substr;
/** /**
* @internal * @internal
@ -113,7 +112,7 @@ class ArrayMergeReturnTypeProvider implements FunctionReturnTypeProviderInterfac
} }
if (is_string($key)) { if (is_string($key)) {
$all_int_offsets = false; $all_int_offsets = false;
} else if (!$is_replace) { } elseif (!$is_replace) {
if ($unpacking_indefinite_number_of_args || $type->possibly_undefined) { if ($unpacking_indefinite_number_of_args || $type->possibly_undefined) {
$added_inner_values = true; $added_inner_values = true;
$inner_value_types = array_merge( $inner_value_types = array_merge(