Skip to content

Commit

Permalink
Various PHPStan resolutions (#74)
Browse files Browse the repository at this point in the history
* Ignore include of WP file. Fixes #50

* secure-custom-fields.php. Fixes #69

* See #65
  • Loading branch information
kraftbj authored Mar 10, 2025
1 parent c7743d6 commit ad42df9
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 118 deletions.
1 change: 1 addition & 0 deletions acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
}

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

// Network activations first since is_plugin_active will return true for network activated plugins, whereas this won't for single.
Expand Down
48 changes: 0 additions & 48 deletions bin/baseline.neon
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
parameters:
ignoreErrors:
-
message: '#^Path in include_once\(\) "\./wp\-admin/includes/plugin\.php" is not a file or it does not exist\.$#'
identifier: includeOnce.fileNotFound
count: 1
path: ../acf.php

-
message: '#^Action callback returns array but should not return anything\.$#'
identifier: return.void
Expand Down Expand Up @@ -324,24 +318,6 @@ parameters:
count: 1
path: ../includes/api/api-term.php

-
message: '#^Access to an undefined property ACF_Data\:\:\$site_aliases\.$#'
identifier: property.notFound
count: 2
path: ../includes/class-acf-data.php

-
message: '#^Access to an undefined property ACF_Data\:\:\$site_data\.$#'
identifier: property.notFound
count: 1
path: ../includes/class-acf-data.php

-
message: '#^Action callback returns array but should not return anything\.$#'
identifier: return.void
count: 1
path: ../includes/class-acf-internal-post-type.php

-
message: '#^Action callback returns string but should not return anything\.$#'
identifier: return.void
Expand Down Expand Up @@ -534,12 +510,6 @@ parameters:
count: 1
path: ../includes/local-meta.php

-
message: '#^Expected 2 @param tags, found 1\.$#'
identifier: paramTag.count
count: 2
path: ../includes/locations.php

-
message: '#^Access to an undefined property \$this\(ACF_Legacy_Location\)\:\:\$name\.$#'
identifier: property.notFound
Expand Down Expand Up @@ -581,21 +551,3 @@ parameters:
identifier: property.notFound
count: 3
path: ../includes/validation.php

-
message: '#^Access to an undefined property ACF_WPML_Compatibility\:\:\$trid_ref\.$#'
identifier: property.notFound
count: 1
path: ../includes/wpml.php

-
message: '#^One or more @param tags has an invalid name or invalid syntax\.$#'
identifier: phpDoc.parseError
count: 7
path: ../secure-custom-fields.php

-
message: '#^Path in require_once\(\) "\./wp\-admin/includes/plugin\.php" is not a file or it does not exist\.$#'
identifier: requireOnce.fileNotFound
count: 1
path: ../secure-custom-fields.php
Loading

0 comments on commit ad42df9

Please sign in to comment.