-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #447 from nanasess/use-phpstan
PHPStan による静的解析の導入
- Loading branch information
Showing
4 changed files
with
116 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: PHPStan | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
tags: | ||
- '*' | ||
paths: | ||
- '**' | ||
- '!*.md' | ||
pull_request: | ||
paths: | ||
- '**' | ||
- '!*.md' | ||
|
||
jobs: | ||
phpstan: | ||
name: PHPStan | ||
|
||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:12 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_DB: postgres | ||
ports: | ||
- 5432:5432 | ||
# needed because the postgres container does not provide a healthcheck | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v2 | ||
- name: Setup PHP | ||
uses: nanasess/setup-php@master | ||
with: | ||
php-version: '8.0' | ||
- name: composer install | ||
run: | | ||
sudo composer selfupdate | ||
composer install --dev --no-interaction -o --apcu-autoloader | ||
composer require --dev --ignore-platform-req=php phpstan/phpstan | ||
- name: Setup to EC-CUBE | ||
env: | ||
DB: pgsql | ||
USER: postgres | ||
DBUSER: postgres | ||
DBPASS: password | ||
DBNAME: eccube_db | ||
DBPORT: 5432 | ||
HTTP_URL: http://localhost:8085/ | ||
HTTPS_URL: http://localhost:8085/ | ||
run: | | ||
./eccube_install.sh ${DB} | ||
- name: PHPStan | ||
run: data/vendor/bin/phpstan analyze data/ --error-format=github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
parameters: | ||
level: 1 | ||
bootstrapFiles: | ||
- tests/require.php | ||
excludePaths: | ||
- data/Smarty/templates_c/* | ||
- data/module/SOAP/* | ||
- data/vendor/* | ||
- data/downloads/* | ||
- data/module/Calendar/Engine/PearDate.php | ||
- data/class/helper/SC_Helper_Mobile.php | ||
- data/class/SC_MobileEmoji.php | ||
- data/class/SC_MobileImage.php | ||
- data/**/flycheck_*.php | ||
ignoreErrors: | ||
- | ||
message: "#^Call to an undefined static method PEAR\\:\\:raiseError\\(\\)\\.$#" | ||
paths: | ||
- data/module/HTTP/Request.php | ||
- data/module/Net/SMTP.php | ||
- data/module/Calendar/Calendar.php | ||
- data/module/Calendar/Decorator.php | ||
- data/module/Calendar/Factory.php | ||
- | ||
message: "#^Call to an undefined method Net_Socket\\:\\:raiseError\\(\\)\\.$#" | ||
path: data/module/Net/Socket.php | ||
- | ||
message: "#^Call to static method factory\\(\\) on an unknown class Auth_SASL\\.$#" | ||
path: data/module/Net/SMTP.php | ||
- | ||
message: "#^Call to static method dayOfWeek\\(\\) on an unknown class Date_Calc\\.#" | ||
path: data/module/Calendar/Util/Textual.php | ||
# - | ||
# message: "#^Constant SMARTY_PLUGINS_DIR not found\\.$#" | ||
# path: data/smarty_extends/* | ||
- | ||
message: "#^Function smarty_function_escape_special_chars not found\\.$#" | ||
path: data/smarty_extends/* | ||
- | ||
message: "#^Variable \\$values in isset\\(\\) is always null\\.$#" | ||
paths: | ||
- data/smarty_extends/function.html_radios_ex.php | ||
- data/smarty_extends/function.html_checkboxes_ex.php | ||
- | ||
message: "#^Undefined variable\\: \\$tags$#" | ||
paths: | ||
- data/smarty_extends/function.html_radios_ex.php | ||
- data/smarty_extends/function.html_checkboxes_ex.php | ||
- | ||
message: "#^Variable \\$SJIS_widths might not be defined\\.$#" | ||
path: data/class/helper/SC_Helper_FPDI.php |