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) {
52
-
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));
52
+
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
@@ -124,7 +124,7 @@ public function add(\DOMNodeList|\DOMNode|array|string|null $node)
124
124
} elseif (\is_string($node)) {
125
125
$this->addContent($node);
126
126
} elseif (null !== $node) {
127
-
thrownew \InvalidArgumentException(sprintf('Expecting a DOMNodeList or DOMNode instance, an array, a string, or null, but got "%s".', get_debug_type($node)));
127
+
thrownew \InvalidArgumentException(\sprintf('Expecting a DOMNodeList or DOMNode instance, an array, a string, or null, but got "%s".', get_debug_type($node)));
128
128
}
129
129
}
130
130
@@ -755,7 +755,7 @@ public function filter(string $selector): static
755
755
publicfunctionselectLink(string$value): static
756
756
{
757
757
return$this->filterRelativeXPath(
758
-
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.''))
758
+
\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.''))
759
759
);
760
760
}
761
761
@@ -764,7 +764,7 @@ public function selectLink(string $value): static
@@ -775,7 +775,7 @@ public function selectImage(string $value): static
775
775
publicfunctionselectButton(string$value): static
776
776
{
777
777
return$this->filterRelativeXPath(
778
-
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 contains(concat(\'\', normalize-space(string(@value)), \'\'), %2$s) or @id=%3$s or @name=%3$s]', 'translate(@type, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")', static::xpathLiteral(''.$value.''), static::xpathLiteral($value))
778
+
\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 contains(concat(\'\', normalize-space(string(@value)), \'\'), %2$s) or @id=%3$s or @name=%3$s]', 'translate(@type, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")', static::xpathLiteral(''.$value.''), static::xpathLiteral($value))
779
779
);
780
780
}
781
781
@@ -793,7 +793,7 @@ public function link(string $method = 'get'): Link
793
793
$node = $this->getNode(0);
794
794
795
795
if (!$nodeinstanceof \DOMElement) {
796
-
thrownew \InvalidArgumentException(sprintf('The selected node should be instance of DOMElement, got "%s".', get_debug_type($node)));
796
+
thrownew \InvalidArgumentException(\sprintf('The selected node should be instance of DOMElement, got "%s".', get_debug_type($node)));
797
797
}
798
798
799
799
returnnewLink($node, $this->baseHref, $method);
@@ -811,7 +811,7 @@ public function links(): array
811
811
$links = [];
812
812
foreach ($this->nodesas$node) {
813
813
if (!$nodeinstanceof \DOMElement) {
814
-
thrownew \InvalidArgumentException(sprintf('The current node list should contain only DOMElement instances, "%s" found.', get_debug_type($node)));
814
+
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
@@ -82,7 +82,7 @@ public function select(string|array|bool $value)
82
82
publicfunctiontick()
83
83
{
84
84
if ('checkbox' !== $this->type) {
85
-
thrownew \LogicException(sprintf('You cannot tick "%s" as it is not a checkbox (%s).', $this->name, $this->type));
85
+
thrownew \LogicException(\sprintf('You cannot tick "%s" as it is not a checkbox (%s).', $this->name, $this->type));
86
86
}
87
87
88
88
$this->setValue(true);
@@ -98,7 +98,7 @@ public function tick()
98
98
publicfunctionuntick()
99
99
{
100
100
if ('checkbox' !== $this->type) {
101
-
thrownew \LogicException(sprintf('You cannot untick "%s" as it is not a checkbox (%s).', $this->name, $this->type));
101
+
thrownew \LogicException(\sprintf('You cannot untick "%s" as it is not a checkbox (%s).', $this->name, $this->type));
102
102
}
103
103
104
104
$this->setValue(false);
@@ -122,16 +122,16 @@ public function setValue(string|array|bool|null $value)
122
122
} else {
123
123
if (\is_array($value)) {
124
124
if (!$this->multiple) {
125
-
thrownew \InvalidArgumentException(sprintf('The value for "%s" cannot be an array.', $this->name));
125
+
thrownew \InvalidArgumentException(\sprintf('The value for "%s" cannot be an array.', $this->name));
126
126
}
127
127
128
128
foreach ($valueas$v) {
129
129
if (!$this->containsOption($v, $this->options)) {
130
-
thrownew \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: "%s").', $this->name, $v, implode('", "', $this->availableOptionValues())));
130
+
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())));
134
+
thrownew \InvalidArgumentException(\sprintf('Input "%s" cannot take "%s" as a value (possible values: "%s").', $this->name, $value, implode('", "', $this->availableOptionValues())));
135
135
}
136
136
137
137
if ($this->multiple) {
@@ -156,7 +156,7 @@ public function setValue(string|array|bool|null $value)
156
156
publicfunctionaddChoice(\DOMElement$node): void
157
157
{
158
158
if (!$this->multiple && 'radio' !== $this->type) {
159
-
thrownew \LogicException(sprintf('Unable to add a choice for "%s" as it is not multiple or is not a radio button.', $this->name));
159
+
thrownew \LogicException(\sprintf('Unable to add a choice for "%s" as it is not multiple or is not a radio button.', $this->name));
160
160
}
161
161
162
162
$option = $this->buildOptionValue($node);
@@ -193,11 +193,11 @@ public function isMultiple(): bool
193
193
protectedfunctioninitialize()
194
194
{
195
195
if ('input' !== $this->node->nodeName && 'select' !== $this->node->nodeName) {
196
-
thrownew \LogicException(sprintf('A ChoiceFormField can only be created from an input or select tag (%s given).', $this->node->nodeName));
196
+
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')));
200
+
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')));
@@ -100,11 +100,11 @@ public function setFilePath(string $path)
100
100
protectedfunctioninitialize()
101
101
{
102
102
if ('input' !== $this->node->nodeName) {
103
-
thrownew \LogicException(sprintf('A FileFormField can only be created from an input tag (%s given).', $this->node->nodeName));
103
+
thrownew \LogicException(\sprintf('A FileFormField can only be created from an input tag (%s given).', $this->node->nodeName));
104
104
}
105
105
106
106
if ('file' !== strtolower($this->node->getAttribute('type'))) {
107
-
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')));
107
+
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