aboutsummaryrefslogtreecommitdiff
path: root/srcs/phpmyadmin/vendor/symfony/dependency-injection/Compiler/ResolveClassPass.php
diff options
context:
space:
mode:
Diffstat (limited to 'srcs/phpmyadmin/vendor/symfony/dependency-injection/Compiler/ResolveClassPass.php')
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/Compiler/ResolveClassPass.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/Compiler/ResolveClassPass.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Compiler/ResolveClassPass.php
new file mode 100644
index 0000000..5932472
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Compiler/ResolveClassPass.php
@@ -0,0 +1,40 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\DependencyInjection\Compiler;
+
+use Symfony\Component\DependencyInjection\ChildDefinition;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
+
+/**
+ * @author Nicolas Grekas <p@tchwork.com>
+ */
+class ResolveClassPass implements CompilerPassInterface
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function process(ContainerBuilder $container)
+ {
+ foreach ($container->getDefinitions() as $id => $definition) {
+ if ($definition->isSynthetic() || null !== $definition->getClass()) {
+ continue;
+ }
+ if (preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\\\\[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)++$/', $id)) {
+ if ($definition instanceof ChildDefinition && !class_exists($id)) {
+ throw new InvalidArgumentException(sprintf('Service definition "%s" has a parent but no class, and its name looks like a FQCN. Either the class is missing or you want to inherit it from the parent service. To resolve this ambiguity, please rename this service to a non-FQCN (e.g. using dots), or create the missing class.', $id));
+ }
+ $definition->setClass($id);
+ }
+ }
+ }
+}