-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Description
<?php declare(strict_types = 1);
$a = [1, new stdClass()];
$b = array_map(function (string $s) : string { return $s; }, $a);Expected: argument passed to first arg of array_map is wrong
Actual: No issues
https://phpstan.org/r/15291a0f-d267-4eec-87d3-61ef0803df57
Would have flagged this code:
phpstan/src/Testing/RuleTestCase.php
Lines 128 to 133 in 48724f8
| $actualErrors = array_map( | |
| static function (Error $error): string { | |
| return sprintf('%02d: %s', $error->getLine(), $error->getMessage()); | |
| }, | |
| $actualErrors | |
| ); |
which expects is passed string[]|\PHPStan\Analyser\Error[]
Reactions are currently unavailable