diff --git a/src/Php/ArgInfo.php b/src/Php/ArgInfo.php index 0bb403f3..abf142e5 100644 --- a/src/Php/ArgInfo.php +++ b/src/Php/ArgInfo.php @@ -7,4 +7,4 @@ class ArgInfo public string $name; public string $type; public string $default = ''; -} \ No newline at end of file +} diff --git a/src/Php/Extractor.php b/src/Php/Extractor.php index aee60288..401771fe 100644 --- a/src/Php/Extractor.php +++ b/src/Php/Extractor.php @@ -611,4 +611,4 @@ class Extractor return $md; } -} \ No newline at end of file +} diff --git a/src/Php/FileScanner.php b/src/Php/FileScanner.php index 71a051d5..30e9f822 100644 --- a/src/Php/FileScanner.php +++ b/src/Php/FileScanner.php @@ -9,15 +9,15 @@ class FileScanner private string $directory; private array $excludePatterns; - const array PHP_EXT = ['php']; - const array CPP_EXT = ['cpp', 'cxx', 'cc']; + public const array PHP_EXT = ['php']; + public const array CPP_EXT = ['cpp', 'cxx', 'cc']; public function __construct(string $directory) { if (!is_dir($directory)) { throw new \InvalidArgumentException("Directory does not exist: $directory"); } - + $this->directory = rtrim($directory, DIRECTORY_SEPARATOR); $this->excludePatterns = []; } @@ -32,12 +32,12 @@ class FileScanner return pathinfo($path, PATHINFO_EXTENSION); } - static function isPhpFile(string $file): bool + public static function isPhpFile(string $file): bool { return in_array(self::getFileExt($file), self::PHP_EXT); } - static function isCppFile(string $file): bool + public static function isCppFile(string $file): bool { return in_array(self::getFileExt($file), self::CPP_EXT); } @@ -77,7 +77,7 @@ class FileScanner $iterator = new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator($this->directory, FilesystemIterator::SKIP_DOTS) ); - + foreach ($iterator as $file) { if ($file->isFile()) { if (self::isPhpFile($file)) { @@ -99,4 +99,4 @@ class FileScanner { return fnmatch($pattern, $path, FNM_PATHNAME); } -} \ No newline at end of file +} diff --git a/src/Php/FileSorter.php b/src/Php/FileSorter.php index 38c21e1e..91fd27db 100644 --- a/src/Php/FileSorter.php +++ b/src/Php/FileSorter.php @@ -91,4 +91,4 @@ class FileSorter return array_unique($files); } -} \ No newline at end of file +} diff --git a/src/Php/FunctionDef.php b/src/Php/FunctionDef.php index 6c5a2ede..cf6e8667 100644 --- a/src/Php/FunctionDef.php +++ b/src/Php/FunctionDef.php @@ -9,4 +9,4 @@ class FunctionDef public string $params; public string $returnType; public int $argCountRequired = 0; -} \ No newline at end of file +} diff --git a/src/Php/RedoException.php b/src/Php/RedoException.php index 67ed9a4f..2238636e 100644 --- a/src/Php/RedoException.php +++ b/src/Php/RedoException.php @@ -4,5 +4,4 @@ namespace PhpAot\Php; class RedoException extends \RuntimeException { - -} \ No newline at end of file +} diff --git a/src/Php/Reflection.php b/src/Php/Reflection.php index feedabaf..33c71eff 100644 --- a/src/Php/Reflection.php +++ b/src/Php/Reflection.php @@ -10,11 +10,12 @@ class Reflection { private static array $functions = []; - static function getFunction(string $fn) + public static function getFunction(string $fn) { if (!isset(self::$functions[$fn])) { try { - $ref = new ReflectionFunction($fn);; + $ref = new ReflectionFunction($fn); + ; } catch (\ReflectionException $e) { return null; } @@ -23,7 +24,7 @@ class Reflection return self::$functions[$fn]; } - static function getFunctionReturnType(string $fn): ?string + public static function getFunctionReturnType(string $fn): ?string { $func = self::getFunction($fn); if (!$func) { @@ -51,4 +52,4 @@ class Reflection } return $args[$index]; } -} \ No newline at end of file +} diff --git a/src/Php/Unsupported.php b/src/Php/Unsupported.php index cc41db5f..97bf1179 100644 --- a/src/Php/Unsupported.php +++ b/src/Php/Unsupported.php @@ -4,5 +4,4 @@ namespace PhpAot\Php; class Unsupported extends \RuntimeException { - -} \ No newline at end of file +}