Skip to content

Commit ad42df9

Browse files
authored
Various PHPStan resolutions (WordPress#74)
* Ignore include of WP file. Fixes WordPress#50 * secure-custom-fields.php. Fixes WordPress#69 * See WordPress#65
1 parent c7743d6 commit ad42df9

7 files changed

+119
-118
lines changed

acf.php

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
}
1414

1515
if ( is_admin() ) {
16+
/** @phpstan-ignore-next-line */ // phpcs:ignore
1617
include_once ABSPATH . 'wp-admin/includes/plugin.php';
1718

1819
// Network activations first since is_plugin_active will return true for network activated plugins, whereas this won't for single.

bin/baseline.neon

-48
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
parameters:
22
ignoreErrors:
3-
-
4-
message: '#^Path in include_once\(\) "\./wp\-admin/includes/plugin\.php" is not a file or it does not exist\.$#'
5-
identifier: includeOnce.fileNotFound
6-
count: 1
7-
path: ../acf.php
8-
93
-
104
message: '#^Action callback returns array but should not return anything\.$#'
115
identifier: return.void
@@ -324,24 +318,6 @@ parameters:
324318
count: 1
325319
path: ../includes/api/api-term.php
326320

327-
-
328-
message: '#^Access to an undefined property ACF_Data\:\:\$site_aliases\.$#'
329-
identifier: property.notFound
330-
count: 2
331-
path: ../includes/class-acf-data.php
332-
333-
-
334-
message: '#^Access to an undefined property ACF_Data\:\:\$site_data\.$#'
335-
identifier: property.notFound
336-
count: 1
337-
path: ../includes/class-acf-data.php
338-
339-
-
340-
message: '#^Action callback returns array but should not return anything\.$#'
341-
identifier: return.void
342-
count: 1
343-
path: ../includes/class-acf-internal-post-type.php
344-
345321
-
346322
message: '#^Action callback returns string but should not return anything\.$#'
347323
identifier: return.void
@@ -534,12 +510,6 @@ parameters:
534510
count: 1
535511
path: ../includes/local-meta.php
536512

537-
-
538-
message: '#^Expected 2 @param tags, found 1\.$#'
539-
identifier: paramTag.count
540-
count: 2
541-
path: ../includes/locations.php
542-
543513
-
544514
message: '#^Access to an undefined property \$this\(ACF_Legacy_Location\)\:\:\$name\.$#'
545515
identifier: property.notFound
@@ -581,21 +551,3 @@ parameters:
581551
identifier: property.notFound
582552
count: 3
583553
path: ../includes/validation.php
584-
585-
-
586-
message: '#^Access to an undefined property ACF_WPML_Compatibility\:\:\$trid_ref\.$#'
587-
identifier: property.notFound
588-
count: 1
589-
path: ../includes/wpml.php
590-
591-
-
592-
message: '#^One or more @param tags has an invalid name or invalid syntax\.$#'
593-
identifier: phpDoc.parseError
594-
count: 7
595-
path: ../secure-custom-fields.php
596-
597-
-
598-
message: '#^Path in require_once\(\) "\./wp\-admin/includes/plugin\.php" is not a file or it does not exist\.$#'
599-
identifier: requireOnce.fileNotFound
600-
count: 1
601-
path: ../secure-custom-fields.php

0 commit comments

Comments
 (0)