Skip to content

Commit

Permalink
Phpstan-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-worman committed Feb 12, 2025
1 parent 7660882 commit 6e48daf
Show file tree
Hide file tree
Showing 31 changed files with 3,249 additions and 321 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/phpstan-baseline.neon export-ignore
/phpstan.neon export-ignore
/phpunit.xml.dist export-ignore
/tools export-ignore
11 changes: 7 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ jobs:
matrix:
php-version:
- "7.2"
- "latest"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"

steps:
- name: "Checkout"
Expand All @@ -23,9 +29,6 @@ jobs:
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "intl"
ini-values: "memory_limit=-1, error_reporting=E_ALL, display_errors=On"
php-version: "${{ matrix.php-version }}"

- name: "Lint PHP files"
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
- push
- pull_request

env:
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"

jobs:
tests:
name: "PHPStan"
Expand All @@ -20,14 +17,10 @@ jobs:
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "intl, zip"
ini-values: "memory_limit=-1"
php-version: "7.2"
php-version: "latest"

- name: "Update dependencies"
run: "composer update ${{ env.COMPOSER_FLAGS }}"
- name: "Composer Install"
run: composer install && composer --working-dir=tools install

- name: Run PHPStan
run: |
composer phpstan
run: composer phpstan
17 changes: 6 additions & 11 deletions .github/workflows/style-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
- push
- pull_request

env:
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"

jobs:
tests:
name: "Style Check"
Expand All @@ -20,14 +17,12 @@ jobs:
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "intl, zip"
ini-values: "memory_limit=-1, phar.readonly=0, error_reporting=E_ALL, display_errors=On"
php-version: "7.4"
tools: composer
php-version: "latest"

- name: "Update dependencies"
run: "composer update ${{ env.COMPOSER_FLAGS }}"
- name: "Composer Install"
run: composer --working-dir=tools install

- name: "Run style-check"
run: "composer style-check"
run: composer style-check
env:
PHP_CS_FIXER_IGNORE_ENV: 1
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/vendor
/tools/vendor
/bin
!/bin/validate-json
coverage
.buildpath
.project
.settings
.php_cs
.php_cs.cache
/.php-cs-fixer.cache
composer.lock
docs-api
phpunit.xml
Expand Down
1 change: 0 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
$config = new PhpCsFixer\Config('json-schema');
$finder->in(__DIR__);

/* Based on ^2.1 of php-cs-fixer */
$config
->setRules([
// default
Expand Down
13 changes: 5 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@
"icecave/parity": "^3.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2.2.20 || ~2.19.0",
"json-schema/json-schema-test-suite": "1.2.0",
"phpunit/phpunit": "^8.5",
"phpspec/prophecy": "^1.19",
"phpstan/phpstan": "^1.12",
"marc-mabe/php-enum-phpstan": "^2.0"
"phpspec/prophecy": "^1.19"
},
"extra": {
"branch-alias": {
Expand Down Expand Up @@ -74,11 +71,11 @@
],
"scripts": {
"coverage": "phpunit --coverage-text",
"style-check": "php-cs-fixer fix --dry-run --verbose --diff",
"style-fix": "php-cs-fixer fix --verbose",
"style-check": "tools/vendor/bin/php-cs-fixer fix --dry-run --verbose --diff",
"style-fix": "tools/vendor/bin/php-cs-fixer fix --verbose",
"test": "phpunit",
"testOnly": "phpunit --colors --filter",
"phpstan": "@php phpstan",
"phpstan-generate-baseline": "@php phpstan --generate-baseline"
"phpstan": "tools/vendor/bin/phpstan",
"phpstan-generate-baseline": "tools/vendor/bin/phpstan --generate-baseline"
}
}
Loading

0 comments on commit 6e48daf

Please sign in to comment.