Skip to content

Commit 0c65764

Browse files
Merge branch '2.8' into 3.4
* 2.8: Consistently throw exceptions on a single line fix fopen calls Update .editorconfig
2 parents 82abe3b + 8421939 commit 0c65764

File tree

4 files changed

+4
-27
lines changed

4 files changed

+4
-27
lines changed

Compiler/CheckDefinitionValidityPass.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,7 @@ public function process(ContainerBuilder $container)
6666
));
6767
}
6868

69-
throw new RuntimeException(sprintf(
70-
'The definition for "%s" has no class. If you intend to inject '
71-
.'this service dynamically at runtime, please mark it as synthetic=true. '
72-
.'If this is an abstract definition solely used by child definitions, '
73-
.'please add abstract=true, otherwise specify a class to get rid of this error.',
74-
$id
75-
));
69+
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));
7670
}
7771

7872
// tag attribute values must be scalars

Compiler/CheckReferenceValidityPass.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ protected function processValue($value, $isRoot = false)
3434
$targetDefinition = $this->container->getDefinition((string) $value);
3535

3636
if ($targetDefinition->isAbstract()) {
37-
throw new RuntimeException(sprintf(
38-
'The definition "%s" has a reference to an abstract definition "%s". '
39-
.'Abstract definitions cannot be the target of references.',
40-
$this->currentId,
41-
$value
42-
));
37+
throw new RuntimeException(sprintf('The definition "%s" has a reference to an abstract definition "%s". Abstract definitions cannot be the target of references.', $this->currentId, $value));
4338
}
4439
}
4540

Loader/XmlFileLoader.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -680,13 +680,7 @@ private function validateExtensions(\DOMDocument $dom, $file)
680680
// can it be handled by an extension?
681681
if (!$this->container->hasExtension($node->namespaceURI)) {
682682
$extensionNamespaces = array_filter(array_map(function ($ext) { return $ext->getNamespace(); }, $this->container->getExtensions()));
683-
throw new InvalidArgumentException(sprintf(
684-
'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s',
685-
$node->tagName,
686-
$file,
687-
$node->namespaceURI,
688-
$extensionNamespaces ? sprintf('"%s"', implode('", "', $extensionNamespaces)) : 'none'
689-
));
683+
throw new InvalidArgumentException(sprintf('There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s', $node->tagName, $file, $node->namespaceURI, $extensionNamespaces ? sprintf('"%s"', implode('", "', $extensionNamespaces)) : 'none'));
690684
}
691685
}
692686
}

Loader/YamlFileLoader.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -701,13 +701,7 @@ private function validate($content, $file)
701701

702702
if (!$this->container->hasExtension($namespace)) {
703703
$extensionNamespaces = array_filter(array_map(function ($ext) { return $ext->getAlias(); }, $this->container->getExtensions()));
704-
throw new InvalidArgumentException(sprintf(
705-
'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s',
706-
$namespace,
707-
$file,
708-
$namespace,
709-
$extensionNamespaces ? sprintf('"%s"', implode('", "', $extensionNamespaces)) : 'none'
710-
));
704+
throw new InvalidArgumentException(sprintf('There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s', $namespace, $file, $namespace, $extensionNamespaces ? sprintf('"%s"', implode('", "', $extensionNamespaces)) : 'none'));
711705
}
712706
}
713707

0 commit comments

Comments
 (0)