ScriptPluginLoader: fixed reading @tags from non-docblock lines preceding the first docblock

This commit is contained in:
Dylan K. Taylor 2021-11-24 17:07:34 +00:00
parent fc7d297f60
commit 726c5652f7
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -64,8 +64,12 @@ class ScriptPluginLoader implements PluginLoader{
$insideHeader = false; $insideHeader = false;
foreach($content as $line){ foreach($content as $line){
if(!$insideHeader and strpos($line, "/**") !== false){ if(!$insideHeader){
$insideHeader = true; if(strpos($line, "/**") !== false){
$insideHeader = true;
}else{
continue;
}
} }
if(preg_match("/^[ \t]+\\*[ \t]+@([a-zA-Z]+)([ \t]+(.*))?$/", $line, $matches) > 0){ if(preg_match("/^[ \t]+\\*[ \t]+@([a-zA-Z]+)([ \t]+(.*))?$/", $line, $matches) > 0){
@ -79,7 +83,7 @@ class ScriptPluginLoader implements PluginLoader{
$data[$key] = $content; $data[$key] = $content;
} }
if($insideHeader and strpos($line, "*/") !== false){ if(strpos($line, "*/") !== false){
break; break;
} }
} }