Skip to content

Commit

Permalink
chore: fix non-code phpstan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
justlevine committed Sep 11, 2024
1 parent 61f7908 commit 58b6792
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/late-poems-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wpengine/wp-graphql-content-blocks": patch
---

chore: remediate non-code PHPStan errors in phpstan-baseline.neon
4 changes: 2 additions & 2 deletions includes/updates/update-callbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<br><br>' . __( '<b>THIS UPDATE MAY CONTAIN BREAKING CHANGES:</b> This plugin uses Semantic Versioning, and this new version is a major release. Please review the changelog before updating.', 'wp-graphql-content-blocks' );
}
}
15 changes: 0 additions & 15 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 2 additions & 0 deletions phpstan/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

0 comments on commit 58b6792

Please sign in to comment.