22declare(strict_types=1);
31use
function str_contains;
32use
function str_ends_with;
33use
const FILE_IGNORE_NEW_LINES;
34use
const FILE_SKIP_EMPTY_LINES;
43 return is_file($path) && str_ends_with($path,
".php");
57 $content = @file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
58 if($content ===
false){
62 $insideHeader =
false;
64 $docCommentLines = [];
65 foreach($content as $line){
67 if(str_contains($line,
"/**")){
74 $docCommentLines[] = $line;
76 if(str_contains($line,
"*/")){
81 $data = Utils::parseDocComment(implode(
"\n", $docCommentLines));
82 if(count($data) !== 0){
83 return new PluginDescription($data);
getPluginDescription(string $file)
canLoadPlugin(string $path)