From ae50ccd25db099d18a93c96b20ecfc82e86a5c58 Mon Sep 17 00:00:00 2001 From: Erik van der Bas Date: Sat, 20 Jan 2024 13:47:16 +0100 Subject: [PATCH 1/4] fix(tests): fix missing constants in static analysis test --- phpstan.neon | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan.neon b/phpstan.neon index 43b6413de..1e0de20e2 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -4,6 +4,7 @@ parameters: paths: - src/ scanFiles: + - tests/phpstan/bootstrap.php - vendor/php-stubs/wp-cli-stubs/wp-cli-stubs.php - vendor/php-stubs/acf-pro-stubs/acf-pro-stubs.php excludePaths: From 9e8409e69985925e256d7d48bb855dd95708f84f Mon Sep 17 00:00:00 2001 From: Erik van der Bas Date: Sat, 20 Jan 2024 14:07:48 +0100 Subject: [PATCH 2/4] fix: undefined property --- src/MenuItem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MenuItem.php b/src/MenuItem.php index 303346481..e48bfac67 100644 --- a/src/MenuItem.php +++ b/src/MenuItem.php @@ -140,7 +140,7 @@ protected function __construct(WP_Post $data, $menu = null) /** * @property string $title The nav menu item title. */ - $this->title = $data->title; + $this->title = $data->post_title; $this->import($data); $this->import_classes($data); From 441ef9e82478cb250373938972bc09c0c1acf154 Mon Sep 17 00:00:00 2001 From: Erik van der Bas Date: Sat, 20 Jan 2024 14:09:12 +0100 Subject: [PATCH 3/4] fix: ignore acf_get_field_type void errors --- phpstan.neon | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan.neon b/phpstan.neon index 1e0de20e2..bbec546f6 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -11,6 +11,7 @@ parameters: - tests/* - docs/* ignoreErrors: + - '#Result of function acf_get_field_type \(void\) is used.#' - '#Instantiated class Twig\\CacheExtension\\CacheStrategy\\GenerationalCacheStrategy not found.#' - '#Instantiated class Twig\\CacheExtension\\Extension not found.#' - '#Method Timber\\Loader::_get_cache_extension\(\) has invalid return type Twig\\CacheExtension\\Extension.#' From a7b019b75d5358c35b4237c39817d5a830e8dce2 Mon Sep 17 00:00:00 2001 From: Erik van der Bas Date: Sat, 20 Jan 2024 14:29:58 +0100 Subject: [PATCH 4/4] revert: revert changing property name --- src/MenuItem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MenuItem.php b/src/MenuItem.php index e48bfac67..303346481 100644 --- a/src/MenuItem.php +++ b/src/MenuItem.php @@ -140,7 +140,7 @@ protected function __construct(WP_Post $data, $menu = null) /** * @property string $title The nav menu item title. */ - $this->title = $data->post_title; + $this->title = $data->title; $this->import($data); $this->import_classes($data);