Commit 8af2f70
committed
Less_Parser: Fix SetImportDirs() type hint to accept callable without key
The way this is used in practice, in MediaWiki, in ParserTest::testSetImportDirs,
and in the parameter documentation on this very method, is without a
(meaningless) string key.
During a downstream PR at https://github.com/flarum/framework/pull/4225/files,
I found PHPStan failing on:
```
$parser->SetImportDirs([ $function ]);
// PHPStan:
// Parameter #1 $dirs of method Less_Parser::SetImportDirs()
// expects
// array<string, (callable(): mixed)|string>,
// array{callable(): mixed}
// given.
```
Note that PHPStan 1.11.0 understands `phan-param` as alias for `param`,
so it will parse it the same way, which is good, this isn't an issue
with Phan vs PHPStan. Our documented typehint is actually incomplete.
Ref phpstan/phpstan#10996
Change-Id: Id5953eaa3e3a62f6b29ec533a5393ef32dbb10981 parent fd255ab commit 8af2f70
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
599 | 599 | | |
600 | 600 | | |
601 | 601 | | |
602 | | - | |
| 602 | + | |
603 | 603 | | |
604 | 604 | | |
605 | 605 | | |
| |||
0 commit comments