laravel-6 support
This commit is contained in:
63
vendor/symfony/options-resolver/CHANGELOG.md
vendored
63
vendor/symfony/options-resolver/CHANGELOG.md
vendored
@@ -1,63 +0,0 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
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
|
@@ -1,108 +0,0 @@
|
||||
<?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
|
||||
*/
|
||||
public function getDeprecationMessage(string $option)
|
||||
{
|
||||
return ($this->get)('deprecated', $option, sprintf('No deprecation was set for the "%s" option.', $option));
|
||||
}
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
<?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
|
||||
{
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
<?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
|
||||
{
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
<?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
|
||||
{
|
||||
}
|
@@ -1,23 +0,0 @@
|
||||
<?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
|
||||
{
|
||||
}
|
@@ -1,23 +0,0 @@
|
||||
<?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
|
||||
{
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
<?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
|
||||
{
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
<?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
|
||||
{
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
<?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
|
||||
{
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
<?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
19
vendor/symfony/options-resolver/LICENSE
vendored
@@ -1,19 +0,0 @@
|
||||
Copyright (c) 2004-2022 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.
|
22
vendor/symfony/options-resolver/Options.php
vendored
22
vendor/symfony/options-resolver/Options.php
vendored
@@ -1,22 +0,0 @@
|
||||
<?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
|
||||
{
|
||||
}
|
1228
vendor/symfony/options-resolver/OptionsResolver.php
vendored
1228
vendor/symfony/options-resolver/OptionsResolver.php
vendored
File diff suppressed because it is too large
Load Diff
15
vendor/symfony/options-resolver/README.md
vendored
15
vendor/symfony/options-resolver/README.md
vendored
@@ -1,15 +0,0 @@
|
||||
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)
|
29
vendor/symfony/options-resolver/composer.json
vendored
29
vendor/symfony/options-resolver/composer.json
vendored
@@ -1,29 +0,0 @@
|
||||
{
|
||||
"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.1.3",
|
||||
"symfony/polyfill-php80": "^1.16"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Symfony\\Component\\OptionsResolver\\": "" },
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
Reference in New Issue
Block a user