From eaca1801985d07cda20e7990293d16fb991c6f8e Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Thu, 21 Dec 2023 11:36:46 +0545 Subject: [PATCH] Use str_contains instead of strpos --- includes/Checker/Checks/Plugin_Readme_Check.php | 6 +++--- phpstan.neon.dist | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/Checker/Checks/Plugin_Readme_Check.php b/includes/Checker/Checks/Plugin_Readme_Check.php index 786a61cb1..1a371eab5 100644 --- a/includes/Checker/Checks/Plugin_Readme_Check.php +++ b/includes/Checker/Checks/Plugin_Readme_Check.php @@ -102,9 +102,9 @@ private function check_default_text( Check_Result $result, string $readme_file, $donate_link = $parser->donate_link; if ( - in_array( 'tags', $tags, true ) - || strpos( $short_description, 'Here is a short description of the plugin.' ) !== false - || strpos( $donate_link, '//example.com/' ) !== false + in_array( 'tag1', $tags, true ) + || str_contains( $short_description, 'Here is a short description of the plugin.' ) + || str_contains( $donate_link, '//example.com/' ) ) { $this->add_result_warning_for_file( $result, diff --git a/phpstan.neon.dist b/phpstan.neon.dist index b8b9a4db3..0b56be811 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -19,5 +19,6 @@ parameters: message: '/^Function str_contains not found.$/' paths: - includes/Checker/Checks/Abstract_File_Check.php + - includes/Checker/Checks/Plugin_Readme_Check.php - includes/Traits/Find_Readme.php - includes/Traits/File_Editor_URL.php