Skip to content

Commit

Permalink
Mark DOMNamedNodeMap as taking a covariant DOMNode
Browse files Browse the repository at this point in the history
And indicate that `DOMNode::$attributes` is a node map of `DOMAttr`
  • Loading branch information
Girgias committed Dec 7, 2024
1 parent 7b4c9af commit 7750ba6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions stubs/dom.stub
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class DOMDocument

class DOMNode
{

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

Check failure on line 33 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 -...

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 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 -...

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 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...

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 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...

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 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...

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 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...

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / E2E tests (cd e2e/discussion-11362 composer install ../../bin/phpstan )

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / E2E tests (cd e2e/discussion-11362 composer install ../../bin/phpstan )

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 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...

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 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...

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 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...

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 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...

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 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 -...

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 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 -...

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 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 -...

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 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 -...

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 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 -...

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 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 -...

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

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

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 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 -...

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 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 -...

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

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

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 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 -...

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 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 -...

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 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 -...

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 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 -...

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Compiler Tests

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Compiler Tests

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Integration tests (ubuntu-latest)

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Integration tests (ubuntu-latest)

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 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 -...

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 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 -...

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Integration tests (windows-latest)

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / Integration tests (windows-latest)

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 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' >>...

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 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' >>...

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.1)

Generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes specifies 2 template types, but class DOMNamedNodeMap supports only 1: TNode

Check failure on line 33 in stubs/dom.stub

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.1)

Type string in generic type DOMNamedNodeMap<string, DOMAttr> in PHPDoc tag @var for property DOMNode::$attributes is not subtype of template type TNode of DOMNode of class DOMNamedNodeMap.
}

class DOMElement extends DOMNode
Expand Down Expand Up @@ -141,9 +142,12 @@ class DOMProcessingInstruction
}

/**
* @template-covariant TNode as DOMNode
* @implements Traversable<string, TNode>
* @implements IteratorAggregate<int, TNode>
* @property-read int $length
*/
class DOMNamedNodeMap
class DOMNamedNodeMap implements Traversable, IteratorAggregate, Countable
{

}
Expand Down

0 comments on commit 7750ba6

Please sign in to comment.