From 179948c1c7cc29adb5681a4495ab6dc58e129cc3 Mon Sep 17 00:00:00 2001 From: David Levine Date: Wed, 11 Sep 2024 17:35:47 +0000 Subject: [PATCH] dev: make `PluginUpdater` namespaced functions PSR-4 compatible. --- .changeset/smooth-years-love.md | 5 +++++ .../UpdateCallbacks.php} | 0 .../UpdateFunctions.php} | 0 includes/WPGraphQLContentBlocks.php | 4 ++-- phpstan-baseline.neon | 8 ++++---- 5 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .changeset/smooth-years-love.md rename includes/{updates/update-callbacks.php => PluginUpdater/UpdateCallbacks.php} (100%) rename includes/{updates/update-functions.php => PluginUpdater/UpdateFunctions.php} (100%) diff --git a/.changeset/smooth-years-love.md b/.changeset/smooth-years-love.md new file mode 100644 index 00000000..1d1b13ac --- /dev/null +++ b/.changeset/smooth-years-love.md @@ -0,0 +1,5 @@ +--- +"@wpengine/wp-graphql-content-blocks": minor +--- + +dev: make `PluginUpdater` namespaced functions PSR-4 compatible. diff --git a/includes/updates/update-callbacks.php b/includes/PluginUpdater/UpdateCallbacks.php similarity index 100% rename from includes/updates/update-callbacks.php rename to includes/PluginUpdater/UpdateCallbacks.php diff --git a/includes/updates/update-functions.php b/includes/PluginUpdater/UpdateFunctions.php similarity index 100% rename from includes/updates/update-functions.php rename to includes/PluginUpdater/UpdateFunctions.php diff --git a/includes/WPGraphQLContentBlocks.php b/includes/WPGraphQLContentBlocks.php index 6434e2fb..25bf5873 100644 --- a/includes/WPGraphQLContentBlocks.php +++ b/includes/WPGraphQLContentBlocks.php @@ -147,8 +147,8 @@ static function () { }//end if }//end if - require_once WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_DIR . 'includes/updates/update-functions.php'; - require_once WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_DIR . 'includes/updates/update-callbacks.php'; + require_once WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_DIR . 'includes/PluginUpdater/UpdateFunctions.php'; + require_once WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_DIR . 'includes/PluginUpdater/UpdateCallbacks.php'; // phpcs:ignore SlevomatCodingStandard.Variables.UnusedVariable.UnusedVariable -- Library bootstraps itself, hence variable is unused. $semver = new \EnforceSemVer\EnforceSemVer( WPGRAPHQL_CONTENT_BLOCKS_PATH ); diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f9d81e69..62cc5e54 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -8,19 +8,19 @@ parameters: - message: "#^Access to an undefined property object\\:\\:\\$response\\.$#" count: 1 - path: includes/updates/update-callbacks.php + path: includes/PluginUpdater/UpdateCallbacks.php - message: "#^Function WPGraphQL\\\\ContentBlocks\\\\PluginUpdater\\\\custom_plugin_api_request\\(\\) has invalid return type WPGraphQL\\\\ContentBlocks\\\\PluginUpdater\\\\stdClass\\.$#" count: 1 - path: includes/updates/update-callbacks.php + path: includes/PluginUpdater/UpdateCallbacks.php - message: "#^Function WPGraphQL\\\\ContentBlocks\\\\PluginUpdater\\\\custom_plugin_api_request\\(\\) should return WPGraphQL\\\\ContentBlocks\\\\PluginUpdater\\\\stdClass\\|false but returns array\\|object\\|false\\.$#" count: 2 - path: includes/updates/update-callbacks.php + path: includes/PluginUpdater/UpdateCallbacks.php - message: "#^Function WPGraphQL\\\\ContentBlocks\\\\PluginUpdater\\\\custom_plugin_api_request\\(\\) should return WPGraphQL\\\\ContentBlocks\\\\PluginUpdater\\\\stdClass\\|false but returns object\\.$#" count: 1 - path: includes/updates/update-callbacks.php + path: includes/PluginUpdater/UpdateCallbacks.php