Skip to content

Commit ec1add5

Browse files
committed
Fix quotes in exception messages
1 parent 9d16e5a commit ec1add5

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

Constraints/EmailValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function validate($value, Constraint $constraint)
100100
}
101101

102102
if (!\in_array($constraint->mode, Email::$validationModes, true)) {
103-
throw new \InvalidArgumentException(sprintf('The %s::$mode parameter value is not valid.', \get_class($constraint)));
103+
throw new \InvalidArgumentException(sprintf('The "%s::$mode" parameter value is not valid.', \get_class($constraint)));
104104
}
105105

106106
if (Email::VALIDATION_MODE_STRICT === $constraint->mode) {

Constraints/ExpressionValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(/*ExpressionLanguage */$expressionLanguage = null)
3333
$expressionLanguage = func_get_arg(1);
3434

3535
if (null !== $expressionLanguage && !$expressionLanguage instanceof ExpressionLanguage) {
36-
throw new \TypeError(sprintf('Argument 2 passed to %s() must be an instance of %s or null, %s given. Since 4.4, passing it as the second argument is deprecated and will trigger a deprecation. Pass it as the first argument instead.', __METHOD__, ExpressionLanguage::class, \is_object($expressionLanguage) ? \get_class($expressionLanguage) : \gettype($expressionLanguage)));
36+
throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be an instance of "%s" or null, "%s" given. Since 4.4, passing it as the second argument is deprecated and will trigger a deprecation. Pass it as the first argument instead.', __METHOD__, ExpressionLanguage::class, \is_object($expressionLanguage) ? \get_class($expressionLanguage) : \gettype($expressionLanguage)));
3737
}
3838
} elseif (null !== $expressionLanguage && !$expressionLanguage instanceof ExpressionLanguage) {
3939
@trigger_error(sprintf('The "%s" first argument must be an instance of "%s" or null since 4.4. "%s" given', __METHOD__, ExpressionLanguage::class, \is_object($expressionLanguage) ? \get_class($expressionLanguage) : \gettype($expressionLanguage)), E_USER_DEPRECATED);

Context/ExecutionContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class ExecutionContext implements ExecutionContextInterface
145145
public function __construct(ValidatorInterface $validator, $root, $translator, string $translationDomain = null)
146146
{
147147
if (!$translator instanceof LegacyTranslatorInterface && !$translator instanceof TranslatorInterface) {
148-
throw new \TypeError(sprintf('Argument 3 passed to %s() must be an instance of %s, %s given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator)));
148+
throw new \TypeError(sprintf('Argument 3 passed to "%s()" must be an instance of "%s", "%s" given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator)));
149149
}
150150
$this->validator = $validator;
151151
$this->root = $root;

Context/ExecutionContextFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class ExecutionContextFactory implements ExecutionContextFactoryInterface
3838
public function __construct($translator, string $translationDomain = null)
3939
{
4040
if (!$translator instanceof LegacyTranslatorInterface && !$translator instanceof TranslatorInterface) {
41-
throw new \TypeError(sprintf('Argument 1 passed to %s() must be an instance of %s, %s given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator)));
41+
throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be an instance of "%s", "%s" given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator)));
4242
}
4343

4444
$this->translator = $translator;

Mapping/Factory/LazyLoadingMetadataFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct(LoaderInterface $loader = null, $cache = null)
6060
if ($cache instanceof CacheInterface) {
6161
@trigger_error(sprintf('Passing a "%s" to "%s" is deprecated in Symfony 4.4 and will trigger a TypeError in 5.0. Please pass an implementation of "%s" instead.', \get_class($cache), __METHOD__, CacheItemPoolInterface::class), E_USER_DEPRECATED);
6262
} elseif (!$cache instanceof CacheItemPoolInterface && null !== $cache) {
63-
throw new \TypeError(sprintf('Expected an instance of %s, got %s.', CacheItemPoolInterface::class, \is_object($cache) ? \get_class($cache) : \gettype($cache)));
63+
throw new \TypeError(sprintf('Expected an instance of "%s", got "%s".', CacheItemPoolInterface::class, \is_object($cache) ? \get_class($cache) : \gettype($cache)));
6464
}
6565

6666
$this->loader = $loader;

Tests/Constraints/EmailValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public function testModeLoose()
232232
public function testUnknownModesOnValidateTriggerException()
233233
{
234234
$this->expectException('InvalidArgumentException');
235-
$this->expectExceptionMessage('The Symfony\Component\Validator\Constraints\Email::$mode parameter value is not valid.');
235+
$this->expectExceptionMessage('The "Symfony\Component\Validator\Constraints\Email::$mode" parameter value is not valid.');
236236
$constraint = new Email();
237237
$constraint->mode = 'Unknown Mode';
238238

Violation/ConstraintViolationBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct(ConstraintViolationList $violations, Constraint $con
5555
$message = '';
5656
}
5757
if (!$translator instanceof LegacyTranslatorInterface && !$translator instanceof TranslatorInterface) {
58-
throw new \TypeError(sprintf('Argument 8 passed to %s() must be an instance of %s, %s given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator)));
58+
throw new \TypeError(sprintf('Argument 8 passed to "%s()" must be an instance of "%s", "%s" given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator)));
5959
}
6060
$this->violations = $violations;
6161
$this->message = $message;

0 commit comments

Comments
 (0)