mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-09 11:31:49 +00:00
Utils: silence PHPStan warning about array_combine() result
phpstan doesn't account for having 2 arrays of the same size, and even if it did, the size cannot be inferred easily here.
This commit is contained in:
parent
099562d582
commit
a51a16a55c
@ -616,7 +616,9 @@ class Utils{
|
|||||||
public static function parseDocComment(string $docComment) : array{
|
public static function parseDocComment(string $docComment) : array{
|
||||||
preg_match_all('/(*ANYCRLF)^[\t ]*\* @([a-zA-Z]+)(?:[\t ]+(.+))?[\t ]*$/m', $docComment, $matches);
|
preg_match_all('/(*ANYCRLF)^[\t ]*\* @([a-zA-Z]+)(?:[\t ]+(.+))?[\t ]*$/m', $docComment, $matches);
|
||||||
|
|
||||||
return array_combine($matches[1], $matches[2]);
|
$result = array_combine($matches[1], $matches[2]);
|
||||||
|
if($result === false) throw new AssumptionFailedError("array_combine() doesn't return false with two equal-sized arrays");
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user