Skip to content

Commit 9125d57

Browse files
chore: use tabs for .neon and update annotation tenses
Co-authored-by: Aaron Jorbin <[email protected]>
1 parent 8a152d3 commit 9125d57

File tree

3 files changed

+144
-144
lines changed

3 files changed

+144
-144
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ insert_final_newline = true
1313
trim_trailing_whitespace = true
1414
indent_style = tab
1515

16-
[{*.yml,*.neon,*.neon.dist}]
16+
[{*.yml}]
1717
indent_style = space
1818
indent_size = 2
1919

phpstan.neon.dist

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,39 @@
55
# https://phpstan.org/config-reference
66

77
includes:
8-
# The WordPress Core configuration file includes the base configuration for the WordPress codebase.
9-
- tests/phpstan/base.neon
10-
# The baseline file includes preexisting errors in the codebase that should be ignored.
11-
# https://phpstan.org/user-guide/baseline
12-
- tests/phpstan/baseline/level-0.php
13-
- tests/phpstan/baseline/level-1.php
14-
- tests/phpstan/baseline/level-2.php
15-
- tests/phpstan/baseline/level-3.php
16-
- tests/phpstan/baseline/level-4.php
17-
- tests/phpstan/baseline/level-5.php
18-
- tests/phpstan/baseline/level-6.php
8+
# The WordPress Core configuration file includes the base configuration for the WordPress codebase.
9+
- tests/phpstan/base.neon
10+
# The baseline file includes preexisting errors in the codebase that should be ignored.
11+
# https://phpstan.org/user-guide/baseline
12+
- tests/phpstan/baseline/level-0.php
13+
- tests/phpstan/baseline/level-1.php
14+
- tests/phpstan/baseline/level-2.php
15+
- tests/phpstan/baseline/level-3.php
16+
- tests/phpstan/baseline/level-4.php
17+
- tests/phpstan/baseline/level-5.php
18+
- tests/phpstan/baseline/level-6.php
1919

2020
parameters:
21-
level: 6
22-
reportUnmatchedIgnoredErrors: true
21+
level: 6
22+
reportUnmatchedIgnoredErrors: true
2323

24-
ignoreErrors:
25-
# Inner functions aren't supported:
26-
- '#Inner named functions are not supported by PHPStan#'
27-
# Inner functions within the importer:
28-
- '#Function wxr_[a-z_]+ not found#'
24+
ignoreErrors:
25+
# Inner functions aren't supported:
26+
- '#Inner named functions are not supported by PHPStan#'
27+
# Inner functions within the importer:
28+
- '#Function wxr_[a-z_]+ not found#'
2929

30-
# Level 1:
30+
# Level 1:
3131

32-
# These are too noisy at the moment:
33-
- '#Variable \$[a-zA-Z0-9_]+ might not be defined\.#'
32+
# These are too noisy at the moment.
33+
- '#Variable \$[a-zA-Z0-9_]+ might not be defined\.#'
3434

35-
# Level 2:
36-
# We use callable-strings as callables in WordPress.
37-
- '#Default value of the parameter .* is incompatible with type callable.*#'
35+
# Level 2:
36+
# Callable-strings are used as callables in WordPress.
37+
- '#Default value of the parameter .* is incompatible with type callable.*#'
3838

39-
# Level 6:
40-
- # WPCS syntax for iterable types is not supported:
41-
identifier: missingType.iterableValue
42-
- # Too noisy until we allow `void` return types:
43-
identifier: missingType.return
39+
# Level 6:
40+
- # WPCS syntax for iterable types is not supported.
41+
identifier: missingType.iterableValue
42+
- # Too noisy until `void` return types are allowed.
43+
identifier: missingType.return

tests/phpstan/base.neon

Lines changed: 114 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -5,122 +5,122 @@
55
# https://phpstan.org/config-reference
66

77
parameters:
8-
# Cache is stored locally, so it's available for CI.
9-
tmpDir: ../../.cache
8+
# Cache is stored locally, so it's available for CI.
9+
tmpDir: ../../.cache
1010

11-
# The Minimum PHP Version
12-
phpVersion:
13-
min: 70224
14-
max: 80400
11+
# The Minimum PHP Version
12+
phpVersion:
13+
min: 70224
14+
max: 80400
1515

16-
# If it's not enforced by PHP we can't assume users are passing valid values.
17-
treatPhpDocTypesAsCertain: false
16+
# If it's not enforced by PHP we can't assume users are passing valid values.
17+
treatPhpDocTypesAsCertain: false
1818

19-
# These config options are explained in https://phpstan.org/config-reference
20-
checkFunctionNameCase: true
21-
inferPrivatePropertyTypeFromConstructor: true
19+
# These config options are explained in https://phpstan.org/config-reference
20+
checkFunctionNameCase: true
21+
inferPrivatePropertyTypeFromConstructor: true
2222

