Skip to content

Commit ceacdab

Browse files
committed
Fix quotes in exception messages
1 parent 592df3f commit ceacdab

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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($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];
@@ -100,7 +100,7 @@ protected function initialize()
100100
}
101101

102102
if ('file' !== strtolower($this->node->getAttribute('type'))) {
103-
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')));
103+
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')));
104104
}
105105

106106
$this->setValue(null);

0 commit comments

Comments
 (0)