1 | <?php |
||
13 | class EmptyNode extends Node |
||
14 | { |
||
15 | private $query; |
||
16 | |||
17 | /** |
||
18 | * @param CrawlerInterface $crawler |
||
19 | */ |
||
20 | public function __construct(CrawlerInterface $crawler, AbstractQuery $query = null) |
||
21 | { |
||
22 | $this->query = $query; |
||
23 | |||
24 | parent::__construct($crawler, null); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @param AbstractQuery $query |
||
29 | * @return array |
||
30 | */ |
||
31 | 1 | public function queryIds(AbstractQuery $query) |
|
32 | { |
||
33 | 1 | return []; |
|
34 | 1 | } |
|
35 | |||
36 | // Accessors |
||
37 | |||
38 | /** |
||
39 | * @param string $name |
||
40 | * @return null |
||
41 | */ |
||
42 | 1 | public function getAttribute($name) |
|
46 | |||
47 | /** |
||
48 | * @return null |
||
49 | */ |
||
50 | 1 | public function getText() |
|
54 | |||
55 | /** |
||
56 | * @return null |
||
57 | */ |
||
58 | 1 | public function getHtml() |
|
62 | |||
63 | /** |
||
64 | * @return null |
||
65 | */ |
||
66 | 1 | public function getValue() |
|
70 | |||
71 | /** |
||
72 | * @param string $value |
||
73 | * @throws DomainException |
||
74 | */ |
||
75 | public function setValue($value) |
||
76 | { |
||
77 | throw new DomainException(sprintf('Cannot set value, element not found: %s', $this->query)); |
||
78 | } |
||
79 | |||
80 | /** |
||
81 | * @param string $file |
||
82 | * @throws DomainException |
||
83 | */ |
||
84 | public function setFile($file) |
||
85 | { |
||
86 | throw new DomainException(sprintf('Cannot set file, element not found: %s', $this->query)); |
||
87 | } |
||
88 | |||
89 | /** |
||
90 | * @return boolean |
||
91 | */ |
||
92 | 1 | public function isVisible() |
|
96 | |||
97 | /** |
||
98 | * @return boolean |
||
99 | */ |
||
100 | 1 | public function isSelected() |
|
104 | |||
105 | /** |
||
106 | * @return boolean |
||
107 | */ |
||
108 | 1 | public function isChecked() |
|
112 | |||
113 | /** |
||
114 | * @throws DomainException |
||
115 | */ |
||
116 | public function click() |
||
120 | |||
121 | /** |
||
122 | * @throws DomainException |
||
123 | */ |
||
124 | public function select() |
||
128 | } |
||
129 |