Skip to content

Commit 4bf9caf

Browse files
Merge branch '3.4' into 4.3
* 3.4: Fix CS
2 parents 4169e62 + 6ba9d4c commit 4bf9caf

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

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));

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));

0 commit comments

Comments
 (0)