diff --git a/.changeset/late-poems-study.md b/.changeset/late-poems-study.md new file mode 100644 index 00000000..6ac78173 --- /dev/null +++ b/.changeset/late-poems-study.md @@ -0,0 +1,5 @@ +--- +"@wpengine/wp-graphql-content-blocks": patch +--- + +chore: remediate non-code PHPStan errors in phpstan-baseline.neon diff --git a/includes/updates/update-callbacks.php b/includes/updates/update-callbacks.php index 91ffcb93..4a1cf0a8 100644 --- a/includes/updates/update-callbacks.php +++ b/includes/updates/update-callbacks.php @@ -169,11 +169,11 @@ function display_update_page_notice() { * @param string $notice_text The default notice text. * @param string $plugin_filename The plugin directory and filename. * - * @return string|null + * @return string */ function filter_semver_notice_text( $notice_text, $plugin_filename ) { if ( WPGRAPHQL_CONTENT_BLOCKS_PATH !== $plugin_filename ) { return $notice_text; } return '

' . __( 'THIS UPDATE MAY CONTAIN BREAKING CHANGES: This plugin uses Semantic Versioning, and this new version is a major release. Please review the changelog before updating.', 'wp-graphql-content-blocks' ); -} \ No newline at end of file +} diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 23c2223b..aa199cea 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -5,16 +5,6 @@ parameters: count: 1 path: includes/Blocks/Block.php - - - message: "#^Constant WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_DIR not found\\.$#" - count: 4 - path: includes/WPGraphQLContentBlocks.php - - - - message: "#^Parameter \\#1 \\$plugin_filename of class EnforceSemVer\\\\EnforceSemVer constructor expects string, null given\\.$#" - count: 1 - path: includes/WPGraphQLContentBlocks.php - - message: "#^Access to an undefined property object\\:\\:\\$response\\.$#" count: 1 @@ -39,8 +29,3 @@ parameters: 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 - - - - message: "#^Function WPGraphQL\\\\ContentBlocks\\\\PluginUpdater\\\\filter_semver_notice_text\\(\\) never returns null so it can be removed from the return type\\.$#" - count: 1 - path: includes/updates/update-callbacks.php diff --git a/phpstan/constants.php b/phpstan/constants.php index b42b6a91..24df0f25 100644 --- a/phpstan/constants.php +++ b/phpstan/constants.php @@ -7,4 +7,6 @@ define( 'WPGRAPHQL_CONTENT_BLOCKS_VERSION', '0.2.1' ); define( 'WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_FILE', 'wp-graphql-content-blocks.php' ); +define( 'WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_DIR', '' ); define( 'WPGRAPHQL_CONTENT_BLOCKS_MIN_PHP_VERSION', '7.4' ); +define( 'WPGRAPHQL_CONTENT_BLOCKS_PATH', 'wp-graphql-content-blocks.php' );