diff --git a/src/Readability.php b/src/Readability.php index 30cbade..6dea5fd 100644 --- a/src/Readability.php +++ b/src/Readability.php @@ -572,12 +572,10 @@ class Readability implements LoggerAwareInterface */ public function cleanStyles(\DOMElement $e): void { - if (\is_object($e)) { - $elems = $e->getElementsByTagName('*'); + $elems = $e->getElementsByTagName('*'); - foreach ($elems as $elem) { - $elem->removeAttribute('style'); - } + foreach ($elems as $elem) { + $elem->removeAttribute('style'); } }