Skip to content

Commit 90ce15b

Browse files
committed
Add missing dots at the end of exception messages
1 parent b8ec858 commit 90ce15b

18 files changed

+39
-39
lines changed

AbstractExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getType($name)
5757
}
5858

5959
if (!isset($this->types[$name])) {
60-
throw new InvalidArgumentException(sprintf('The type "%s" can not be loaded by this extension', $name));
60+
throw new InvalidArgumentException(sprintf('The type "%s" can not be loaded by this extension.', $name));
6161
}
6262

6363
return $this->types[$name];

Button.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function offsetUnset($offset)
105105
public function setParent(FormInterface $parent = null)
106106
{
107107
if ($this->submitted) {
108-
throw new AlreadySubmittedException('You cannot set the parent of a submitted button');
108+
throw new AlreadySubmittedException('You cannot set the parent of a submitted button.');
109109
}
110110

111111
$this->parent = $parent;
@@ -381,7 +381,7 @@ public function handleRequest($request = null)
381381
public function submit($submittedData, $clearMissing = true)
382382
{
383383
if ($this->submitted) {
384-
throw new AlreadySubmittedException('A form can only be submitted once');
384+
throw new AlreadySubmittedException('A form can only be submitted once.');
385385
}
386386

387387
$this->submitted = true;

Command/DebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ private function getFqcnTypeClass(InputInterface $input, SymfonyStyle $io, $shor
166166
return $classes[0];
167167
}
168168
if (!$input->isInteractive()) {
169-
throw new InvalidArgumentException(sprintf("The type \"%s\" is ambiguous.\n\nDid you mean one of these?\n %s", $shortClassName, implode("\n ", $classes)));
169+
throw new InvalidArgumentException(sprintf("The type \"%s\" is ambiguous.\n\nDid you mean one of these?\n %s.", $shortClassName, implode("\n ", $classes)));
170170
}
171171

172172
return $io->choice(sprintf("The type \"%s\" is ambiguous.\n\nSelect one of the following form types to display its information:", $shortClassName), $classes, $classes[0]);

Extension/Core/DataTransformer/ArrayToPartsTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function reverseTransform($array)
7676
return null;
7777
}
7878

79-
throw new TransformationFailedException(sprintf('The keys "%s" should not be empty', implode('", "', $emptyKeys)));
79+
throw new TransformationFailedException(sprintf('The keys "%s" should not be empty.', implode('", "', $emptyKeys)));
8080
}
8181

8282
return $result;

Extension/Core/DataTransformer/ChoiceToValueTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function reverseTransform($value)
4545
return null;
4646
}
4747

48-
throw new TransformationFailedException(sprintf('The choice "%s" does not exist or is not unique', $value));
48+
throw new TransformationFailedException(sprintf('The choice "%s" does not exist or is not unique.', $value));
4949
}
5050

5151
return current($choices);

Extension/Core/DataTransformer/ChoicesToValuesTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function reverseTransform($array)
6565
$choices = $this->choiceList->getChoicesForValues($array);
6666

6767
if (\count($choices) !== \count($array)) {
68-
throw new TransformationFailedException('Could not find all matching choices for the given values');
68+
throw new TransformationFailedException('Could not find all matching choices for the given values.');
6969
}
7070

7171
return $choices;

