You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($elementUriIsRelative && !$baseUriIsAbsolute) {
42
-
thrownew \InvalidArgumentException(sprintf('The URL of the element is relative, so you must define its base URI passing an absolute URL to the constructor of the "%s" class ("%s" was passed).', __CLASS__, $this->currentUri));
42
+
thrownew \InvalidArgumentException(\sprintf('The URL of the element is relative, so you must define its base URI passing an absolute URL to the constructor of the "%s" class ("%s" was passed).', __CLASS__, $this->currentUri));
Copy file name to clipboardExpand all lines: Crawler.php
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,7 @@ public function add(\DOMNodeList|\DOMNode|array|string|null $node): void
118
118
} elseif (\is_string($node)) {
119
119
$this->addContent($node);
120
120
} elseif (null !== $node) {
121
-
thrownew \InvalidArgumentException(sprintf('Expecting a DOMNodeList or DOMNode instance, an array, a string, or null, but got "%s".', get_debug_type($node)));
121
+
thrownew \InvalidArgumentException(\sprintf('Expecting a DOMNodeList or DOMNode instance, an array, a string, or null, but got "%s".', get_debug_type($node)));
122
122
}
123
123
}
124
124
@@ -732,7 +732,7 @@ public function filter(string $selector): static
732
732
publicfunctionselectLink(string$value): static
733
733
{
734
734
return$this->filterRelativeXPath(
735
-
sprintf('descendant-or-self::a[contains(concat(\'\', normalize-space(string(.)), \'\'), %1$s) or ./img[contains(concat(\'\', normalize-space(string(@alt)), \'\'), %1$s)]]', static::xpathLiteral(''.$value.''))
735
+
\sprintf('descendant-or-self::a[contains(concat(\'\', normalize-space(string(.)), \'\'), %1$s) or ./img[contains(concat(\'\', normalize-space(string(@alt)), \'\'), %1$s)]]', static::xpathLiteral(''.$value.''))
736
736
);
737
737
}
738
738
@@ -741,7 +741,7 @@ public function selectLink(string $value): static
@@ -752,7 +752,7 @@ public function selectImage(string $value): static
752
752
publicfunctionselectButton(string$value): static
753
753
{
754
754
return$this->filterRelativeXPath(
755
-
sprintf('descendant-or-self::input[((contains(%1$s, "submit") or contains(%1$s, "button")) and contains(concat(\'\', normalize-space(string(@value)), \'\'), %2$s)) or (contains(%1$s, "image") and contains(concat(\'\', normalize-space(string(@alt)), \'\'), %2$s)) or @id=%3$s or @name=%3$s] | descendant-or-self::button[contains(concat(\'\', normalize-space(string(.)), \'\'), %2$s) or @id=%3$s or @name=%3$s]', 'translate(@type, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")', static::xpathLiteral(''.$value.''), static::xpathLiteral($value))
755
+
\sprintf('descendant-or-self::input[((contains(%1$s, "submit") or contains(%1$s, "button")) and contains(concat(\'\', normalize-space(string(@value)), \'\'), %2$s)) or (contains(%1$s, "image") and contains(concat(\'\', normalize-space(string(@alt)), \'\'), %2$s)) or @id=%3$s or @name=%3$s] | descendant-or-self::button[contains(concat(\'\', normalize-space(string(.)), \'\'), %2$s) or @id=%3$s or @name=%3$s]', 'translate(@type, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")', static::xpathLiteral(''.$value.''), static::xpathLiteral($value))
756
756
);
757
757
}
758
758
@@ -770,7 +770,7 @@ public function link(string $method = 'get'): Link
770
770
$node = $this->getNode(0);
771
771
772
772
if (!$nodeinstanceof \DOMElement) {
773
-
thrownew \InvalidArgumentException(sprintf('The selected node should be instance of DOMElement, got "%s".', get_debug_type($node)));
773
+
thrownew \InvalidArgumentException(\sprintf('The selected node should be instance of DOMElement, got "%s".', get_debug_type($node)));
774
774
}
775
775
776
776
returnnewLink($node, $this->baseHref, $method);
@@ -788,7 +788,7 @@ public function links(): array
788
788
$links = [];
789
789
foreach ($this->nodesas$node) {
790
790
if (!$nodeinstanceof \DOMElement) {
791
-
thrownew \InvalidArgumentException(sprintf('The current node list should contain only DOMElement instances, "%s" found.', get_debug_type($node)));
791
+
thrownew \InvalidArgumentException(\sprintf('The current node list should contain only DOMElement instances, "%s" found.', get_debug_type($node)));
Copy file name to clipboardExpand all lines: Field/ChoiceFormField.php
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ public function select(string|array|bool $value): void
74
74
publicfunctiontick(): void
75
75
{
76
76
if ('checkbox' !== $this->type) {
77
-
thrownew \LogicException(sprintf('You cannot tick "%s" as it is not a checkbox (%s).', $this->name, $this->type));
77
+
thrownew \LogicException(\sprintf('You cannot tick "%s" as it is not a checkbox (%s).', $this->name, $this->type));
78
78
}
79
79
80
80
$this->setValue(true);
@@ -88,7 +88,7 @@ public function tick(): void
88
88
publicfunctionuntick(): void
89
89
{
90
90
if ('checkbox' !== $this->type) {
91
-
thrownew \LogicException(sprintf('You cannot untick "%s" as it is not a checkbox (%s).', $this->name, $this->type));
91
+
thrownew \LogicException(\sprintf('You cannot untick "%s" as it is not a checkbox (%s).', $this->name, $this->type));
92
92
}
93
93
94
94
$this->setValue(false);
@@ -110,16 +110,16 @@ public function setValue(string|array|bool|null $value): void
110
110
} else {
111
111
if (\is_array($value)) {
112
112
if (!$this->multiple) {
113
-
thrownew \InvalidArgumentException(sprintf('The value for "%s" cannot be an array.', $this->name));
113
+
thrownew \InvalidArgumentException(\sprintf('The value for "%s" cannot be an array.', $this->name));
114
114
}
115
115
116
116
foreach ($valueas$v) {
117
117
if (!$this->containsOption($v, $this->options)) {
118
-
thrownew \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: "%s").', $this->name, $v, implode('", "', $this->availableOptionValues())));
118
+
thrownew \InvalidArgumentException(\sprintf('Input "%s" cannot take "%s" as a value (possible values: "%s").', $this->name, $v, implode('", "', $this->availableOptionValues())));
thrownew \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: "%s").', $this->name, $value, implode('", "', $this->availableOptionValues())));
122
+
thrownew \InvalidArgumentException(\sprintf('Input "%s" cannot take "%s" as a value (possible values: "%s").', $this->name, $value, implode('", "', $this->availableOptionValues())));
123
123
}
124
124
125
125
if ($this->multiple) {
@@ -144,7 +144,7 @@ public function setValue(string|array|bool|null $value): void
144
144
publicfunctionaddChoice(\DOMElement$node): void
145
145
{
146
146
if (!$this->multiple && 'radio' !== $this->type) {
147
-
thrownew \LogicException(sprintf('Unable to add a choice for "%s" as it is not multiple or is not a radio button.', $this->name));
147
+
thrownew \LogicException(\sprintf('Unable to add a choice for "%s" as it is not multiple or is not a radio button.', $this->name));
148
148
}
149
149
150
150
$option = $this->buildOptionValue($node);
@@ -179,11 +179,11 @@ public function isMultiple(): bool
179
179
protectedfunctioninitialize(): void
180
180
{
181
181
if ('input' !== $this->node->nodeName && 'select' !== $this->node->nodeName) {
182
-
thrownew \LogicException(sprintf('A ChoiceFormField can only be created from an input or select tag (%s given).', $this->node->nodeName));
182
+
thrownew \LogicException(\sprintf('A ChoiceFormField can only be created from an input or select tag (%s given).', $this->node->nodeName));
thrownew \LogicException(sprintf('A ChoiceFormField can only be created from an input tag with a type of checkbox or radio (given type is "%s").', $this->node->getAttribute('type')));
186
+
thrownew \LogicException(\sprintf('A ChoiceFormField can only be created from an input tag with a type of checkbox or radio (given type is "%s").', $this->node->getAttribute('type')));
@@ -90,11 +90,11 @@ public function setFilePath(string $path): void
90
90
protectedfunctioninitialize(): void
91
91
{
92
92
if ('input' !== $this->node->nodeName) {
93
-
thrownew \LogicException(sprintf('A FileFormField can only be created from an input tag (%s given).', $this->node->nodeName));
93
+
thrownew \LogicException(\sprintf('A FileFormField can only be created from an input tag (%s given).', $this->node->nodeName));
94
94
}
95
95
96
96
if ('file' !== strtolower($this->node->getAttribute('type'))) {
97
-
thrownew \LogicException(sprintf('A FileFormField can only be created from an input tag with a type of file (given type is "%s").', $this->node->getAttribute('type')));
97
+
thrownew \LogicException(\sprintf('A FileFormField can only be created from an input tag with a type of file (given type is "%s").', $this->node->getAttribute('type')));
0 commit comments