Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPStan による静的解析の導入 #4835

Merged
merged 4 commits into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
rm -rf $GITHUB_WORKSPACE/.coveralls.yml
rm -rf $GITHUB_WORKSPACE/.php_cs.dist
rm -rf $GITHUB_WORKSPACE/phpunit.xml.dist
rm -rf $GITHUB_WORKSPACE/phpstan.neon.dist
rm -rf $GITHUB_WORKSPACE/app.json
rm -rf $GITHUB_WORKSPACE/Procfile
rm -rf $GITHUB_WORKSPACE/LICENSE.txt
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PHPStan
on:
push:
branches:
- '*'
tags:
- '*'
paths:
- '**'
- '!*.md'
pull_request:
paths:
- '**'
- '!*.md'

jobs:
phpstan:
name: PHPStan

runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: Setup PHP
uses: nanasess/setup-php@master
with:
php-version: '7.4'
- name: composer install
run: |
sudo composer selfupdate --1
composer install --dev --no-interaction -o --apcu-autoloader
- name: PHPStan
run: |
composer require phpstan/phpstan --dev
vendor/bin/phpstan analyze src/ --error-format=github
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ composer.phar
*.php~
.env
.maintenance
*.neon

###> symfony/phpunit-bridge ###
.phpunit
Expand Down
6 changes: 6 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
level: 0
ignoreErrors:
-
message: "#^Function twig_localized_date_filter not found\\.$#"
path: src/Eccube/Twig/Extension/IntlExtension.php
2 changes: 1 addition & 1 deletion src/Eccube/EventListener/TransactionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Eccube\EventListener;

use Doctrine\Dbal\Connection;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\TransactionIsolationLevel;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
Expand Down