8000 Merge branch '3.4' into 4.3 · symfony/symfony@5da657b · GitHub
[go: up one dir, main page]

Skip to content

Commit 5da657b

Browse files
Merge branch '3.4' into 4.3
* 3.4: Fix CS
2 parents 7f2d9c2 + c90cf33 commit 5da657b

File tree

5 files changed

+6
-37
lines changed

5 files changed

+6
-37
lines changed

src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,7 @@ protected function assertValidMappingConfiguration(array $mappingConfig, $object
239239
}
240240

241241
if (!\in_array($mappingConfig['type'], ['xml', 'yml', 'annotation', 'php', 'staticphp'])) {
242-
throw new \InvalidArgumentException(sprintf('Can only configure "xml", "yml", "annotation", "php" or '.
243-
'"staticphp" through the DoctrineBundle. Use your own bundle to configure other metadata drivers. '.
244-
'You can register them by adding a new driver to the '.
245-
'"%s" service definition.', $this->getObjectManagerElementName($objectManagerName.'_metadata_driver')
246-
));
242+
throw new \InvalidArgumentException(sprintf('Can only configure "xml", "yml", "annotation", "php" or "staticphp" through the DoctrineBundle. Use your own bundle to configure other metadata drivers. You can register them by adding a new driver to the "%s" service definition.', $this->getObjectManagerElementName($objectManagerName.'_metadata_driver')));
247243
}
248244
}
249245

src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,7 @@ public function refreshUser(UserInterface $user)
8383
// That's the case when the user has been changed by a form with
8484
// validation errors.
8585
if (!$id = $this->getClassMetadata()->getIdentifierValues($user)) {
86-
throw new \InvalidArgumentException('You cannot refresh a user '.
87-
'from the EntityUserProvider that does not contain an identifier. '.
88-
'The user object has to be serialized with its own identifier '.
89-
'mapped by Doctrine.'
90-
);
86+
throw new \InvalidArgumentException('You cannot refresh a user from the EntityUserProvider that does not contain an identifier. The user object has to be serialized with its own identifier mapped by Doctrine.');
9187
}
9288

9389
$refreshedUser = $repository->find($id);

src/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,10 @@ public function process(ContainerBuilder $container)
4949
}
5050
if (class_exists($id) || interface_exists($id, false)) {
5151
if (0 === strpos($id, '\\') && 1 < substr_count($id, '\\')) {
52-
throw new RuntimeException(sprintf(
53-
'The definition for "%s" has no class attribute, and appears to reference a class or interface. '
54-
.'Please specify the class attribute explicitly or remove the leading backslash by renaming '
55-
.'the service to "%s" to get rid of this error.',
56-
$id, substr($id, 1)
57-
));
52+
throw new RuntimeException(sprintf('The definition for "%s" has no class attribute, and appears to reference a class or interface. Please specify the class attribute explicitly or remove the leading backslash by renaming the service to "%s" to get rid of this error.', $id, substr($id, 1)));
5853
}
5954

60-
throw new RuntimeException(sprintf(
61-
'The definition for "%s" has no class attribute, and appears to reference a '
62-
.'class or interface in the global namespace. Leaving out the "class" attribute '
63-
.'is only allowed for namespaced classes. Please specify the class attribute '
64-
.'explicitly to get rid of this error.',
65-
$id
66-
));
55+
throw new RuntimeException(sprintf('The definition for "%s" has no class attribute, and appears to reference a class or interface in the global namespace. Leaving out the "class" attribute is only allowed for namespaced classes. Please specify the class attribute explicitly to get rid of this error.', $id));
6756
}
6857

6958
throw new RuntimeException(sprintf('The definition for "%s" has no class. If you intend to inject this service dynamically at runtime, please mark it as synthetic=true. If this is an abstract definition solely used by child definitions, please add abstract=true, otherwise specify a class to get rid of this error.', $id));

src/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,7 @@ final public function extension(string $namespace, array $config)
4848
{
4949
if (!$this->container->hasExtension($namespace)) {
5050
$extensions = array_filter(array_map(function (ExtensionInterface $ext) { return $ext->getAlias(); }, $this->container->getExtensions()));
51-
throw new InvalidArgumentException(sprintf(
52-
'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s',
53-
$namespace,
54-
$this->file,
55-
$namespace,
56-
$extensions ? sprintf('"%s"', implode('", "', $extensions)) : 'none'
57-
));
51+
throw new InvalidArgumentException(sprintf('There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s', $namespace, $this->file, $namespace, $extensions ? sprintf('"%s"', implode('", "', $extensions)) : 'none'));
5852
}
5953

6054
$this->container->loadFromExtension($namespace, static::processValue($config));

src/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,7 @@ public function denormalize($data, $type, $format = null, array $context = [])
106106

107107
$dateTimeErrors = \DateTime::class === $type ? \DateTime::getLastErrors() : \DateTimeImmutable::getLastErrors();
108108

109-
throw new NotNormalizableValueException(sprintf(
110-
'Parsing datetime string "%s" using format "%s" resulted in %d errors:'."\n".'%s',
111-
$data,
112-
$dateTimeFormat,
113-
$dateTimeErrors['error_count'],
114-
implode("\n", $this->formatDateTimeErrors($dateTimeErrors['errors']))
115-
));
109+
throw new NotNormalizableValueException(sprintf('Parsing datetime string "%s" using format "%s" resulted in %d errors:'."\n".'%s', $data, $dateTimeFormat, $dateTimeErrors['error_count'], implode("\n", $this->formatDateTimeErrors($dateTimeErrors['errors']))));
116110
}
117111

118112
try {

0 commit comments

Comments
 (0)
0