Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix non-code phpstan errors #272

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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' );
Loading