diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 951c7cb..fe7dcfb 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -14,5 +14,3 @@ parameters: - gtm-kit.php - src/ - uninstall.php - ignoreErrors: - - '#Path in require_once.*plugin#' diff --git a/src/Common/Util.php b/src/Common/Util.php index 17e0f42..0bace87 100644 --- a/src/Common/Util.php +++ b/src/Common/Util.php @@ -208,6 +208,7 @@ private function add_shared_data( array $data, string $wp_version ): array { public function get_active_plugins(): array { if ( ! function_exists( 'get_plugins' ) ) { + // @phpstan-ignore-next-line require_once ABSPATH . 'wp-admin/includes/plugin.php'; } diff --git a/src/Installation/PluginDataImport.php b/src/Installation/PluginDataImport.php index 5b398c2..b11f12c 100644 --- a/src/Installation/PluginDataImport.php +++ b/src/Installation/PluginDataImport.php @@ -233,7 +233,7 @@ private function get_google_tag_manager(): array { */ private function is_plugin_active( string $plugin ): bool { if ( ! function_exists( 'is_plugin_active' ) ) { - + // @phpstan-ignore-next-line require_once ABSPATH . 'wp-admin/includes/plugin.php'; } diff --git a/src/Installation/Upgrade.php b/src/Installation/Upgrade.php index 3244ce8..184b01b 100644 --- a/src/Installation/Upgrade.php +++ b/src/Installation/Upgrade.php @@ -162,6 +162,7 @@ protected function v122_upgrade(): void { protected function v2_upgrade(): void { if ( ! function_exists( 'get_plugins' ) ) { + // @phpstan-ignore-next-line require_once ABSPATH . 'wp-admin/includes/plugin.php'; } diff --git a/src/Options.php b/src/Options.php index a9ade3f..806709e 100644 --- a/src/Options.php +++ b/src/Options.php @@ -148,6 +148,7 @@ public function pre_update_option( $new_value, $old_value ): ?array { public static function get_defaults(): array { if ( ! function_exists( 'is_plugin_active' ) ) { + // @phpstan-ignore-next-line require_once ABSPATH . 'wp-admin/includes/plugin.php'; }