Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,18 @@ public function testBug12755(): void
]);
}

public function testBugStrictRule147(): void
{
$this->treatPhpDocTypesAsCertain = true;
$this->analyse([__DIR__ . '/data/bug-strict-147.php'], []);
}

public function testBugStrictRule143(): void
{
$this->treatPhpDocTypesAsCertain = true;
$this->analyse([__DIR__ . '/data/bug-strict-143.php'], []);
}

public function testBug12412(): void
{
$this->treatPhpDocTypesAsCertain = true;
Expand Down
7 changes: 7 additions & 0 deletions tests/PHPStan/Rules/Comparison/data/bug-strict-143.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php declare(strict_types = 1);

namespace BugStrict143;

function foo(string $key, array $arr): void {
$found = array_key_exists($key . 'foo', $arr) && array_key_exists($key . 'bar', $arr);
}
9 changes: 9 additions & 0 deletions tests/PHPStan/Rules/Comparison/data/bug-strict-147.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php declare(strict_types = 1);

namespace BugStrict147;

$array = ['a', 'c', 'b'];
asort($array);
if (array_is_list($array)) {
print 'array was in order';
}
Loading