23-
# Constants that are expected to be defined by users.
24-
dynamicConstantNames:
25-
- ALLOW_SUBDIRECTORY_INSTALL
26-
- AUTH_SALT
27-
- AUTOMATIC_UPDATER_DISABLED
28-
- COOKIEPATH
29-
- CUSTOM_TAGS
30-
- DISALLOW_FILE_EDIT
31-
- DISALLOW_UNFILTERED_HTML
32-
- EMPTY_TRASH_DAYS
33-
- ENFORCE_GZIP
34-
- FORCE_SSL_LOGIN
35-
- MEDIA_TRASH
36-
- MULTISITE
37-
- NOBLOGREDIRECT
38-
- SAVEQUERIES
39-
- SCRIPT_DEBUG
40-
- SECRET_KEY
41-
- SECRET_SALT
42-
- SHORTINIT
43-
- SITECOOKIEPATH
44-
- UPLOADBLOGSDIR
45-
- WP_ALLOW_MULTISITE
46-
- WP_CACHE
47-
- WP_DEBUG
48-
- WP_DEBUG_DISPLAY
49-
- WP_DEBUG_LOG
50-
- WP_LANG_DIR
51-
- WP_NETWORK_ADMIN
52-
- WP_POST_REVISIONS
53-
- WP_SITEURL
54-
- WP_USE_THEMES
55-
- WP_USER_ADMIN
56-
- WPLANG
57-
- WPMU_ACCEL_REDIRECT
58-
- WPMU_PLUGIN_DIR
59-
- WPMU_SENDFILE
23+
# Constants that are expected to be defined by users.
24+
dynamicConstantNames:
25+
- ALLOW_SUBDIRECTORY_INSTALL
26+
- AUTH_SALT
27+
- AUTOMATIC_UPDATER_DISABLED
28+
- COOKIEPATH
29+
- CUSTOM_TAGS
30+
- DISALLOW_FILE_EDIT
31+
- DISALLOW_UNFILTERED_HTML
32+
- EMPTY_TRASH_DAYS
33+
- ENFORCE_GZIP
34+
- FORCE_SSL_LOGIN
35+
- MEDIA_TRASH
36+
- MULTISITE
37+
- NOBLOGREDIRECT
38+
- SAVEQUERIES
39+
- SCRIPT_DEBUG
40+
- SECRET_KEY
41+
- SECRET_SALT
42+
- SHORTINIT
43+
- SITECOOKIEPATH
44+
- UPLOADBLOGSDIR
45+
- WP_ALLOW_MULTISITE
46+
- WP_CACHE
47+
- WP_DEBUG
48+
- WP_DEBUG_DISPLAY
49+
- WP_DEBUG_LOG
50+
- WP_LANG_DIR
51+
- WP_NETWORK_ADMIN
52+
- WP_POST_REVISIONS
53+
- WP_SITEURL
54+
- WP_USE_THEMES
55+
- WP_USER_ADMIN
56+
- WPLANG
57+
- WPMU_ACCEL_REDIRECT
58+
- WPMU_PLUGIN_DIR
59+
- WPMU_SENDFILE
6060

