-
Notifications
You must be signed in to change notification settings - Fork 14
/
phpstan.neon
77 lines (69 loc) · 2.63 KB
/
phpstan.neon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
##
# Configuration file for PHPStan static code checking, see https://phpstan.org .
#
# Note that drupal-specific rules are automatically included by phpstan/extension-installer
# from vendor/mglaman/phpstan-drupal/extension.neon and vendor/mglaman/phpstan-drupal/rules.neon
# @see https://github.com/mglaman/phpstan-drupal
#
# Paths are passed as CLI arguments.
#
# CivicTheme base theme (web/themes/contrib/civictheme) scanning is not included
# in this file. See web/themes/contrib/civictheme/phpstan.neon for the basetheme.
parameters:
level: 7
paths:
- web/modules/custom
- web/themes/custom
- web/sites/default/settings.php
- web/sites/default/includes
- tests
# Include the base theme files in the scan to make the functions available
# for discovery when used in non-theme code (modules, tests).
scanDirectories:
- web/themes/contrib/civictheme
excludePaths:
analyse:
- web/themes/contrib/civictheme
analyseAndScan:
- vendor/*
- node_modules/*
- ../*/vendor/*
- ../*/node_modules/*
drupal:
drupal_root: web
# Do not report on ignored errors that do not occur in the results. This is
# required to allow code generated by a sub-theme to be ignored.
reportUnmatchedIgnoredErrors: false
ignoreErrors:
-
# Since tests and data providers do not have to have parameter docblocks,
# it is not possible to specify the type of the parameter, so we ignore
# this error.
message: '#.*no value type specified in iterable type array.#'
paths:
- tests/phpunit/*
-
# Hook implementations do not provide docblocks for parameters, so there
# is no way to provide this information.
message: '#.* with no value type specified in iterable type array#'
paths:
- web/modules/custom/*
- web/themes/custom/*
-
# Included settings files are not aware about global variables.
message: '#Variable .* might not be defined.#'
paths:
- web/sites/default/includes
-
# Allow using Drupal::service() in tests and Drush commands.
message: '#\Drupal calls should be avoided in classes, use dependency injection instead#'
paths:
- tests/behat
-
# Allow using direct callable calls for generated content.
message: '#Parameter \#1 \$callback of function call_user_func expects callable.*#'
paths:
- web/modules/custom/cs_generated_content/src/CsGeneratedContentCivicthemeTrait.php
- # Skip deprecation until upgrade to 10.3.
# @see https://www.drupal.org/node/3426517
message: '#Fetching deprecated class constant EXISTS_REPLACE#'