Extension/Core/DataTransformer/DateIntervalToArrayTransformer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ public function reverseTransform($value)
129129
}
130130
}
131131
if (\count($emptyFields) > 0) {
132-
throw new TransformationFailedException(sprintf('The fields "%s" should not be empty', implode('", "', $emptyFields)));
132+
throw new TransformationFailedException(sprintf('The fields "%s" should not be empty.', implode('", "', $emptyFields)));
133133
}
134134
if (isset($value['invert']) && !\is_bool($value['invert'])) {
135-
throw new TransformationFailedException('The value of "invert" must be boolean');
135+
throw new TransformationFailedException('The value of "invert" must be boolean.');
136136
}
137137
foreach (self::$availableFields as $field => $char) {
138138
if ('invert' !== $field && isset($value[$field]) && !ctype_digit((string) $value[$field])) {
139-
throw new TransformationFailedException(sprintf('This amount of "%s" is invalid', $field));
139+
throw new TransformationFailedException(sprintf('This amount of "%s" is invalid.', $field));
140140
}
141141
}
142142
try {

Extension/Core/DataTransformer/DateIntervalToStringTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function reverseTransform($value)
7979
return null;
8080
}
8181
if (!$this->isISO8601($value)) {
82-
throw new TransformationFailedException('Non ISO 8601 date strings are not supported yet');
82+
throw new TransformationFailedException('Non ISO 8601 date strings are not supported yet.');
8383
}
8484
$valuePattern = '/^'.preg_replace('/%([yYmMdDhHiIsSwW])(\w)/', '(?P<$1>\d+)$2', $this->format).'$/';
8585
if (!preg_match($valuePattern, $value)) {

Extension/Core/DataTransformer/DateTimeToArrayTransformer.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,35 +134,35 @@ public function reverseTransform($value)
134134
}
135135

136136
if (\count($emptyFields) > 0) {
137-
throw new TransformationFailedException(sprintf('The fields "%s" should not be empty', implode('", "', $emptyFields)));
137+
throw new TransformationFailedException(sprintf('The fields "%s" should not be empty.', implode('", "', $emptyFields)));
138138
}
139139

140140
if (isset($value['month']) && !ctype_digit((string) $value['month'])) {
141-
throw new TransformationFailedException('This month is invalid');
141+
throw new TransformationFailedException('This month is invalid.');
142142
}
143143

144144
if (isset($value['day']) && !ctype_digit((string) $value['day'])) {
145-
throw new TransformationFailedException('This day is invalid');
145+
throw new TransformationFailedException('This day is invalid.');
146146
}
147147

148148
if (isset($value['year']) && !ctype_digit((string) $value['year'])) {
149-
throw new TransformationFailedException('This year is invalid');
149+
throw new TransformationFailedException('This year is invalid.');
150150
}
151151

152152
if (!empty($value['month']) && !empty($value['day']) && !empty($value['year']) && false === checkdate($value['month'], $value['day'], $value['year'])) {
153-
throw new TransformationFailedException('This is an invalid date');
153+
throw new TransformationFailedException('This is an invalid date.');
154154
}
155155

156156
if (isset($value['hour']) && !ctype_digit((string) $value['hour'])) {
157-
throw new TransformationFailedException('This hour is invalid');
157+
throw new TransformationFailedException('This hour is invalid.');
158158
}
159159

160160
if (isset($value['minute']) && !ctype_digit((string) $value['minute'])) {
161-
throw new TransformationFailedException('This minute is invalid');
161+
throw new TransformationFailedException('This minute is invalid.');
162162
}
163163

164164
if (isset($value['second']) && !ctype_digit((string) $value['second'])) {
165-
throw new TransformationFailedException('This second is invalid');
165+
throw new TransformationFailedException('This second is invalid.');
166166
}
167167

168168
try {

Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function reverseTransform($value)
152152
}
153153

154154
if (\in_array($value, ['NaN', 'NAN', 'nan'], true)) {
155-
throw new TransformationFailedException('"NaN" is not a valid number');
155+
throw new TransformationFailedException('"NaN" is not a valid number.');
156156
}
157157

158158
$position = 0;
@@ -183,7 +183,7 @@ public function reverseTransform($value)
183183
}
184184

185185
if ($result >= PHP_INT_MAX || $result <= -PHP_INT_MAX) {
186-
throw new TransformationFailedException('I don\'t have a clear idea what infinity looks like');
186+
throw new TransformationFailedException('I don\'t have a clear idea what infinity looks like.');
187187
}
188188

189189
$result = $this->castParsedValue($result);
@@ -204,7 +204,7 @@ public function reverseTransform($value)
204204
$remainder = trim($remainder, " \t\n\r\0\x0b\xc2\xa0");
205205

206206
if ('' !== $remainder) {
207-
throw new TransformationFailedException(sprintf('The number contains unrecognized characters: "%s"', $remainder));
207+
throw new TransformationFailedException(sprintf('The number contains unrecognized characters: "%s".', $remainder));
208208
}
209209
}
210210

0 commit comments

Comments
 (0)