61-
# What directories and files should be scanned.
62-
paths:
63-
- ../../src
64-
bootstrapFiles:
65-
- bootstrap.php
66-
scanFiles:
67-
- ../../wp-config-sample.php
68-
- ../../src/wp-admin/includes/ms.php
69-
scanDirectories:
70-
- ../../src/wp-includes
71-
- ../../src/wp-admin
72-
excludePaths:
73-
analyseAndScan:
74-
# These files are deprecated and should not be scanned.
75-
- ../../src/wp-admin/includes/deprecated.php
76-
- ../../src/wp-admin/includes/ms-deprecated.php
77-
- ../../src/wp-admin/includes/noop.php
78-
- ../../src/wp-includes/deprecated.php
79-
- ../../src/wp-includes/ms-deprecated.php
80-
- ../../src/wp-includes/pluggable-deprecated.php
81-
# These files are not part of the WordPress Core codebase.
82-
- ../../src/wp-content
83-
# JavaScript/CSS/Asset files.
84-
- ../../src/js
85-
- ../../src/wp-admin/css
86-
- ../../src/wp-admin/images
87-
# These are built from js/_enqueues.
88-
- ../../src/wp-admin/js (?)
89-
- ../../src/wp-includes/js (?)
90-
analyse:
91-
# These files are sourced by wordpress/gutenberg in `tools/release/sync-stable-blocks.js`.
92-
- ../../src/wp-includes/blocks
93-
# Third-party libraries.
94-
- ../../src/js/_enqueues/vendor
95-
- ../../src/wp-admin/includes/class-ftp-pure.php
96-
- ../../src/wp-admin/includes/class-ftp-sockets.php
97-
- ../../src/wp-admin/includes/class-ftp.php
98-
- ../../src/wp-admin/includes/class-pclzip.php
99-
- ../../src/wp-includes/atomlib.php
100-
- ../../src/wp-includes/class-avif-info.php
101-
- ../../src/wp-includes/class-IXR.php
102-
- ../../src/wp-includes/class-json.php
103-
- ../../src/wp-includes/class-phpass.php
104-
- ../../src/wp-includes/class-pop3.php
105-
- ../../src/wp-includes/class-requests.php
106-
- ../../src/wp-includes/class-simplepie.php
107-
- ../../src/wp-includes/class-snoopy.php
108-
- ../../src/wp-includes/class-wp-feed-cache.php
109-
- ../../src/wp-includes/class-wp-http-ixr-client.php
110-
- ../../src/wp-includes/class-wp-http-requests-hooks.php
111-
- ../../src/wp-includes/class-wp-http-requests-response.php
112-
- ../../src/wp-includes/class-wp-simplepie-file.php
113-
- ../../src/wp-includes/class-wp-simplepie-sanitize-kses.php
114-
- ../../src/wp-includes/class-wp-text-diff-renderer-inline.php
115-
- ../../src/wp-includes/class-wp-text-diff-renderer-table.php
116-
- ../../src/wp-includes/rss.php
117-
- ../../src/wp-includes/ID3
118-
- ../../src/wp-includes/IXR
119-
- ../../src/wp-includes/PHPMailer
120-
- ../../src/wp-includes/pomo
121-
- ../../src/wp-includes/Requests
122-
- ../../src/wp-includes/SimplePie
123-
- ../../src/wp-includes/sodium_compat
124-
- ../../src/wp-includes/Text
125-
# Contains errors that cannot be ignored by PHPStan.
126-
- ../../src/wp-includes/html-api/class-wp-html-processor.php
61+
# What directories and files should be scanned.
62+
paths:
63+
- ../../src
64+
bootstrapFiles:
65+
- bootstrap.php
66+
scanFiles:
67+
- ../../wp-config-sample.php
68+
- ../../src/wp-admin/includes/ms.php
69+
scanDirectories:
70+
- ../../src/wp-includes
71+
- ../../src/wp-admin
72+
excludePaths:
73+
analyseAndScan:
74+
# These files are deprecated and should not be scanned.
75+
- ../../src/wp-admin/includes/deprecated.php
76+
- ../../src/wp-admin/includes/ms-deprecated.php
77+
- ../../src/wp-admin/includes/noop.php
78+
- ../../src/wp-includes/deprecated.php
79+
- ../../src/wp-includes/ms-deprecated.php
80+
- ../../src/wp-includes/pluggable-deprecated.php
81+
# These files are not part of the WordPress Core codebase.
82+
- ../../src/wp-content
83+
# JavaScript/CSS/Asset files.
84+
- ../../src/js
85+
- ../../src/wp-admin/css
86+
- ../../src/wp-admin/images
87+
# These are built from js/_enqueues.
88+
- ../../src/wp-admin/js (?)
89+
- ../../src/wp-includes/js (?)
90+
analyse:
91+
# These files are sourced by wordpress/gutenberg in `tools/release/sync-stable-blocks.js`.
92+
- ../../src/wp-includes/blocks
93+
# Third-party libraries.
94+
- ../../src/js/_enqueues/vendor
95+
- ../../src/wp-admin/includes/class-ftp-pure.php
96+
- ../../src/wp-admin/includes/class-ftp-sockets.php
97+
- ../../src/wp-admin/includes/class-ftp.php
98+
- ../../src/wp-admin/includes/class-pclzip.php
99+
- ../../src/wp-includes/atomlib.php
100+
- ../../src/wp-includes/class-avif-info.php
101+
- ../../src/wp-includes/class-IXR.php
102+
- ../../src/wp-includes/class-json.php
103+
- ../../src/wp-includes/class-phpass.php
104+
- ../../src/wp-includes/class-pop3.php
105+
- ../../src/wp-includes/class-requests.php
106+
- ../../src/wp-includes/class-simplepie.php
107+
- ../../src/wp-includes/class-snoopy.php
108+
- ../../src/wp-includes/class-wp-feed-cache.php
109+
- ../../src/wp-includes/class-wp-http-ixr-client.php
110+
- ../../src/wp-includes/class-wp-http-requests-hooks.php
111+
- ../../src/wp-includes/class-wp-http-requests-response.php
112+
- ../../src/wp-includes/class-wp-simplepie-file.php
113+
- ../../src/wp-includes/class-wp-simplepie-sanitize-kses.php
114+
- ../../src/wp-includes/class-wp-text-diff-renderer-inline.php
115+
- ../../src/wp-includes/class-wp-text-diff-renderer-table.php
116+
- ../../src/wp-includes/rss.php
117+
- ../../src/wp-includes/ID3
118+
- ../../src/wp-includes/IXR
119+
- ../../src/wp-includes/PHPMailer
120+
- ../../src/wp-includes/pomo
121+
- ../../src/wp-includes/Requests
122+
- ../../src/wp-includes/SimplePie
123+
- ../../src/wp-includes/sodium_compat
124+
- ../../src/wp-includes/Text
125+
# Contains errors that cannot be ignored by PHPStan.
126+
- ../../src/wp-includes/html-api/class-wp-html-processor.php

0 commit comments

Comments
 (0)