Skip to content

Commit 7ac0cd5

Browse files
committed
Merge branch '5.0'
* 5.0: Fix quotes in exception messages Fix quotes in exception messages Fix quotes in exception messages Fix quotes in exception messages Fix quotes in exception messages
2 parents e4e7450 + f009ea8 commit 7ac0cd5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

AbstractUriElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct(\DOMElement $node, string $currentUri = null, ?strin
4949
$elementUriIsRelative = null === parse_url(trim($this->getRawUri()), PHP_URL_SCHEME);
5050
$baseUriIsAbsolute = \in_array(strtolower(substr($this->currentUri, 0, 4)), ['http', 'file']);
5151
if ($elementUriIsRelative && !$baseUriIsAbsolute) {
52-
throw new \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+
throw new \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));
5353
}
5454
}
5555

Field/ChoiceFormField.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ public function setValue($value)
133133

134134
foreach ($value as $v) {
135135
if (!$this->containsOption($v, $this->options)) {
136-
throw new \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: %s).', $this->name, $v, implode(', ', $this->availableOptionValues())));
136+
throw new \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: "%s").', $this->name, $v, implode('", "', $this->availableOptionValues())));
137137
}
138138
}
139139
} elseif (!$this->containsOption($value, $this->options)) {
140-
throw new \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: %s).', $this->name, $value, implode(', ', $this->availableOptionValues())));
140+
throw new \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: "%s").', $this->name, $value, implode('", "', $this->availableOptionValues())));
141141
}
142142

143143
if ($this->multiple) {
@@ -205,7 +205,7 @@ protected function initialize()
205205
}
206206

207207
if ('input' === $this->node->nodeName && 'checkbox' !== strtolower($this->node->getAttribute('type')) && 'radio' !== strtolower($this->node->getAttribute('type'))) {
208-
throw new \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')));
208+
throw new \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')));
209209
}
210210

211211
$this->value = null;

Field/FileFormField.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function setErrorCode(int $error)
2929
{
3030
$codes = [UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE, UPLOAD_ERR_PARTIAL, UPLOAD_ERR_NO_FILE, UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_CANT_WRITE, UPLOAD_ERR_EXTENSION];
3131
if (!\in_array($error, $codes)) {
32-
throw new \InvalidArgumentException(sprintf('The error code %s is not valid.', $error));
32+
throw new \InvalidArgumentException(sprintf('The error code "%s" is not valid.', $error));
3333
}
3434

3535
$this->value = ['name' => '', 'type' => '', 'tmp_name' => '', 'error' => $error, 'size' => 0];
@@ -94,7 +94,7 @@ protected function initialize()
9494
}
9595

9696
if ('file' !== strtolower($this->node->getAttribute('type'))) {
97-
throw new \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+
throw new \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')));
9898
}
9999

100100
$this->setValue(null);

0 commit comments

Comments
 (0)