Skip to content

Commit 925b5e2

Browse files
committed
Add D9 deprecations configuration.
1 parent 1544c7a commit 925b5e2

File tree

4 files changed

+66
-3
lines changed

4 files changed

+66
-3
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,38 @@ For an extension:
3434
}
3535
```
3636

37+
For an extension (to check only for D9 deprecations):
38+
39+
```json
40+
"grumphp": {
41+
"config-default-path": "vendor/digipolisgent/qa-drupal/configs/grumphp-extension-d9.yml"
42+
}
43+
```
44+
3745
Now install this package and its requirements by executing execute following command:
3846
<pre><code>composer require --dev digipolisgent/qa-drupal:^1.0</code></pre>
47+
48+
49+
# Configuration
50+
51+
**This section only applies to the site and extension configuration of GrumPHP.**
52+
53+
You can optionally extend or override the task configuration files by creating
54+
them in your project root. For example: create a `phpcs.xml` or `phpcs.local.xml`
55+
file to override the configuration provided by this package.
56+
57+
Note that Yaml and Neon files will be merged with your local files. So if you create
58+
a `phpstan.neon` file it will be merged with the `phpstan.neon` file of this package.
59+
60+
To prevent this, create a `.env` or `.env.local` file and add following contents:
61+
```
62+
PHPSTAN_SKIP_PACKAGE_GLOBAL=1
63+
```
64+
65+
The skip variable name is always the same `[FILENAME]_SKIP_[TYPE]`, wherin `[FILENAME]`
66+
if the file name and `[TYPE]` is either:
67+
68+
- `LOCAL` to skip `phpstan.local.neon`.
69+
- `PROJECT` to skip `phpstan.neon`.
70+
- `PACKAGE_TYPE` to skip `phpstan-extension.neon` (if in an extension) of this package.
71+
- `PACKAGE_GLOBAL` to skip `phpstan.neon` of this package.

configs/grumphp-extension-d9.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
parameters:
2+
hooks_dir: ~
3+
hooks_preset: local
4+
stop_on_failure: true
5+
hide_circumvention_tip: true
6+
ascii: ~
7+
tasks:
8+
phpstan:
9+
configuration: vendor/digipolisgent/qa-drupal/configs/phpstan-extension-d9.neon
10+
triggered_by:
11+
- php
12+
- inc
13+
- install
14+
- module
15+
- theme
16+
- profile

configs/phpstan-extension-d9.neon

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
includes:
2+
- vendor/mglaman/phpstan-drupal/extension.neon
3+
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
4+
5+
parameters:
6+
tipsOfTheDay: false
7+
customRulesetUsed: true
8+
reportUnmatchedIgnoredErrors: false
9+
ignoreErrors:
10+
- '#^(?:(?!deprecated).)*$#'
11+
excludes_analyse:
12+
- 'tests/*'
13+
drupal:
14+
drupal_root: ../drupal

configs/phpstan.neon

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ parameters:
66
tipsOfTheDay: false
77
reportUnmatchedIgnoredErrors: false
88
ignoreErrors:
9-
- "#Unsafe usage of new static\\(\\)#"
10-
- "#\\Drupal calls should be avoided in classes#"
9+
- '#Unsafe usage of new static\(\)#'
10+
- '#\Drupal calls should be avoided in classes#'
1111
excludes_analyse:
12-
- "*/node_modules/*"
12+
- '*/node_modules/*'

0 commit comments

Comments
 (0)