This commit is contained in:
2021-07-27 16:15:28 +08:00
parent a36f876792
commit 887209cfaa
3 changed files with 113 additions and 109 deletions
+3 -3
View File
@@ -165,20 +165,20 @@ class Loader extends BaseObject
/**
* @param string $path
* @param string|array $outPath
* @return array
* @throws Exception
*/
public function loadByDirectory(string $path)
public function loadByDirectory(string $path): array
{
try {
$path = '/' . trim($path, '/');
$paths = [];
foreach (static::$_directory as $key => $_path) {
$key = '/' . trim($key, '/');
if (!str_starts_with($key, $path)) {
continue;
}
unset(static::$_directory[$key]);
foreach ($_path as $item) {
$paths[] = $item;
}