initial commit for macOS support

This commit is contained in:
crazywhalecc
2023-03-18 17:32:21 +08:00
parent 64054f16c5
commit 4eee09c390
50 changed files with 4385 additions and 6 deletions

View File

@@ -10,8 +10,6 @@ use Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator;
class FileSystem
{
private static $source_cache;
/**
* @throws FileSystemException
*/
@@ -291,11 +289,15 @@ class FileSystem
}
/**
* @param null|mixed $rule
* @param mixed $return_path_value
* 获取该路径下的所有类名,根据 psr-4 方式
*
* @param string $dir 目录
* @param string $base_namespace 基类命名空间
* @param null|mixed $rule 规则回调
* @param bool|string $return_path_value 是否返回路径对应的数组,默认只返回类名列表
* @throws FileSystemException
*/
public static function getClassesPsr4(string $dir, string $base_namespace, $rule = null, $return_path_value = false): array
public static function getClassesPsr4(string $dir, string $base_namespace, mixed $rule = null, bool|string $return_path_value = false): array
{
$classes = [];
// 扫描目录使用递归模式相对路径模式因为下面此路径要用作转换成namespace