mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 18:29:39 +02:00
Added vendor directory to source control
This commit is contained in:
parent
1c3c7b5c26
commit
aac245d32f
25330 changed files with 3486213 additions and 69 deletions
1
vendor/symfony/options-resolver
vendored
1
vendor/symfony/options-resolver
vendored
|
@ -1 +0,0 @@
|
|||
Subproject commit 4b78e55b179003a42523a362cc0e8327f7a69b5e
|
81
vendor/symfony/options-resolver/CHANGELOG.md
vendored
Normal file
81
vendor/symfony/options-resolver/CHANGELOG.md
vendored
Normal file
|
@ -0,0 +1,81 @@
|
|||
CHANGELOG
|
||||
=========
|
||||
|
||||
5.3
|
||||
---
|
||||
|
||||
* Add prototype definition for nested options
|
||||
|
||||
5.1.0
|
||||
-----
|
||||
|
||||
* added fluent configuration of options using `OptionResolver::define()`
|
||||
* added `setInfo()` and `getInfo()` methods
|
||||
* updated the signature of method `OptionsResolver::setDeprecated()` to `OptionsResolver::setDeprecation(string $option, string $package, string $version, $message)`
|
||||
* deprecated `OptionsResolverIntrospector::getDeprecationMessage()`, use `OptionsResolverIntrospector::getDeprecation()` instead
|
||||
|
||||
5.0.0
|
||||
-----
|
||||
|
||||
* added argument `$triggerDeprecation` to `OptionsResolver::offsetGet()`
|
||||
|
||||
4.3.0
|
||||
-----
|
||||
|
||||
* added `OptionsResolver::addNormalizer` method
|
||||
|
||||
4.2.0
|
||||
-----
|
||||
|
||||
* added support for nested options definition
|
||||
* added `setDeprecated` and `isDeprecated` methods
|
||||
|
||||
3.4.0
|
||||
-----
|
||||
|
||||
* added `OptionsResolverIntrospector` to inspect options definitions inside an `OptionsResolver` instance
|
||||
* added array of types support in allowed types (e.g int[])
|
||||
|
||||
2.6.0
|
||||
-----
|
||||
|
||||
* deprecated OptionsResolverInterface
|
||||
* [BC BREAK] removed "array" type hint from OptionsResolverInterface methods
|
||||
setRequired(), setAllowedValues(), addAllowedValues(), setAllowedTypes() and
|
||||
addAllowedTypes()
|
||||
* added OptionsResolver::setDefault()
|
||||
* added OptionsResolver::hasDefault()
|
||||
* added OptionsResolver::setNormalizer()
|
||||
* added OptionsResolver::isRequired()
|
||||
* added OptionsResolver::getRequiredOptions()
|
||||
* added OptionsResolver::isMissing()
|
||||
* added OptionsResolver::getMissingOptions()
|
||||
* added OptionsResolver::setDefined()
|
||||
* added OptionsResolver::isDefined()
|
||||
* added OptionsResolver::getDefinedOptions()
|
||||
* added OptionsResolver::remove()
|
||||
* added OptionsResolver::clear()
|
||||
* deprecated OptionsResolver::replaceDefaults()
|
||||
* deprecated OptionsResolver::setOptional() in favor of setDefined()
|
||||
* deprecated OptionsResolver::isKnown() in favor of isDefined()
|
||||
* [BC BREAK] OptionsResolver::isRequired() returns true now if a required
|
||||
option has a default value set
|
||||
* [BC BREAK] merged Options into OptionsResolver and turned Options into an
|
||||
interface
|
||||
* deprecated Options::overload() (now in OptionsResolver)
|
||||
* deprecated Options::set() (now in OptionsResolver)
|
||||
* deprecated Options::get() (now in OptionsResolver)
|
||||
* deprecated Options::has() (now in OptionsResolver)
|
||||
* deprecated Options::replace() (now in OptionsResolver)
|
||||
* [BC BREAK] Options::get() (now in OptionsResolver) can only be used within
|
||||
lazy option/normalizer closures now
|
||||
* [BC BREAK] removed Traversable interface from Options since using within
|
||||
lazy option/normalizer closures resulted in exceptions
|
||||
* [BC BREAK] removed Options::all() since using within lazy option/normalizer
|
||||
closures resulted in exceptions
|
||||
* [BC BREAK] OptionDefinitionException now extends LogicException instead of
|
||||
RuntimeException
|
||||
* [BC BREAK] normalizers are not executed anymore for unset options
|
||||
* normalizers are executed after validating the options now
|
||||
* [BC BREAK] an UndefinedOptionsException is now thrown instead of an
|
||||
InvalidOptionsException when non-existing options are passed
|
120
vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php
vendored
Normal file
120
vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php
vendored
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?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\OptionsResolver\Debug;
|
||||
|
||||
use Symfony\Component\OptionsResolver\Exception\NoConfigurationException;
|
||||
use Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
/**
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class OptionsResolverIntrospector
|
||||
{
|
||||
private $get;
|
||||
|
||||
public function __construct(OptionsResolver $optionsResolver)
|
||||
{
|
||||
$this->get = \Closure::bind(function ($property, $option, $message) {
|
||||
/** @var OptionsResolver $this */
|
||||
if (!$this->isDefined($option)) {
|
||||
throw new UndefinedOptionsException(sprintf('The option "%s" does not exist.', $option));
|
||||
}
|
||||
|
||||
if (!\array_key_exists($option, $this->{$property})) {
|
||||
throw new NoConfigurationException($message);
|
||||
}
|
||||
|
||||
return $this->{$property}[$option];
|
||||
}, $optionsResolver, $optionsResolver);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*
|
||||
* @throws NoConfigurationException on no configured value
|
||||
*/
|
||||
public function getDefault(string $option)
|
||||
{
|
||||
return ($this->get)('defaults', $option, sprintf('No default value was set for the "%s" option.', $option));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Closure[]
|
||||
*
|
||||
* @throws NoConfigurationException on no configured closures
|
||||
*/
|
||||
public function getLazyClosures(string $option): array
|
||||
{
|
||||
return ($this->get)('lazy', $option, sprintf('No lazy closures were set for the "%s" option.', $option));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*
|
||||
* @throws NoConfigurationException on no configured types
|
||||
*/
|
||||
public function getAllowedTypes(string $option): array
|
||||
{
|
||||
return ($this->get)('allowedTypes', $option, sprintf('No allowed types were set for the "%s" option.', $option));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed[]
|
||||
*
|
||||
* @throws NoConfigurationException on no configured values
|
||||
*/
|
||||
public function getAllowedValues(string $option): array
|
||||
{
|
||||
return ($this->get)('allowedValues', $option, sprintf('No allowed values were set for the "%s" option.', $option));
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws NoConfigurationException on no configured normalizer
|
||||
*/
|
||||
public function getNormalizer(string $option): \Closure
|
||||
{
|
||||
return current($this->getNormalizers($option));
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws NoConfigurationException when no normalizer is configured
|
||||
*/
|
||||
public function getNormalizers(string $option): array
|
||||
{
|
||||
return ($this->get)('normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|\Closure
|
||||
*
|
||||
* @throws NoConfigurationException on no configured deprecation
|
||||
*
|
||||
* @deprecated since Symfony 5.1, use "getDeprecation()" instead.
|
||||
*/
|
||||
public function getDeprecationMessage(string $option)
|
||||
{
|
||||
trigger_deprecation('symfony/options-resolver', '5.1', 'The "%s()" method is deprecated, use "getDeprecation()" instead.', __METHOD__);
|
||||
|
||||
return $this->getDeprecation($option)['message'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws NoConfigurationException on no configured deprecation
|
||||
*/
|
||||
public function getDeprecation(string $option): array
|
||||
{
|
||||
return ($this->get)('deprecated', $option, sprintf('No deprecation was set for the "%s" option.', $option));
|
||||
}
|
||||
}
|
22
vendor/symfony/options-resolver/Exception/AccessException.php
vendored
Normal file
22
vendor/symfony/options-resolver/Exception/AccessException.php
vendored
Normal file
|
@ -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\OptionsResolver\Exception;
|
||||
|
||||
/**
|
||||
* Thrown when trying to read an option outside of or write it inside of
|
||||
* {@link \Symfony\Component\OptionsResolver\Options::resolve()}.
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
class AccessException extends \LogicException implements ExceptionInterface
|
||||
{
|
||||
}
|
21
vendor/symfony/options-resolver/Exception/ExceptionInterface.php
vendored
Normal file
21
vendor/symfony/options-resolver/Exception/ExceptionInterface.php
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?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\OptionsResolver\Exception;
|
||||
|
||||
/**
|
||||
* Marker interface for all exceptions thrown by the OptionsResolver component.
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
interface ExceptionInterface extends \Throwable
|
||||
{
|
||||
}
|
21
vendor/symfony/options-resolver/Exception/InvalidArgumentException.php
vendored
Normal file
21
vendor/symfony/options-resolver/Exception/InvalidArgumentException.php
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?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\OptionsResolver\Exception;
|
||||
|
||||
/**
|
||||
* Thrown when an argument is invalid.
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
|
||||
{
|
||||
}
|
23
vendor/symfony/options-resolver/Exception/InvalidOptionsException.php
vendored
Normal file
23
vendor/symfony/options-resolver/Exception/InvalidOptionsException.php
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?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\OptionsResolver\Exception;
|
||||
|
||||
/**
|
||||
* Thrown when the value of an option does not match its validation rules.
|
||||
*
|
||||
* You should make sure a valid value is passed to the option.
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
class InvalidOptionsException extends InvalidArgumentException
|
||||
{
|
||||
}
|
23
vendor/symfony/options-resolver/Exception/MissingOptionsException.php
vendored
Normal file
23
vendor/symfony/options-resolver/Exception/MissingOptionsException.php
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?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\OptionsResolver\Exception;
|
||||
|
||||
/**
|
||||
* Exception thrown when a required option is missing.
|
||||
*
|
||||
* Add the option to the passed options array.
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
class MissingOptionsException extends InvalidArgumentException
|
||||
{
|
||||
}
|
26
vendor/symfony/options-resolver/Exception/NoConfigurationException.php
vendored
Normal file
26
vendor/symfony/options-resolver/Exception/NoConfigurationException.php
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?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\OptionsResolver\Exception;
|
||||
|
||||
use Symfony\Component\OptionsResolver\Debug\OptionsResolverIntrospector;
|
||||
|
||||
/**
|
||||
* Thrown when trying to introspect an option definition property
|
||||
* for which no value was configured inside the OptionsResolver instance.
|
||||
*
|
||||
* @see OptionsResolverIntrospector
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
class NoConfigurationException extends \RuntimeException implements ExceptionInterface
|
||||
{
|
||||
}
|
26
vendor/symfony/options-resolver/Exception/NoSuchOptionException.php
vendored
Normal file
26
vendor/symfony/options-resolver/Exception/NoSuchOptionException.php
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?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\OptionsResolver\Exception;
|
||||
|
||||
/**
|
||||
* Thrown when trying to read an option that has no value set.
|
||||
*
|
||||
* When accessing optional options from within a lazy option or normalizer you should first
|
||||
* check whether the optional option is set. You can do this with `isset($options['optional'])`.
|
||||
* In contrast to the {@link UndefinedOptionsException}, this is a runtime exception that can
|
||||
* occur when evaluating lazy options.
|
||||
*
|
||||
* @author Tobias Schultze <http://tobion.de>
|
||||
*/
|
||||
class NoSuchOptionException extends \OutOfBoundsException implements ExceptionInterface
|
||||
{
|
||||
}
|
21
vendor/symfony/options-resolver/Exception/OptionDefinitionException.php
vendored
Normal file
21
vendor/symfony/options-resolver/Exception/OptionDefinitionException.php
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?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\OptionsResolver\Exception;
|
||||
|
||||
/**
|
||||
* Thrown when two lazy options have a cyclic dependency.
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
class OptionDefinitionException extends \LogicException implements ExceptionInterface
|
||||
{
|
||||
}
|
24
vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php
vendored
Normal file
24
vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?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\OptionsResolver\Exception;
|
||||
|
||||
/**
|
||||
* Exception thrown when an undefined option is passed.
|
||||
*
|
||||
* You should remove the options in question from your code or define them
|
||||
* beforehand.
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
class UndefinedOptionsException extends InvalidArgumentException
|
||||
{
|
||||
}
|
19
vendor/symfony/options-resolver/LICENSE
vendored
Normal file
19
vendor/symfony/options-resolver/LICENSE
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
Copyright (c) 2004-2021 Fabien Potencier
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
139
vendor/symfony/options-resolver/OptionConfigurator.php
vendored
Normal file
139
vendor/symfony/options-resolver/OptionConfigurator.php
vendored
Normal file
|
@ -0,0 +1,139 @@
|
|||
<?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\OptionsResolver;
|
||||
|
||||
use Symfony\Component\OptionsResolver\Exception\AccessException;
|
||||
|
||||
final class OptionConfigurator
|
||||
{
|
||||
private $name;
|
||||
private $resolver;
|
||||
|
||||
public function __construct(string $name, OptionsResolver $resolver)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->resolver = $resolver;
|
||||
$this->resolver->setDefined($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds allowed types for this option.
|
||||
*
|
||||
* @return $this
|
||||
*
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
*/
|
||||
public function allowedTypes(string ...$types): self
|
||||
{
|
||||
$this->resolver->setAllowedTypes($this->name, $types);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets allowed values for this option.
|
||||
*
|
||||
* @param mixed ...$values One or more acceptable values/closures
|
||||
*
|
||||
* @return $this
|
||||
*
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
*/
|
||||
public function allowedValues(...$values): self
|
||||
{
|
||||
$this->resolver->setAllowedValues($this->name, $values);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default value for this option.
|
||||
*
|
||||
* @param mixed $value The default value of the option
|
||||
*
|
||||
* @return $this
|
||||
*
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
*/
|
||||
public function default($value): self
|
||||
{
|
||||
$this->resolver->setDefault($this->name, $value);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines an option configurator with the given name.
|
||||
*/
|
||||
public function define(string $option): self
|
||||
{
|
||||
return $this->resolver->define($option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks this option as deprecated.
|
||||
*
|
||||
* @param string $package The name of the composer package that is triggering the deprecation
|
||||
* @param string $version The version of the package that introduced the deprecation
|
||||
* @param string|\Closure $message The deprecation message to use
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function deprecated(string $package, string $version, $message = 'The option "%name%" is deprecated.'): self
|
||||
{
|
||||
$this->resolver->setDeprecated($this->name, $package, $version, $message);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the normalizer for this option.
|
||||
*
|
||||
* @return $this
|
||||
*
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
*/
|
||||
public function normalize(\Closure $normalizer): self
|
||||
{
|
||||
$this->resolver->setNormalizer($this->name, $normalizer);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks this option as required.
|
||||
*
|
||||
* @return $this
|
||||
*
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
*/
|
||||
public function required(): self
|
||||
{
|
||||
$this->resolver->setRequired($this->name);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets an info message for an option.
|
||||
*
|
||||
* @return $this
|
||||
*
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
*/
|
||||
public function info(string $info): self
|
||||
{
|
||||
$this->resolver->setInfo($this->name, $info);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
22
vendor/symfony/options-resolver/Options.php
vendored
Normal file
22
vendor/symfony/options-resolver/Options.php
vendored
Normal file
|
@ -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\OptionsResolver;
|
||||
|
||||
/**
|
||||
* Contains resolved option values.
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
* @author Tobias Schultze <http://tobion.de>
|
||||
*/
|
||||
interface Options extends \ArrayAccess, \Countable
|
||||
{
|
||||
}
|
1347
vendor/symfony/options-resolver/OptionsResolver.php
vendored
Normal file
1347
vendor/symfony/options-resolver/OptionsResolver.php
vendored
Normal file
File diff suppressed because it is too large
Load diff
15
vendor/symfony/options-resolver/README.md
vendored
Normal file
15
vendor/symfony/options-resolver/README.md
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
OptionsResolver Component
|
||||
=========================
|
||||
|
||||
The OptionsResolver component is `array_replace` on steroids. It allows you to
|
||||
create an options system with required options, defaults, validation (type,
|
||||
value), normalization and more.
|
||||
|
||||
Resources
|
||||
---------
|
||||
|
||||
* [Documentation](https://symfony.com/doc/current/components/options_resolver.html)
|
||||
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
|
||||
* [Report issues](https://github.com/symfony/symfony/issues) and
|
||||
[send Pull Requests](https://github.com/symfony/symfony/pulls)
|
||||
in the [main Symfony repository](https://github.com/symfony/symfony)
|
292
vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php
vendored
Normal file
292
vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php
vendored
Normal file
|
@ -0,0 +1,292 @@
|
|||
<?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\OptionsResolver\Tests\Debug;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\OptionsResolver\Debug\OptionsResolverIntrospector;
|
||||
use Symfony\Component\OptionsResolver\Exception\NoConfigurationException;
|
||||
use Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException;
|
||||
use Symfony\Component\OptionsResolver\Options;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class OptionsResolverIntrospectorTest extends TestCase
|
||||
{
|
||||
public function testGetDefault()
|
||||
{
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefault($option = 'foo', 'bar');
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame('bar', $debug->getDefault($option));
|
||||
}
|
||||
|
||||
public function testGetDefaultNull()
|
||||
{
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefault($option = 'foo', null);
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertNull($debug->getDefault($option));
|
||||
}
|
||||
|
||||
public function testGetDefaultThrowsOnNoConfiguredValue()
|
||||
{
|
||||
$this->expectException(NoConfigurationException::class);
|
||||
$this->expectExceptionMessage('No default value was set for the "foo" option.');
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined($option = 'foo');
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$debug->getDefault($option);
|
||||
}
|
||||
|
||||
public function testGetDefaultThrowsOnNotDefinedOption()
|
||||
{
|
||||
$this->expectException(UndefinedOptionsException::class);
|
||||
$this->expectExceptionMessage('The option "foo" does not exist.');
|
||||
$resolver = new OptionsResolver();
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$debug->getDefault('foo');
|
||||
}
|
||||
|
||||
public function testGetLazyClosures()
|
||||
{
|
||||
$resolver = new OptionsResolver();
|
||||
$closures = [];
|
||||
$resolver->setDefault($option = 'foo', $closures[] = function (Options $options) {});
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame($closures, $debug->getLazyClosures($option));
|
||||
}
|
||||
|
||||
public function testGetLazyClosuresThrowsOnNoConfiguredValue()
|
||||
{
|
||||
$this->expectException(NoConfigurationException::class);
|
||||
$this->expectExceptionMessage('No lazy closures were set for the "foo" option.');
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined($option = 'foo');
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$debug->getLazyClosures($option);
|
||||
}
|
||||
|
||||
public function testGetLazyClosuresThrowsOnNotDefinedOption()
|
||||
{
|
||||
$this->expectException(UndefinedOptionsException::class);
|
||||
$this->expectExceptionMessage('The option "foo" does not exist.');
|
||||
$resolver = new OptionsResolver();
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$debug->getLazyClosures('foo');
|
||||
}
|
||||
|
||||
public function testGetAllowedTypes()
|
||||
{
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined($option = 'foo');
|
||||
$resolver->setAllowedTypes($option = 'foo', $allowedTypes = ['string', 'bool']);
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame($allowedTypes, $debug->getAllowedTypes($option));
|
||||
}
|
||||
|
||||
public function testGetAllowedTypesThrowsOnNoConfiguredValue()
|
||||
{
|
||||
$this->expectException(NoConfigurationException::class);
|
||||
$this->expectExceptionMessage('No allowed types were set for the "foo" option.');
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined($option = 'foo');
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame('bar', $debug->getAllowedTypes($option));
|
||||
}
|
||||
|
||||
public function testGetAllowedTypesThrowsOnNotDefinedOption()
|
||||
{
|
||||
$this->expectException(UndefinedOptionsException::class);
|
||||
$this->expectExceptionMessage('The option "foo" does not exist.');
|
||||
$resolver = new OptionsResolver();
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame('bar', $debug->getAllowedTypes('foo'));
|
||||
}
|
||||
|
||||
public function testGetAllowedValues()
|
||||
{
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined($option = 'foo');
|
||||
$resolver->setAllowedValues($option = 'foo', $allowedValues = ['bar', 'baz']);
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame($allowedValues, $debug->getAllowedValues($option));
|
||||
}
|
||||
|
||||
public function testGetAllowedValuesThrowsOnNoConfiguredValue()
|
||||
{
|
||||
$this->expectException(NoConfigurationException::class);
|
||||
$this->expectExceptionMessage('No allowed values were set for the "foo" option.');
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined($option = 'foo');
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame('bar', $debug->getAllowedValues($option));
|
||||
}
|
||||
|
||||
public function testGetAllowedValuesThrowsOnNotDefinedOption()
|
||||
{
|
||||
$this->expectException(UndefinedOptionsException::class);
|
||||
$this->expectExceptionMessage('The option "foo" does not exist.');
|
||||
$resolver = new OptionsResolver();
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame('bar', $debug->getAllowedValues('foo'));
|
||||
}
|
||||
|
||||
public function testGetNormalizer()
|
||||
{
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined($option = 'foo');
|
||||
$resolver->setNormalizer($option = 'foo', $normalizer = function () {});
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame($normalizer, $debug->getNormalizer($option));
|
||||
}
|
||||
|
||||
public function testGetNormalizerThrowsOnNoConfiguredValue()
|
||||
{
|
||||
$this->expectException(NoConfigurationException::class);
|
||||
$this->expectExceptionMessage('No normalizer was set for the "foo" option.');
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined($option = 'foo');
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame('bar', $debug->getNormalizer($option));
|
||||
}
|
||||
|
||||
public function testGetNormalizerThrowsOnNotDefinedOption()
|
||||
{
|
||||
$this->expectException(UndefinedOptionsException::class);
|
||||
$this->expectExceptionMessage('The option "foo" does not exist.');
|
||||
$resolver = new OptionsResolver();
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame('bar', $debug->getNormalizer('foo'));
|
||||
}
|
||||
|
||||
public function testGetNormalizers()
|
||||
{
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined('foo');
|
||||
$resolver->addNormalizer('foo', $normalizer1 = function () {});
|
||||
$resolver->addNormalizer('foo', $normalizer2 = function () {});
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame([$normalizer1, $normalizer2], $debug->getNormalizers('foo'));
|
||||
}
|
||||
|
||||
public function testGetNormalizersThrowsOnNoConfiguredValue()
|
||||
{
|
||||
$this->expectException(NoConfigurationException::class);
|
||||
$this->expectExceptionMessage('No normalizer was set for the "foo" option.');
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined('foo');
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$debug->getNormalizers('foo');
|
||||
}
|
||||
|
||||
public function testGetNormalizersThrowsOnNotDefinedOption()
|
||||
{
|
||||
$this->expectException(UndefinedOptionsException::class);
|
||||
$this->expectExceptionMessage('The option "foo" does not exist.');
|
||||
$resolver = new OptionsResolver();
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$debug->getNormalizers('foo');
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
*/
|
||||
public function testGetDeprecationMessage()
|
||||
{
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined('foo');
|
||||
$resolver->setDeprecated('foo', 'The option "foo" is deprecated.');
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame('The option "foo" is deprecated.', $debug->getDeprecationMessage('foo'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
*/
|
||||
public function testGetClosureDeprecationMessage()
|
||||
{
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined('foo');
|
||||
$resolver->setDeprecated('foo', $closure = function (Options $options, $value) {});
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame($closure, $debug->getDeprecationMessage('foo'));
|
||||
}
|
||||
|
||||
public function testGetDeprecation()
|
||||
{
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined('foo');
|
||||
$resolver->setDeprecated('foo', 'vendor/package', '1.1', 'The option "foo" is deprecated.');
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame([
|
||||
'package' => 'vendor/package',
|
||||
'version' => '1.1',
|
||||
'message' => 'The option "foo" is deprecated.',
|
||||
], $debug->getDeprecation('foo'));
|
||||
}
|
||||
|
||||
public function testGetClosureDeprecation()
|
||||
{
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined('foo');
|
||||
$resolver->setDeprecated('foo', 'vendor/package', '1.1', $closure = function (Options $options, $value) {});
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame([
|
||||
'package' => 'vendor/package',
|
||||
'version' => '1.1',
|
||||
'message' => $closure,
|
||||
], $debug->getDeprecation('foo'));
|
||||
}
|
||||
|
||||
public function testGetDeprecationMessageThrowsOnNoConfiguredValue()
|
||||
{
|
||||
$this->expectException(NoConfigurationException::class);
|
||||
$this->expectExceptionMessage('No deprecation was set for the "foo" option.');
|
||||
$resolver = new OptionsResolver();
|
||||
$resolver->setDefined('foo');
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$debug->getDeprecation('foo');
|
||||
}
|
||||
|
||||
public function testGetDeprecationMessageThrowsOnNotDefinedOption()
|
||||
{
|
||||
$this->expectException(UndefinedOptionsException::class);
|
||||
$this->expectExceptionMessage('The option "foo" does not exist.');
|
||||
$resolver = new OptionsResolver();
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$debug->getDeprecation('foo');
|
||||
}
|
||||
}
|
2594
vendor/symfony/options-resolver/Tests/OptionsResolverTest.php
vendored
Normal file
2594
vendor/symfony/options-resolver/Tests/OptionsResolverTest.php
vendored
Normal file
File diff suppressed because it is too large
Load diff
31
vendor/symfony/options-resolver/composer.json
vendored
Normal file
31
vendor/symfony/options-resolver/composer.json
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"name": "symfony/options-resolver",
|
||||
"type": "library",
|
||||
"description": "Provides an improved replacement for the array_replace PHP function",
|
||||
"keywords": ["options", "config", "configuration"],
|
||||
"homepage": "https://symfony.com",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"symfony/deprecation-contracts": "^2.1",
|
||||
"symfony/polyfill-php73": "~1.0",
|
||||
"symfony/polyfill-php80": "^1.16"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Symfony\\Component\\OptionsResolver\\": "" },
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
31
vendor/symfony/options-resolver/phpunit.xml.dist
vendored
Normal file
31
vendor/symfony/options-resolver/phpunit.xml.dist
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="true"
|
||||
bootstrap="vendor/autoload.php"
|
||||
failOnRisky="true"
|
||||
failOnWarning="true"
|
||||
>
|
||||
<php>
|
||||
<ini name="error_reporting" value="-1" />
|
||||
</php>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="Symfony OptionsResolver Component Test Suite">
|
||||
<directory>./Tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./</directory>
|
||||
<exclude>
|
||||
<directory>./Resources</directory>
|
||||
<directory>./Tests</directory>
|
||||
<directory>./vendor</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
Loading…
Add table
Add a link
Reference in a new issue