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
146
146
protected $ domainRegExp = null ;
147
147
148
148
/**
149
- * @var ?\DOMElement
149
+ * @var ?\JSLikeHTMLElement
150
150
*/
151
151
protected $ body = null ;
152
152
@@ -603,7 +603,7 @@ public function getWordCount(string $text): int
603
603
* This is the amount of text that is inside a link divided by the total text in the node.
604
604
* Can exclude external references to differentiate between simple text and menus/infoblocks.
605
605
*/
606
- public function getLinkDensity (\ DOMElement $ e , bool $ excludeExternal = false ): float
606
+ public function getLinkDensity (JSLikeHTMLElement $ e , bool $ excludeExternal = false ): float
607
607
{
608
608
$ links = $ e ->getElementsByTagName ('a ' );
609
609
$ textLength = mb_strlen ($ this ->getInnerText ($ e , true , true ));
Original file line number Diff line number Diff line change @@ -11,14 +11,18 @@ class DOMDocument
11
11
/** @var JSLikeHTMLElement|null */
12
12
public $documentElement;
13
13
14
- /** @var null */
15
- public $ownerDocument;
16
-
17
14
/**
18
15
* @param string $name
19
16
* @return DOMNodeList<JSLikeHTMLElement>
20
17
*/
21
18
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 = '') {}
22
26
}
23
27
24
28
class DOMNode
You can’t perform that action at this time.
0 commit comments