From 0110f1947aeab08cb6ed0f1f38629bd31cddde95 Mon Sep 17 00:00:00 2001 From: whwyy Date: Wed, 31 Dec 2025 01:07:57 +0800 Subject: [PATCH] eee --- Scanner.php | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Scanner.php b/Scanner.php index 88d40c3..8fea8a8 100644 --- a/Scanner.php +++ b/Scanner.php @@ -36,17 +36,16 @@ class Scanner extends Component /** * @var array 配置选项 */ - private array $config - = [ - 'skip_patterns' => ['/vendor/', '/tests/', '/cache/', '/node_modules/'], - 'skip_directories' => [], - 'extensions' => ['php'], - 'max_depth' => 20, - 'follow_links' => false, - 'cache_enabled' => true, - 'cache_ttl' => 3600, - 'debug' => false, - ]; + private array $config = [ + 'skip_patterns' => ['/vendor/', '/tests/', '/cache/', '/node_modules/'], + 'skip_directories' => [], + 'extensions' => ['php'], + 'max_depth' => 20, + 'follow_links' => false, + 'cache_enabled' => true, + 'cache_ttl' => 3600, + 'debug' => false, + ]; /** * 设置扫描器配置 @@ -178,7 +177,7 @@ class Scanner extends Component } catch (Throwable $e) { $this->logError($e, [ 'file' => $path, - 'action' => 'process_file' + 'action' => 'process_file', ]); // 如果是语法错误,可以选择抛出或记录 @@ -246,7 +245,7 @@ class Scanner extends Component if ($this->config['debug']) { $this->logError($e, [ 'file' => $path, - 'action' => 'opcache_optimize' + 'action' => 'opcache_optimize', ]); } } @@ -329,7 +328,7 @@ class Scanner extends Component } catch (Throwable $e) { $this->logError($e, [ 'class' => $class, - 'action' => 'analyze_class' + 'action' => 'analyze_class', ]); } } @@ -386,7 +385,7 @@ class Scanner extends Component 'class' => $class, 'method' => $method->getName(), 'attribute' => $attributeName, - 'action' => 'process_attribute' + 'action' => 'process_attribute', ]); } } @@ -468,7 +467,7 @@ class Scanner extends Component 'files' => $this->files, 'mtimes' => $this->fileMtimes, 'timestamp' => time(), - 'version' => '1.0' + 'version' => '1.0', ]; file_put_contents($cacheFile, json_encode($data, JSON_PRETTY_PRINT));