Skip to content

Commit e5cb66a

Browse files
committed
Move CSS selector stuff to modern classes
1 parent 1e93d61 commit e5cb66a

File tree

3 files changed

+52
-62
lines changed

3 files changed

+52
-62
lines changed

ext/dom/element.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,17 +1734,17 @@ static void php_dom_dispatch_query_selector(INTERNAL_FUNCTION_PARAMETERS, bool a
17341734
}
17351735
}
17361736

1737-
PHP_METHOD(DOMElement, querySelector)
1737+
PHP_METHOD(DOM_Element, querySelector)
17381738
{
17391739
php_dom_dispatch_query_selector(INTERNAL_FUNCTION_PARAM_PASSTHRU, false);
17401740
}
17411741

1742-
PHP_METHOD(DOMElement, querySelectorAll)
1742+
PHP_METHOD(DOM_Element, querySelectorAll)
17431743
{
17441744
php_dom_dispatch_query_selector(INTERNAL_FUNCTION_PARAM_PASSTHRU, true);
17451745
}
17461746

1747-
PHP_METHOD(DOMElement, matches)
1747+
PHP_METHOD(DOM_Element, matches)
17481748
{
17491749
zend_string *selectors_str;
17501750

ext/dom/php_dom.stub.php

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,6 @@ public function prepend(...$nodes): void;
280280

281281
/** @param DOMNode|string $nodes */
282282
public function replaceChildren(...$nodes): void;
283-
284-
public function querySelector(string $selectors): ?DOMElement {}
285-
286-
public function querySelectorAll(string $selectors): DOMNodeList {}
287283
}
288284

289285
interface DOMChildNode
@@ -511,12 +507,6 @@ public function prepend(...$nodes): void {}
511507
* @implementation-alias DOMDocument::replaceChildren
512508
*/
513509
public function replaceChildren(...$nodes): void {}
514-
515-
/** @implementation-alias DOMElement::querySelector */
516-
public function querySelector(string $selectors): ?DOMElement {}
517-
518-
/** @implementation-alias DOMElement::querySelectorAll */
519-
public function querySelectorAll(string $selectors): DOMNodeList {}
520510
}
521511

522512
class DOMNodeList implements IteratorAggregate, Countable
@@ -712,14 +702,6 @@ public function prepend(...$nodes): void {}
712702
/** @param DOMNode|string $nodes */
713703
public function replaceChildren(...$nodes): void {}
714704

715-
/** @implementation-alias DOMElement::querySelector */
716-
public function querySelector(string $selectors): ?DOMElement {}
717-
718-
/** @implementation-alias DOMElement::querySelectorAll */
719-
public function querySelectorAll(string $selectors): DOMNodeList {}
720-
721-
public function matches(string $selectors): bool {}
722-
723705
public function insertAdjacentElement(string $where, DOMElement $element): ?DOMElement {}
724706

725707
public function insertAdjacentText(string $where, string $data): void {}
@@ -1132,6 +1114,9 @@ interface ParentNode
11321114
public function append(Node|string ...$nodes): void;
11331115
public function prepend(Node|string ...$nodes): void;
11341116
public function replaceChildren(Node|string ...$nodes): void;
1117+
1118+
public function querySelector(string $selectors): ?Element;
1119+
public function querySelectorAll(string $selectors): NodeList;
11351120
}
11361121

11371122
interface ChildNode
@@ -1391,6 +1376,10 @@ public function append(Node|string ...$nodes): void {}
13911376
public function prepend(Node|string ...$nodes): void {}
13921377
/** @implementation-alias DOMElement::replaceChildren */
13931378
public function replaceChildren(Node|string ...$nodes): void {}
1379+
1380+
public function querySelector(string $selectors): ?Element {}
1381+
public function querySelectorAll(string $selectors): NodeList {}
1382+
public function matches(string $selectors): bool {}
13941383
}
13951384

13961385
class Attr extends Node
@@ -1507,6 +1496,11 @@ public function append(Node|string ...$nodes): void {}
15071496
public function prepend(Node|string ...$nodes): void {}
15081497
/** @implementation-alias DOMElement::replaceChildren */
15091498
public function replaceChildren(Node|string ...$nodes): void {}
1499+
1500+
/** @implementation-alias DOM\Element::querySelector */
1501+
public function querySelector(string $selectors): ?Element {}
1502+
/** @implementation-alias DOM\Element::querySelectorAll */
1503+
public function querySelectorAll(string $selectors): NodeList {}
15101504
}
15111505

15121506
class Entity extends Node
@@ -1602,10 +1596,10 @@ public function replaceChildren(Node|string ...$nodes): void {}
16021596

16031597
public function importLegacyNode(\DOMNode $node, bool $deep = false): Node {}
16041598

1605-
/** @implementation-alias DOMElement::querySelector */
1599+
/** @implementation-alias DOM\Element::querySelector */
16061600
public function querySelector(string $selectors): ?Element {}
16071601

1608-
/** @implementation-alias DOMElement::querySelectorAll */
1602+
/** @implementation-alias DOM\Element::querySelectorAll */
16091603
public function querySelectorAll(string $selectors): NodeList {}
16101604
}
16111605

ext/dom/php_dom_arginfo.h

Lines changed: 35 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)