Skip to content

Commit ef56b33

Browse files
Merge branch '4.3' into 4.4
* 4.3: Fix CS
2 parents 64d5272 + 4bf9caf commit ef56b33

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

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)