aboutsummaryrefslogtreecommitdiff
path: root/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-09 10:55:03 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-09 13:09:38 +0100
commit04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa (patch)
tree5c691241355c943a3c68ddb06b8cf8c60aa11319 /srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument
parent7e0d85db834d6351ed85d01e5126ac31dc510b86 (diff)
downloadft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.tar.gz
ft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.tar.bz2
ft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.zip
phpmyadmin working
Diffstat (limited to 'srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument')
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ArgumentInterface.php27
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/BoundArgument.php62
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/IteratorArgument.php22
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ReferenceSetArgumentTrait.php54
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/RewindableGenerator.php46
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ServiceClosureArgument.php50
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ServiceLocator.php50
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ServiceLocatorArgument.php44
-rw-r--r--srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/TaggedIteratorArgument.php73
9 files changed, 428 insertions, 0 deletions
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ArgumentInterface.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ArgumentInterface.php
new file mode 100644
index 0000000..b46eb77
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ArgumentInterface.php
@@ -0,0 +1,27 @@
+<?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\Argument;
+
+/**
+ * Represents a complex argument containing nested values.
+ *
+ * @author Titouan Galopin <galopintitouan@gmail.com>
+ */
+interface ArgumentInterface
+{
+ /**
+ * @return array
+ */
+ public function getValues();
+
+ public function setValues(array $values);
+}
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/BoundArgument.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/BoundArgument.php
new file mode 100644
index 0000000..6005926
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/BoundArgument.php
@@ -0,0 +1,62 @@
+<?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\Argument;
+
+/**
+ * @author Guilhem Niot <guilhem.niot@gmail.com>
+ */
+final class BoundArgument implements ArgumentInterface
+{
+ const SERVICE_BINDING = 0;
+ const DEFAULTS_BINDING = 1;
+ const INSTANCEOF_BINDING = 2;
+
+ private static $sequence = 0;
+
+ private $value;
+ private $identifier;
+ private $used;
+ private $type;
+ private $file;
+
+ public function __construct($value, bool $trackUsage = true, int $type = 0, string $file = null)
+ {
+ $this->value = $value;
+ if ($trackUsage) {
+ $this->identifier = ++self::$sequence;
+ } else {
+ $this->used = true;
+ }
+ $this->type = $type;
+ $this->file = $file;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getValues(): array
+ {
+ return [$this->value, $this->identifier, $this->used, $this->type, $this->file];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setValues(array $values)
+ {
+ if (5 === \count($values)) {
+ list($this->value, $this->identifier, $this->used, $this->type, $this->file) = $values;
+ } else {
+ list($this->value, $this->identifier, $this->used) = $values;
+ }
+ }
+}
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/IteratorArgument.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/IteratorArgument.php
new file mode 100644
index 0000000..d413678
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/IteratorArgument.php
@@ -0,0 +1,22 @@
+<?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\Argument;
+
+/**
+ * Represents a collection of values to lazily iterate over.
+ *
+ * @author Titouan Galopin <galopintitouan@gmail.com>
+ */
+class IteratorArgument implements ArgumentInterface
+{
+ use ReferenceSetArgumentTrait;
+}
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ReferenceSetArgumentTrait.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ReferenceSetArgumentTrait.php
new file mode 100644
index 0000000..6f8d5d9
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ReferenceSetArgumentTrait.php
@@ -0,0 +1,54 @@
+<?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\Argument;
+
+use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
+use Symfony\Component\DependencyInjection\Reference;
+
+/**
+ * @author Titouan Galopin <galopintitouan@gmail.com>
+ * @author Nicolas Grekas <p@tchwork.com>
+ */
+trait ReferenceSetArgumentTrait
+{
+ private $values;
+
+ /**
+ * @param Reference[] $values
+ */
+ public function __construct(array $values)
+ {
+ $this->setValues($values);
+ }
+
+ /**
+ * @return Reference[] The values in the set
+ */
+ public function getValues()
+ {
+ return $this->values;
+ }
+
+ /**
+ * @param Reference[] $values The service references to put in the set
+ */
+ public function setValues(array $values)
+ {
+ foreach ($values as $k => $v) {
+ if (null !== $v && !$v instanceof Reference) {
+ throw new InvalidArgumentException(sprintf('A %s must hold only Reference instances, "%s" given.', __CLASS__, \is_object($v) ? \get_class($v) : \gettype($v)));
+ }
+ }
+
+ $this->values = $values;
+ }
+}
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/RewindableGenerator.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/RewindableGenerator.php
new file mode 100644
index 0000000..41fec78
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/RewindableGenerator.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\Argument;
+
+/**
+ * @internal
+ */
+class RewindableGenerator implements \IteratorAggregate, \Countable
+{
+ private $generator;
+ private $count;
+
+ /**
+ * @param int|callable $count
+ */
+ public function __construct(callable $generator, $count)
+ {
+ $this->generator = $generator;
+ $this->count = $count;
+ }
+
+ public function getIterator(): \Traversable
+ {
+ $g = $this->generator;
+
+ return $g();
+ }
+
+ public function count(): int
+ {
+ if (\is_callable($count = $this->count)) {
+ $this->count = $count();
+ }
+
+ return $this->count;
+ }
+}
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ServiceClosureArgument.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ServiceClosureArgument.php
new file mode 100644
index 0000000..6331aff
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ServiceClosureArgument.php
@@ -0,0 +1,50 @@
+<?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\Argument;
+
+use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
+use Symfony\Component\DependencyInjection\Reference;
+
+/**
+ * Represents a service wrapped in a memoizing closure.
+ *
+ * @author Nicolas Grekas <p@tchwork.com>
+ */
+class ServiceClosureArgument implements ArgumentInterface
+{
+ private $values;
+
+ public function __construct(Reference $reference)
+ {
+ $this->values = [$reference];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getValues()
+ {
+ return $this->values;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setValues(array $values)
+ {
+ if ([0] !== array_keys($values) || !($values[0] instanceof Reference || null === $values[0])) {
+ throw new InvalidArgumentException('A ServiceClosureArgument must hold one and only one Reference.');
+ }
+
+ $this->values = $values;
+ }
+}
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ServiceLocator.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ServiceLocator.php
new file mode 100644
index 0000000..2001a95
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ServiceLocator.php
@@ -0,0 +1,50 @@
+<?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\Argument;
+
+use Symfony\Component\DependencyInjection\ServiceLocator as BaseServiceLocator;
+
+/**
+ * @author Nicolas Grekas <p@tchwork.com>
+ *
+ * @internal
+ */
+class ServiceLocator extends BaseServiceLocator
+{
+ private $factory;
+ private $serviceMap;
+ private $serviceTypes;
+
+ public function __construct(\Closure $factory, array $serviceMap, array $serviceTypes = null)
+ {
+ $this->factory = $factory;
+ $this->serviceMap = $serviceMap;
+ $this->serviceTypes = $serviceTypes;
+ parent::__construct($serviceMap);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get($id)
+ {
+ return isset($this->serviceMap[$id]) ? ($this->factory)(...$this->serviceMap[$id]) : parent::get($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getProvidedServices(): array
+ {
+ return $this->serviceTypes ?? $this->serviceTypes = array_map(function () { return '?'; }, $this->serviceMap);
+ }
+}
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ServiceLocatorArgument.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ServiceLocatorArgument.php
new file mode 100644
index 0000000..fcbf478
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/ServiceLocatorArgument.php
@@ -0,0 +1,44 @@
+<?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\Argument;
+
+use Symfony\Component\DependencyInjection\Reference;
+
+/**
+ * Represents a closure acting as a service locator.
+ *
+ * @author Nicolas Grekas <p@tchwork.com>
+ */
+class ServiceLocatorArgument implements ArgumentInterface
+{
+ use ReferenceSetArgumentTrait;
+
+ private $taggedIteratorArgument;
+
+ /**
+ * @param Reference[]|TaggedIteratorArgument $values
+ */
+ public function __construct($values = [])
+ {
+ if ($values instanceof TaggedIteratorArgument) {
+ $this->taggedIteratorArgument = $values;
+ $this->values = [];
+ } else {
+ $this->setValues($values);
+ }
+ }
+
+ public function getTaggedIteratorArgument(): ?TaggedIteratorArgument
+ {
+ return $this->taggedIteratorArgument;
+ }
+}
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/TaggedIteratorArgument.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/TaggedIteratorArgument.php
new file mode 100644
index 0000000..d1d5f6d
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Argument/TaggedIteratorArgument.php
@@ -0,0 +1,73 @@
+<?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\Argument;
+
+/**
+ * Represents a collection of services found by tag name to lazily iterate over.
+ *
+ * @author Roland Franssen <franssen.roland@gmail.com>
+ */
+class TaggedIteratorArgument extends IteratorArgument
+{
+ private $tag;
+ private $indexAttribute;
+ private $defaultIndexMethod;
+ private $defaultPriorityMethod;
+ private $needsIndexes = false;
+
+ /**
+ * @param string $tag The name of the tag identifying the target services
+ * @param string|null $indexAttribute The name of the attribute that defines the key referencing each service in the tagged collection
+ * @param string|null $defaultIndexMethod The static method that should be called to get each service's key when their tag doesn't define the previous attribute
+ * @param bool $needsIndexes Whether indexes are required and should be generated when computing the map
+ * @param string|null $defaultPriorityMethod The static method that should be called to get each service's priority when their tag doesn't define the "priority" attribute
+ */
+ public function __construct(string $tag, string $indexAttribute = null, string $defaultIndexMethod = null, bool $needsIndexes = false, string $defaultPriorityMethod = null)
+ {
+ parent::__construct([]);
+
+ if (null === $indexAttribute && $needsIndexes) {
+ $indexAttribute = preg_match('/[^.]++$/', $tag, $m) ? $m[0] : $tag;
+ }
+
+ $this->tag = $tag;
+ $this->indexAttribute = $indexAttribute;
+ $this->defaultIndexMethod = $defaultIndexMethod ?: ('getDefault'.str_replace(' ', '', ucwords(preg_replace('/[^a-zA-Z0-9\x7f-\xff]++/', ' ', $indexAttribute ?? ''))).'Name');
+ $this->needsIndexes = $needsIndexes;
+ $this->defaultPriorityMethod = $defaultPriorityMethod ?: ('getDefault'.str_replace(' ', '', ucwords(preg_replace('/[^a-zA-Z0-9\x7f-\xff]++/', ' ', $indexAttribute ?? ''))).'Priority');
+ }
+
+ public function getTag()
+ {
+ return $this->tag;
+ }
+
+ public function getIndexAttribute(): ?string
+ {
+ return $this->indexAttribute;
+ }
+
+ public function getDefaultIndexMethod(): ?string
+ {
+ return $this->defaultIndexMethod;
+ }
+
+ public function needsIndexes(): bool
+ {
+ return $this->needsIndexes;
+ }
+
+ public function getDefaultPriorityMethod(): ?string
+ {
+ return $this->defaultPriorityMethod;
+ }
+}