18
18
*/
19
19
abstract class AbstractUriElement
20
20
{
21
- /**
22
- * @deprecated since Symfony 7.1, use `$domeNode` instead
23
- */
24
21
protected \DOMElement $ node ;
25
- protected \DOMElement |\DOM \Element $ domNode ;
26
22
protected ?string $ method ;
27
23
28
24
/**
29
- * @param \DOMElement|\DOM\Element $node A \DOMElement or a \DOM\Element instance
30
- * @param string|null $currentUri The URI of the page where the link is embedded (or the base href)
31
- * @param string|null $method The method to use for the link (GET by default)
25
+ * @param \DOMElement $node A \DOMElement instance
26
+ * @param string|null $currentUri The URI of the page where the link is embedded (or the base href)
27
+ * @param string|null $method The method to use for the link (GET by default)
32
28
*
33
29
* @throws \InvalidArgumentException if the node is not a link
34
30
*/
35
31
public function __construct (
36
- \DOMElement | \ DOM \ Element $ node ,
32
+ \DOMElement $ node ,
37
33
protected ?string $ currentUri = null ,
38
34
?string $ method = 'GET ' ,
39
35
) {
40
- $ this ->setDomNode ($ node );
36
+ $ this ->setNode ($ node );
41
37
$ this ->method = $ method ? strtoupper ($ method ) : null ;
42
38
43
39
$ elementUriIsRelative = null === parse_url (trim ($ this ->getRawUri ()), \PHP_URL_SCHEME );
@@ -47,26 +43,12 @@ public function __construct(
47
43
}
48
44
}
49
45
50
- /**
51
- * @deprecated since Symfony 7.1, use `getDomNode()` instead
52
- */
53
- public function getNode (): \DOMElement
54
- {
55
- trigger_deprecation ('symfony/dom-crawler ' , '7.1 ' , 'The "%s()" method is deprecated, use "%s::getDomNode()" instead. ' , __METHOD__ , __CLASS__ );
56
-
57
- if ($ this ->domNode instanceof \DOM \Element) {
58
- throw new \LogicException ('The node is not an instance of legacy \DOMElement. Use "getDomNode()" instead. ' );
59
- }
60
-
61
- return $ this ->domNode ;
62
- }
63
-
64
46
/**
65
47
* Gets the node associated with this link.
66
48
*/
67
- public function getDomNode (): \DOMElement | \ DOM \ Element
49
+ public function getNode (): \DOMElement
68
50
{
69
- return $ this ->domNode ;
51
+ return $ this ->node ;
70
52
}
71
53
72
54
/**
@@ -126,20 +108,4 @@ protected function canonicalizePath(string $path): string
126
108
* @throws \LogicException If given node is not an anchor
127
109
*/
128
110
abstract protected function setNode (\DOMElement $ node ): void ;
129
-
130
- /**
131
- * Sets current \DOMElement or \DOM\Element instance.
132
- *
133
- * @param \DOMElement|\DOM\Element $node A \DOMElement or \DOM\Element instance
134
- *
135
- * @throws \LogicException If given node is not an anchor
136
- */
137
- protected function setDomNode (\DOMElement |\DOM \Element $ node ): void
138
- {
139
- $ this ->domNode = $ node ;
140
-
141
- if ($ node instanceof \DOMElement) {
142
- $ this ->setNode ($ node );
143
- }
144
- }
145
111
}
0 commit comments