Skip to content

Commit

Permalink
Use is_string() rather than !== null for extra clarity, succinctl…
Browse files Browse the repository at this point in the history
…y providing extra information.


Good suggestion.  I agree.  It's `null|string` (nothing else), so much clearer to test for the non-null type.

Co-authored-by: Oliver Klee <github@oliverklee.de>
  • Loading branch information
JakeQZ and oliverklee committed Sep 10, 2023
1 parent e44ab87 commit 2b85ef9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CssInliner.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ private function getCssFromAllStyleNodes(): string

$css = '';
foreach ($styleNodes as $styleNode) {
if ($styleNode->nodeValue !== null) {
if (\is_string($styleNode->nodeValue)) {
$css .= "\n\n" . $styleNode->nodeValue;
}
$parentNode = $styleNode->parentNode;
Expand Down

0 comments on commit 2b85ef9

Please sign in to comment.