mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +00:00
substr() returns an empty string instead of false in 8.0
an empty string will pass through preg_match_all() without any harmful effects, so we don't need to check for it.
This commit is contained in:
@@ -503,9 +503,6 @@ final class Utils{
|
||||
*/
|
||||
public static function parseDocComment(string $docComment) : array{
|
||||
$rawDocComment = substr($docComment, 3, -2); //remove the opening and closing markers
|
||||
if($rawDocComment === false){ //usually empty doc comment, but this is safer and statically analysable
|
||||
return [];
|
||||
}
|
||||
preg_match_all('/(*ANYCRLF)^[\t ]*(?:\* )?@([a-zA-Z\-]+)(?:[\t ]+(.+?))?[\t ]*$/m', $rawDocComment, $matches);
|
||||
|
||||
return array_combine($matches[1], $matches[2]);
|
||||
|
Reference in New Issue
Block a user