aboutsummaryrefslogtreecommitdiff
path: root/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy
diff options
context:
space:
mode:
Diffstat (limited to 'srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy')
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/Instantiator/InstantiatorInterface.php34
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/Instantiator/RealServiceInstantiator.php33
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/PhpDumper/DumperInterface.php46
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/PhpDumper/NullDumper.php48
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/ProxyHelper.php56
5 files changed, 217 insertions, 0 deletions
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/Instantiator/InstantiatorInterface.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/Instantiator/InstantiatorInterface.php
new file mode 100644
index 0000000..96104e4
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/Instantiator/InstantiatorInterface.php
@@ -0,0 +1,34 @@
+<?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\LazyProxy\Instantiator;
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\Definition;
+
+/**
+ * Lazy proxy instantiator, capable of instantiating a proxy given a container, the
+ * service definitions and a callback that produces the real service instance.
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+interface InstantiatorInterface
+{
+ /**
+ * Instantiates a proxy object.
+ *
+ * @param string $id Identifier of the requested service
+ * @param callable $realInstantiator Zero-argument callback that is capable of producing the real service instance
+ *
+ * @return object
+ */
+ public function instantiateProxy(ContainerInterface $container, Definition $definition, $id, $realInstantiator);
+}
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/Instantiator/RealServiceInstantiator.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/Instantiator/RealServiceInstantiator.php
new file mode 100644
index 0000000..2e36704
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/Instantiator/RealServiceInstantiator.php
@@ -0,0 +1,33 @@
+<?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\LazyProxy\Instantiator;
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\Definition;
+
+/**
+ * {@inheritdoc}
+ *
+ * Noop proxy instantiator - produces the real service instead of a proxy instance.
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+class RealServiceInstantiator implements InstantiatorInterface
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function instantiateProxy(ContainerInterface $container, Definition $definition, $id, $realInstantiator)
+ {
+ return $realInstantiator();
+ }
+}
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/PhpDumper/DumperInterface.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/PhpDumper/DumperInterface.php
new file mode 100644
index 0000000..f592e6c
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/PhpDumper/DumperInterface.php
@@ -0,0 +1,46 @@
+<?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\LazyProxy\PhpDumper;
+
+use Symfony\Component\DependencyInjection\Definition;
+
+/**
+ * Lazy proxy dumper capable of generating the instantiation logic PHP code for proxied services.
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+interface DumperInterface
+{
+ /**
+ * Inspects whether the given definitions should produce proxy instantiation logic in the dumped container.
+ *
+ * @return bool
+ */
+ public function isProxyCandidate(Definition $definition);
+
+ /**
+ * Generates the code to be used to instantiate a proxy in the dumped factory code.
+ *
+ * @param string $id Service identifier
+ * @param string $factoryCode The code to execute to create the service
+ *
+ * @return string
+ */
+ public function getProxyFactoryCode(Definition $definition, $id, $factoryCode);
+
+ /**
+ * Generates the code for the lazy proxy.
+ *
+ * @return string
+ */
+ public function getProxyCode(Definition $definition);
+}
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/PhpDumper/NullDumper.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/PhpDumper/NullDumper.php
new file mode 100644
index 0000000..ebc6a5d
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/PhpDumper/NullDumper.php
@@ -0,0 +1,48 @@
+<?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\LazyProxy\PhpDumper;
+
+use Symfony\Component\DependencyInjection\Definition;
+
+/**
+ * Null dumper, negates any proxy code generation for any given service definition.
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ *
+ * @final
+ */
+class NullDumper implements DumperInterface
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function isProxyCandidate(Definition $definition): bool
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getProxyFactoryCode(Definition $definition, $id, $factoryCode = null): string
+ {
+ return '';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getProxyCode(Definition $definition): string
+ {
+ return '';
+ }
+}
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/ProxyHelper.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/ProxyHelper.php
new file mode 100644
index 0000000..e5611bc
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/LazyProxy/ProxyHelper.php
@@ -0,0 +1,56 @@
+<?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\LazyProxy;
+
+/**
+ * @author Nicolas Grekas <p@tchwork.com>
+ *
+ * @internal
+ */
+class ProxyHelper
+{
+ /**
+ * @return string|null The FQCN or builtin name of the type hint, or null when the type hint references an invalid self|parent context
+ */
+ public static function getTypeHint(\ReflectionFunctionAbstract $r, \ReflectionParameter $p = null, bool $noBuiltin = false): ?string
+ {
+ if ($p instanceof \ReflectionParameter) {
+ $type = $p->getType();
+ } else {
+ $type = $r->getReturnType();
+ }
+ if (!$type) {
+ return null;
+ }
+ if (!\is_string($type)) {
+ $name = $type->getName();
+
+ if ($type->isBuiltin()) {
+ return $noBuiltin ? null : $name;
+ }
+ }
+ $lcName = strtolower($name);
+ $prefix = $noBuiltin ? '' : '\\';
+
+ if ('self' !== $lcName && 'parent' !== $lcName) {
+ return $prefix.$name;
+ }
+ if (!$r instanceof \ReflectionMethod) {
+ return null;
+ }
+ if ('self' === $lcName) {
+ return $prefix.$r->getDeclaringClass()->name;
+ }
+
+ return ($parent = $r->getDeclaringClass()->getParentClass()) ? $prefix.$parent->name : null;
+ }
+}