Skip to content

Commit

Permalink
Add stuff and fix some
Browse files Browse the repository at this point in the history
  • Loading branch information
Girgias committed Dec 11, 2024
1 parent aa8c5aa commit 096284d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
9 changes: 7 additions & 2 deletions stubs/dom.stub
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class DOMElement extends DOMNode

/**
* @readonly
* @var DOMNamedNodeMap<DOMAttr>|null
* @var DOMNamedNodeMap<DOMAttr>
*/
public $attributes;

Expand All @@ -67,9 +67,14 @@ class DOMElement extends DOMNode
public function getElementsByTagNameNS ($namespaceURI, $localName) {}

/**
* @phpstan-assert-if-true =DOMNamedNodeMap<DOMAttr> $this->attributes
* @phpstan-assert-if-true non-empty-string $this->getAttribute($qualifiedName)

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-5 echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-7 echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / E2E tests (cd e2e/baseline-uninit-prop-trait ../../bin/phpstan analyse --debug --configuration te...

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-8 composer install ../../bin/phpstan echo -en '\n' >>...

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/bug-9622-trait echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-6 echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / E2E tests (bin/phpstan analyse e2e/only-files-not-analysed-trait/src -c e2e/only-files-not-analys...

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/bug-9622 echo -n > phpstan-baseline.neon ../../bin/phpstan -vvv pa...

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-4 echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/bug10449b ../../bin/phpstan analyze git apply patch.diff rm phpsta...

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/bug-11857 composer install ../../bin/phpstan )

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-2 echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-1 echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/bug10449 ../../bin/phpstan analyze git apply patch.diff rm phpstan...

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Compiler Tests

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-3 echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Integration tests (ubuntu-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Integration tests (windows-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 70 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.1)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 70 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 69 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 70 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 70 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 70 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 70 on line 2

Check failure on line 70 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (non-empty-string $this->getAttribute($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 70 on line 2
* @phpstan-assert-if-true DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-5 echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-7 echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / E2E tests (cd e2e/baseline-uninit-prop-trait ../../bin/phpstan analyse --debug --configuration te...

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-8 composer install ../../bin/phpstan echo -en '\n' >>...

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/bug-9622-trait echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-6 echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / E2E tests (bin/phpstan analyse e2e/only-files-not-analysed-trait/src -c e2e/only-files-not-analys...

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/bug-9622 echo -n > phpstan-baseline.neon ../../bin/phpstan -vvv pa...

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-4 echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/bug10449b ../../bin/phpstan analyze git apply patch.diff rm phpsta...

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/bug-11857 composer install ../../bin/phpstan )

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-2 echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-1 echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/bug10449 ../../bin/phpstan analyze git apply patch.diff rm phpstan...

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Compiler Tests

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Result cache E2E tests (cd e2e/result-cache-3 echo -n > phpstan-baseline.neon ../../bin/phpstan -...

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Integration tests (ubuntu-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Integration tests (windows-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 164 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.1)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 164 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 162 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 164 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 164 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 164 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 164 on line 3

Check failure on line 71 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

PHPDoc tag @phpstan-assert-if-true has invalid value (DOMAttr|DOMNameSpaceNode $this->getAttributeNode($qualifiedName)): Unexpected token "$qualifiedName", expected ')' at offset 164 on line 3
*/
public function hasAttribute(string $qualifiedName): bool {}

public function getAttribute(string $qualifiedName): string {}

public function getAttributeNode(string $qualifiedName): DOMAttr|DOMNameSpaceNode|false {}

Check failure on line 77 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Method DOMElement::getAttributeNode() uses native union types but they're supported only on PHP 8.0 and later.

Check failure on line 77 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Method DOMElement::getAttributeNode() uses native union types but they're supported only on PHP 8.0 and later.
}

/**
Expand Down
11 changes: 4 additions & 7 deletions tests/PHPStan/Analyser/nsrt/DOMLegacyNamedNodeNap.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,27 @@ public function basic_node(DOMNode $node): void {

public function element_node(DOMElement $element): void
{
assertType('DOMNamedNodeMap<DOMAttr>|null', $element->attributes);
assertType('DOMNamedNodeMap<DOMAttr>', $element->attributes);
if ($element->hasAttribute('class')) {
assertType('DOMNamedNodeMap<DOMAttr>', $element->attributes);
$attribute = $element->getAttributeNode('class');
assertType(DOMAttr::class, $attribute);
assertType('string', $attribute->value);
} else {
assertType('DOMNamedNodeMap<DOMAttr>|null', $element->attributes);
$attribute = $element->getAttributeNode('class');
assertType('false', $attribute);
}
}

public function element_node_attribute_fetch_via_attributes_property(DOMElement $element): void
{
assertType('DOMNamedNodeMap<DOMAttr>|null', $element->attributes);
assertType('DOMNamedNodeMap<DOMAttr>', $element->attributes);
if ($element->hasAttribute('class')) {
assertType('DOMNamedNodeMap<DOMAttr>', $element->attributes);
$attribute = $element->attributes->getNamedItem('class');
if ($attribute === null) {
return;
}
assertType(DOMAttr::class, $attribute);
assertType('string', $attribute->value);
} else {
assertType('DOMNamedNodeMap<DOMAttr>|null', $element->attributes);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ function element_node_attribute_fetch_via_attributes_property(\DOMElement $eleme
}
echo $attribute->value;
}

function element_node_attribute_fetch_via_getAttributeNode(\DOMElement $element): void
{
$attribute = $element->getAttributeNode('class');
if ($attribute === null) {
return;
}
echo $attribute->value;
}

0 comments on commit 096284d

Please sign in to comment.