Remove redundant is_object check

The argument can only be `DOMElement`.

Discovered by bleeding edge PHPStan.
pull/93/head
Jan Tojnar 1 year ago
parent 573b139a4b
commit c6d0eb2345
  1. 2
      src/Readability.php

@ -572,14 +572,12 @@ class Readability implements LoggerAwareInterface
*/ */
public function cleanStyles(\DOMElement $e): void public function cleanStyles(\DOMElement $e): void
{ {
if (\is_object($e)) {
$elems = $e->getElementsByTagName('*'); $elems = $e->getElementsByTagName('*');
foreach ($elems as $elem) { foreach ($elems as $elem) {
$elem->removeAttribute('style'); $elem->removeAttribute('style');
} }
} }
}
/** /**
* Get comma number for a given text. * Get comma number for a given text.

Loading…
Cancel
Save