From a20d8d5812bda4a4f4652d949806049879fd67ed Mon Sep 17 00:00:00 2001 From: Lynh Date: Thu, 10 Aug 2023 14:55:38 +0700 Subject: [PATCH] Update config --- .github/workflows/cs-fixes.yml | 3 +++ .github/workflows/phpstan.yml | 26 ++++++++++++++++++++++++++ .github/workflows/update-changelog.yml | 3 +++ .php-cs-fixer.php | 5 ++--- phpstan.neon.dist | 5 +---- 5 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/phpstan.yml diff --git a/.github/workflows/cs-fixes.yml b/.github/workflows/cs-fixes.yml index 01d3293..cb861e9 100644 --- a/.github/workflows/cs-fixes.yml +++ b/.github/workflows/cs-fixes.yml @@ -6,6 +6,9 @@ jobs: php-cs-fixer: runs-on: ubuntu-latest + permissions: + contents: write + steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 0000000..980cb79 --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,26 @@ +name: PHPStan + +on: + push: + paths: + - '**.php' + - 'phpstan.neon.dist' + +jobs: + phpstan: + name: phpstan + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + coverage: none + + - name: Install composer dependencies + uses: ramsey/composer-install@v2 + + - name: Run PHPStan + run: ./vendor/bin/phpstan --error-format=github diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 457aa4d..bba3f55 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -8,6 +8,9 @@ jobs: update: runs-on: ubuntu-latest + permissions: + contents: write + steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index eaaf8c3..56220f2 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -40,8 +40,7 @@ 'no_short_bool_cast' => true, 'no_spaces_around_offset' => true, 'no_singleline_whitespace_before_semicolons' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, + 'no_trailing_comma_in_singleline' => true, 'no_unneeded_control_parentheses' => true, 'no_unneeded_curly_braces' => true, 'no_unused_imports' => true, @@ -60,7 +59,7 @@ 'phpdoc_scalar' => true, 'phpdoc_single_line_var_spacing' => true, 'phpdoc_summary' => true, - 'phpdoc_to_comment' => true, + // 'phpdoc_to_comment' => true, 'phpdoc_trim' => true, 'phpdoc_trim_consecutive_blank_line_separation' => true, 'phpdoc_types' => true, diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 89a4523..973cb86 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -7,9 +7,6 @@ parameters: - src # The level 9 is the highest level - level: 6 - - ignoreErrors: - - '#PHPDoc tag @var#' + level: 7 checkMissingIterableValueType: false