8000 Merge branch '5.0' · symfony/form@6b86ee4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b86ee4

Browse files
committed
Merge branch '5.0'
* 5.0: Add missing dots at the end of exception messages Add missing dots at the end of exception messages [DI][Form] Fixed test suite (TimeType changes & unresolved merge conflict) Fix bad merge Add missing dots at the end of exception messages
2 parents ba6f827 + 003bfa6 commit 6b86ee4

21 files changed

+43
-43
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(string $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;
@@ -375,7 +375,7 @@ public function handleRequest($request = null)
375375
public function submit($submittedData, bool $clearMissing = true)
376376
{
377377
if ($this->submitted) {
378-
throw new AlreadySubmittedException('A form can only be submitted once');
378+
throw new AlreadySubmittedException('A form can only be submitted once.');
379379
}
380380

381381
$this->submitted = true;

Command/DebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ private function getFqcnTypeClass(InputInterface $input, SymfonyStyle $io, strin
191191
return $classes[0];
192192
}
193193
if (!$input->isInteractive()) {
194-
throw new InvalidArgumentException(sprintf("The type \"%s\" is ambiguous.\n\nDid you mean one of these?\n %s", $shortClassName, implode("\n ", $classes)));
194+
throw new InvalidArgumentException(sprintf("The type \"%s\" is ambiguous.\n\nDid you mean one of these?\n %s.", $shortClassName, implode("\n ", $classes)));
195195
}
196196

197197
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/BooleanToStringTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(string $trueValue, array $falseValues = [null])
3535
$this->trueValue = $trueValue;
3636
$this->falseValues = $falseValues;
3737
if (\in_array($this->trueValue, $this->falseValues, true)) {
38-
throw new InvalidArgumentException('The specified "true" value is contained in the false-values');
38+
throw new InvalidArgumentException('The specified "true" value is contained in the false-values.');
3939
}
4040
}
4141

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
@@ -133,35 +133,35 @@ public function reverseTransform($value)
133133
}
134134

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

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

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

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

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

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

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

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

167167
try {

0 commit comments

Comments
 (0)
0