-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes phpstan/phpstan#2689 Closes phpstan/phpstan#2714 Closes phpstan/phpstan#2846
- Loading branch information
1 parent
cb04a6e
commit 402b34a
Showing
6 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Bug2689; | ||
|
||
class HelloWorld | ||
{ | ||
/** | ||
* @var callable[] | ||
*/ | ||
private $listeners; | ||
|
||
public function addListener(string $name, callable $callback): void | ||
{ | ||
$this->listeners[$name][] = $callback; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Bug2714; | ||
|
||
function (): void | ||
{ | ||
$list = []; | ||
|
||
// creation of unpredictable values at 'type' key | ||
for ($i = 0; $i < 3; $i++) { | ||
$list[] = [ | ||
'type' => str_repeat('a', rand(1, 10)), | ||
]; | ||
} | ||
|
||
$list[] = [ | ||
'type' => 'x', | ||
]; | ||
|
||
foreach ($list as $item) { | ||
if (in_array($item['type'], ['aaa', 'aaaa'], TRUE)) { | ||
echo 'OK'; | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Bug2846; | ||
|
||
class Test { | ||
public static function staticFunc(): void {} | ||
public static function callStatic(): void { | ||
call_user_func([static::class, 'staticFunc']); | ||
} | ||
} |