Skip to content

Commit 75cd653

Browse files
committed
Restore strict rule compliance
1 parent b05aeac commit 75cd653

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __invoke( OD_HTML_Tag_Walker $walker ): bool {
3939
if (
4040
is_string( $style )
4141
&&
42-
preg_match( '/background(?:-image)?\s*:[^;]*?url\(\s*[\'"]?\s*(?<background_image>.+?)\s*[\'"]?\s*\)/', $style, $matches ) // Not compatible with strict rules. See <https://github.com/phpstan/phpstan/issues/11262>.
42+
1 === preg_match( '/background(?:-image)?\s*:[^;]*?url\(\s*[\'"]?\s*(?<background_image>.+?)\s*[\'"]?\s*\)/', $style, $matches ) // Not compatible with strict rules. See <https://github.com/phpstan/phpstan/issues/11262>.
4343
&&
4444
'' !== $matches['background_image'] // PHPStan should ideally know that this is a non-empty string based on the `.+?` regular expression. See <https://github.com/phpstan/phpstan/issues/11222>.
4545
&&

0 commit comments

Comments
 (0)