Skip to content

Commit 247f8be

Browse files
committed
PHPStan fixes
1 parent 99dc3db commit 247f8be

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Dom/Document/Filter/NormalizeHtmlEntities.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,6 @@ protected function hasHtmlEntities($html)
9292
{
9393
// TODO: Discuss other popular entities to look for, especially for languages
9494
// with different punctuation symbols.
95-
return preg_match('/,|.|!|?/', $html);
95+
return 1 === preg_match('/,|.|!|?/', $html);
9696
}
9797
}

src/Optimizer/Transformer/AmpRuntimePreloads.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function transform(Document $document, ErrorCollection $errors)
3737
* Check whether the AMP runtime script is needed.
3838
*
3939
* @param Document $document Document to check in.
40-
* @return bool Whether the AMP runtime script is needed.
40+
* @return false Whether the AMP runtime script is needed.
4141
*/
4242
private function isAmpRuntimeScriptNeeded(Document $document)
4343
{

src/Optimizer/Transformer/ReorderHead.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ private function containsWord($haystack, $needle)
345345
return false;
346346
}
347347

348-
return preg_match('/(^|\s)' . preg_quote($needle, '/') . '(\s|$)/i', $haystack);
348+
return 1 === preg_match('/(^|\s)' . preg_quote($needle, '/') . '(\s|$)/i', $haystack);
349349
}
350350

351351
/**

0 commit comments

Comments
 (0)