File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ class Readability implements LoggerAwareInterface
146146 protected $ domainRegExp = null ;
147147
148148 /**
149- * @var ?\DOMElement
149+ * @var ?\JSLikeHTMLElement
150150 */
151151 protected $ body = null ;
152152
@@ -603,7 +603,7 @@ public function getWordCount(string $text): int
603603 * This is the amount of text that is inside a link divided by the total text in the node.
604604 * Can exclude external references to differentiate between simple text and menus/infoblocks.
605605 */
606- public function getLinkDensity (\ DOMElement $ e , bool $ excludeExternal = false ): float
606+ public function getLinkDensity (JSLikeHTMLElement $ e , bool $ excludeExternal = false ): float
607607 {
608608 $ links = $ e ->getElementsByTagName ('a ' );
609609 $ textLength = mb_strlen ($ this ->getInnerText ($ e , true , true ));
Original file line number Diff line number Diff line change @@ -11,14 +11,18 @@ class DOMDocument
1111 /** @var JSLikeHTMLElement|null */
1212 public $documentElement;
1313
14- /** @var null */
15- public $ownerDocument;
16-
1714 /**
1815 * @param string $name
1916 * @return DOMNodeList<JSLikeHTMLElement>
2017 */
2118 public function getElementsByTagName($name) {}
19+
20+ /**
21+ * @param string $localName
22+ * @param string $value
23+ * @return JSLikeHTMLElement Officially, this can return false but PHPStan decided to ignore that: <https://github.com/phpstan/phpstan-src/pull/1569>
24+ */
25+ public function createElement($localName, $value = '') {}
2226}
2327
2428class DOMNode
You can’t perform that action at this time.
0 commit comments