Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 65a9888

Browse files
Merge branch '5.0'
* 5.0: Fix CS
2 parents 2df13e1 + af04885 commit 65a9888

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
@@ -228,11 +228,7 @@ protected function assertValidMappingConfiguration(array $mappingConfig, string
228228
}
229229

230230
if (!\in_array($mappingConfig['type'], ['xml', 'yml', 'annotation', 'php', 'staticphp'])) {
231-
throw new \InvalidArgumentException(sprintf('Can only configure "xml", "yml", "annotation", "php" or '.
232-
'"staticphp" through the DoctrineBundle. Use your own bundle to configure other metadata drivers. '.
233-
'You can register them by adding a new driver to the '.
234-
'"%s" service definition.', $this->getObjectManagerElementName($objectManagerName.'_metadata_driver')
235-
));
231+
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')));
236232
}
237233
}
238234

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,7 @@ public function refreshUser(UserInterface $user)
8787
// That's the case when the user has been changed by a form with
8888
// validation errors.
8989
if (!$id = $this->getClassMetadata()->getIdentifierValues($user)) {
90-
throw new \InvalidArgumentException('You cannot refresh a user '.
91-
'from the EntityUserProvider that does not contain an identifier. '.
92-
'The user object has to be serialized with its own identifier '.
93-
'mapped by Doctrine.'
94-
);
90+
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.');
9591
}
9692

9793
$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
@@ -50,21 +50,10 @@ public function process(ContainerBuilder $container)
5050
}
5151
if (class_exists($id) || interface_exists($id, false)) {
5252
if (0 === strpos($id, '\\') && 1 < substr_count($id, '\\')) {
53-
throw new RuntimeException(sprintf(
54-
'The definition for "%s" has no class attribute, and appears to reference a class or interface. '
55-
.'Please specify the class attribute explicitly or remove the leading backslash by renaming '
56-
.'the service to "%s" to get rid of this error.',
57-
$id, substr($id, 1)
58-
));
53+
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)));
5954
}
6055

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

7059
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
@@ -94,13 +94,7 @@ public function denormalize($data, string $type, string $format = null, array $c
9494

9595
$dateTimeErrors = \DateTime::class === $type ? \DateTime::getLastErrors() : \DateTimeImmutable::getLastErrors();
9696

97-
throw new NotNormalizableValueException(sprintf(
98-
'Parsing datetime string "%s" using format "%s" resulted in %d errors:'."\n".'%s',
99-
$data,
100-
$dateTimeFormat,
101-
$dateTimeErrors['error_count'],
102-
implode("\n", $this->formatDateTimeErrors($dateTimeErrors['errors']))
103-
));
97+
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']))));
10498
}
10599

106100
try {

0 commit comments

Comments
 (0)