CodeExplorer getSnippetFinder example
public function loadSnippetFilesFromApp(string
$author, string
$appPath, bool
$isAbsolutePath = false
): array
{ $snippetDir =
$this->
getSnippetDir($appPath,
$isAbsolutePath);
if (!
is_dir($snippetDir)) { return [];
} $finder =
$this->
getSnippetFinder($snippetDir);
$snippetFiles =
[];
foreach ($finder->
getIterator() as $fileInfo) { $nameParts =
explode('.',
$fileInfo->
getFilenameWithoutExtension());
$snippetFile =
$this->
createSnippetFile($nameParts,
$fileInfo,
$author);
if ($snippetFile) { $snippetFiles[] =
$snippetFile;
} }