From 584feaa5d12e87f491d67b1437d7d114ca1830bc Mon Sep 17 00:00:00 2001 From: Demin Yin Date: Thu, 4 Jan 2024 00:51:28 -0800 Subject: [PATCH] support customized local configuration files for PHPStan and PHPUnit (#110) --- .gitignore | 4 +++- composer.json | 4 ++-- phpstan.neon => phpstan.neon.dist | 4 ++++ phpunit.xml => phpunit.xml.dist | 0 4 files changed, 9 insertions(+), 3 deletions(-) rename phpstan.neon => phpstan.neon.dist (90%) rename phpunit.xml => phpunit.xml.dist (100%) diff --git a/.gitignore b/.gitignore index 6bd35f01..284e62bf 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,6 @@ vendor/ .phpunit* *.cache composer.lock -.vscode/ \ No newline at end of file +.vscode/ +/phpstan.neon +/phpunit.xml diff --git a/composer.json b/composer.json index f58b47bf..50847dc3 100644 --- a/composer.json +++ b/composer.json @@ -69,9 +69,9 @@ "post-autoload-dump": [ "rm -rf runtime/container" ], - "test": "co-phpunit --prepend test/bootstrap.php -c phpunit.xml --colors=always", + "test": "co-phpunit --prepend test/bootstrap.php --colors=always", "cs-fix": "php-cs-fixer fix $1", - "analyse": "phpstan analyse --memory-limit 300M -l 0 -c phpstan.neon ./app ./config", + "analyse": "phpstan analyse --memory-limit 300M", "start": [ "Composer\\Config::disableProcessTimeout", "php ./bin/hyperf.php start" diff --git a/phpstan.neon b/phpstan.neon.dist similarity index 90% rename from phpstan.neon rename to phpstan.neon.dist index e1d971f1..8bc5f33f 100644 --- a/phpstan.neon +++ b/phpstan.neon.dist @@ -4,6 +4,10 @@ # vendor/bin/phpstan analyse app --memory-limit 200M -l 0 # parameters: + level: 0 + paths: + - ./app + - ./config reportUnmatchedIgnoredErrors: false ignoreErrors: - '#Static call to instance method Hyperf\\HttpServer\\Router\\Router::[a-zA-Z0-9\\_]+\(\)#' diff --git a/phpunit.xml b/phpunit.xml.dist similarity index 100% rename from phpunit.xml rename to phpunit.xml.dist