Skip to content

Commit

Permalink
Update stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
phpstan-bot committed Aug 28, 2024
1 parent 5a2c168 commit 9bd59d7
Show file tree
Hide file tree
Showing 18 changed files with 261 additions and 61 deletions.
33 changes: 26 additions & 7 deletions stubs/ext/dom/Dom/Attr.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,38 @@
#[\Since('8.4')]
class Attr extends \Dom\Node
{
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?string $namespaceURI;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?string $prefix;
/** @readonly */
/**
* @readonly
* @virtual
*/
public string $localName;
/** @readonly */
/**
* @readonly
* @virtual
*/
public string $name;
/** @virtual */
public string $value;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?Element $ownerElement;
/** @readonly */
public bool $specified = true;
/**
* @readonly
* @virtual
*/
public bool $specified;
/** @implementation-alias DOMAttr::isId */
public function isId(): bool
{
Expand Down
16 changes: 13 additions & 3 deletions stubs/ext/dom/Dom/CharacterData.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@
#[\Since('8.4')]
class CharacterData extends \Dom\Node implements \Dom\ChildNode
{
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?Element $previousElementSibling;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?Element $nextElementSibling;
/** @virtual */
public string $data;
/** @readonly */
/**
* @readonly
* @virtual
*/
public int $length;
/** @implementation-alias DOMCharacterData::substringData */
public function substringData(int $offset, int $count): string
Expand Down
37 changes: 31 additions & 6 deletions stubs/ext/dom/Dom/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,25 @@ abstract class Document extends \Dom\Node implements \Dom\ParentNode
{
/** @readonly */
public Implementation $implementation;
/** @virtual */
public string $URL;
/** @virtual */
public string $documentURI;
/** @virtual */
public string $characterSet;
/** @virtual */
public string $charset;
/** @virtual */
public string $inputEncoding;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?DocumentType $doctype;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?Element $documentElement;
/** @implementation-alias Dom\Element::getElementsByTagName */
public function getElementsByTagName(string $qualifiedName): HTMLCollection
Expand Down Expand Up @@ -63,11 +74,20 @@ public function createAttribute(string $localName): Attr
public function createAttributeNS(?string $namespace, string $qualifiedName): Attr
{
}
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?Element $firstElementChild;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?Element $lastElementChild;
/** @readonly */
/**
* @readonly
* @virtual
*/
public int $childElementCount;
/** @implementation-alias DOMDocument::getElementById */
public function getElementById(string $elementId): ?Element
Expand Down Expand Up @@ -117,8 +137,13 @@ public function querySelector(string $selectors): ?Element
public function querySelectorAll(string $selectors): NodeList
{
}
/** @virtual */
public ?HTMLElement $body;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?HTMLElement $head;
/** @virtual */
public string $title;
}
15 changes: 12 additions & 3 deletions stubs/ext/dom/Dom/DocumentFragment.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@
#[\Since('8.4')]
class DocumentFragment extends \Dom\Node implements \Dom\ParentNode
{
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?Element $firstElementChild;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?Element $lastElementChild;
/** @readonly */
/**
* @readonly
* @virtual
*/
public int $childElementCount;
/** @implementation-alias DOMDocumentFragment::appendXML */
public function appendXml(string $data): bool
Expand Down
30 changes: 24 additions & 6 deletions stubs/ext/dom/Dom/DocumentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,35 @@
#[\Since('8.4')]
class DocumentType extends \Dom\Node implements \Dom\ChildNode
{
/** @readonly */
/**
* @readonly
* @virtual
*/
public string $name;
/** @readonly */
/**
* @readonly
* @virtual
*/
public DtdNamedNodeMap $entities;
/** @readonly */
/**
* @readonly
* @virtual
*/
public DtdNamedNodeMap $notations;
/** @readonly */
/**
* @readonly
* @virtual
*/
public string $publicId;
/** @readonly */
/**
* @readonly
* @virtual
*/
public string $systemId;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?string $internalSubset;
/** @implementation-alias DOMElement::remove */
public function remove(): void
Expand Down
5 changes: 4 additions & 1 deletion stubs/ext/dom/Dom/DtdNamedNodeMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
#[\Since('8.4')]
class DtdNamedNodeMap implements \IteratorAggregate, \Countable
{
/** @readonly */
/**
* @readonly
* @virtual
*/
public int $length;
/** @implementation-alias DOMNamedNodeMap::item */
public function item(int $index): Entity|Notation|null
Expand Down
54 changes: 44 additions & 10 deletions stubs/ext/dom/Dom/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,40 @@
#[\Since('8.4')]
class Element extends \Dom\Node implements \Dom\ParentNode, \Dom\ChildNode
{
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?string $namespaceURI;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?string $prefix;
/** @readonly */
/**
* @readonly
* @virtual
*/
public string $localName;
/** @readonly */
/**
* @readonly
* @virtual
*/
public string $tagName;
/** @virtual */
public string $id;
/** @virtual */
public string $className;
/** @readonly */
public TokenList $classList;
/** @implementation-alias DOMNode::hasAttributes */
public function hasAttributes(): bool
{
}
/** @readonly */
/**
* @readonly
* @virtual
*/
public NamedNodeMap $attributes;
/** @implementation-alias DOMElement::getAttributeNames */
public function getAttributeNames(): array
Expand Down Expand Up @@ -92,15 +109,30 @@ public function insertAdjacentElement(AdjacentPosition $where, Element $element)
public function insertAdjacentText(AdjacentPosition $where, string $data): void
{
}
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?Element $firstElementChild;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?Element $lastElementChild;
/** @readonly */
/**
* @readonly
* @virtual
*/
public int $childElementCount;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?Element $previousElementSibling;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?Element $nextElementSibling;
/** @implementation-alias DOMElement::setIdAttribute */
public function setIdAttribute(string $qualifiedName, bool $isId): void
Expand Down Expand Up @@ -153,7 +185,9 @@ public function closest(string $selectors): ?Element
public function matches(string $selectors): bool
{
}
/** @virtual */
public string $innerHTML;
/** @virtual */
public string $substitutedNodeValue;
/** @return list<NamespaceInfo> */
public function getInScopeNamespaces(): array
Expand Down
15 changes: 12 additions & 3 deletions stubs/ext/dom/Dom/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@
#[\Since('8.4')]
class Entity extends \Dom\Node
{
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?string $publicId;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?string $systemId;
/** @readonly */
/**
* @readonly
* @virtual
*/
public ?string $notationName;
}
5 changes: 4 additions & 1 deletion stubs/ext/dom/Dom/HTMLCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
#[\Since('8.4')]
class HTMLCollection implements \IteratorAggregate, \Countable
{
/** @readonly */
/**
* @readonly
* @virtual
*/
public int $length;
/** @implementation-alias DOMNodeList::item */
public function item(int $index): ?Element
Expand Down
5 changes: 4 additions & 1 deletion stubs/ext/dom/Dom/NamedNodeMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
#[\Since('8.4')]
class NamedNodeMap implements \IteratorAggregate, \Countable
{
/** @readonly */
/**
* @readonly
* @virtual
*/
public int $length;
/** @implementation-alias DOMNamedNodeMap::item */
public function item(int $index): ?Attr
Expand Down
Loading

0 comments on commit 9bd59d7

Please sign in to comment.