Skip to content

Commit 4e9f57d

Browse files
committed
Phpstan-fixes
1 parent 7660882 commit 4e9f57d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+5758
-438
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
/phpstan-baseline.neon export-ignore
99
/phpstan.neon export-ignore
1010
/phpunit.xml.dist export-ignore
11+
/tools export-ignore

.github/workflows/lint.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ jobs:
1414
matrix:
1515
php-version:
1616
- "7.2"
17-
- "latest"
17+
- "7.3"
18+
- "7.4"
19+
- "8.0"
20+
- "8.1"
21+
- "8.2"
22+
- "8.3"
23+
- "8.4"
1824

1925
steps:
2026
- name: "Checkout"
@@ -23,9 +29,6 @@ jobs:
2329
- name: "Install PHP"
2430
uses: "shivammathur/setup-php@v2"
2531
with:
26-
coverage: "none"
27-
extensions: "intl"
28-
ini-values: "memory_limit=-1, error_reporting=E_ALL, display_errors=On"
2932
php-version: "${{ matrix.php-version }}"
3033

3134
- name: "Lint PHP files"

.github/workflows/phpstan.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
- push
55
- pull_request
66

7-
env:
8-
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
9-
107
jobs:
118
tests:
129
name: "PHPStan"
@@ -20,14 +17,10 @@ jobs:
2017
- name: "Install PHP"
2118
uses: "shivammathur/setup-php@v2"
2219
with:
23-
coverage: "none"
24-
extensions: "intl, zip"
25-
ini-values: "memory_limit=-1"
26-
php-version: "7.2"
20+
php-version: "latest"
2721

28-
- name: "Update dependencies"
29-
run: "composer update ${{ env.COMPOSER_FLAGS }}"
22+
- name: "Composer Install"
23+
run: composer install && composer --working-dir=tools install
3024

3125
- name: Run PHPStan
32-
run: |
33-
composer phpstan
26+
run: composer phpstan

.github/workflows/style-check.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
- push
55
- pull_request
66

7-
env:
8-
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
9-
107
jobs:
118
tests:
129
name: "Style Check"
@@ -20,14 +17,12 @@ jobs:
2017
- name: "Install PHP"
2118
uses: "shivammathur/setup-php@v2"
2219
with:
23-
coverage: "none"
24-
extensions: "intl, zip"
25-
ini-values: "memory_limit=-1, phar.readonly=0, error_reporting=E_ALL, display_errors=On"
26-
php-version: "7.4"
27-
tools: composer
20+
php-version: "latest"
2821

29-
- name: "Update dependencies"
30-
run: "composer update ${{ env.COMPOSER_FLAGS }}"
22+
- name: "Composer Install"
23+
run: composer --working-dir=tools install
3124

3225
- name: "Run style-check"
33-
run: "composer style-check"
26+
run: composer style-check
27+
env:
28+
PHP_CS_FIXER_IGNORE_ENV: 1

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/vendor
2+
/tools/vendor
23
/bin
34
!/bin/validate-json
45
coverage
56
.buildpath
67
.project
78
.settings
8-
.php_cs
9-
.php_cs.cache
9+
/.php-cs-fixer.cache
1010
composer.lock
1111
docs-api
1212
phpunit.xml

.php-cs-fixer.dist.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
$config = new PhpCsFixer\Config('json-schema');
55
$finder->in(__DIR__);
66

7-
/* Based on ^2.1 of php-cs-fixer */
87
$config
98
->setRules([
109
// default

composer.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,9 @@
3333
"icecave/parity": "^3.0"
3434
},
3535
"require-dev": {
36-
"friendsofphp/php-cs-fixer": "~2.2.20 || ~2.19.0",
3736
"json-schema/json-schema-test-suite": "1.2.0",
3837
"phpunit/phpunit": "^8.5",
39-
"phpspec/prophecy": "^1.19",
40-
"phpstan/phpstan": "^1.12",
41-
"marc-mabe/php-enum-phpstan": "^2.0"
38+
"phpspec/prophecy": "^1.19"
4239
},
4340
"extra": {
4441
"branch-alias": {
@@ -74,11 +71,11 @@
7471
],
7572
"scripts": {
7673
"coverage": "phpunit --coverage-text",
77-
"style-check": "php-cs-fixer fix --dry-run --verbose --diff",
78-
"style-fix": "php-cs-fixer fix --verbose",
74+
"style-check": "tools/vendor/bin/php-cs-fixer fix --dry-run --verbose --diff",
75+
"style-fix": "tools/vendor/bin/php-cs-fixer fix --verbose",
7976
"test": "phpunit",
8077
"testOnly": "phpunit --colors --filter",
81-
"phpstan": "@php phpstan",
82-
"phpstan-generate-baseline": "@php phpstan --generate-baseline"
78+
"phpstan": "tools/vendor/bin/phpstan",
79+
"phpstan-generate-baseline": "tools/vendor/bin/phpstan --generate-baseline"
8380
}
8481
}

0 commit comments

Comments
 (0)