ComposerUpdate

This commit is contained in:
Anyon 2020-06-24 15:45:14 +08:00
parent b077f46deb
commit 983c4b1f0c
6 changed files with 56 additions and 23 deletions

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php'; require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit5b4788472e0cb40219a653c677276921::getLoader(); return ComposerAutoloaderInit22183b783e201ec2112d708dc8d5d619::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInit5b4788472e0cb40219a653c677276921 class ComposerAutoloaderInit22183b783e201ec2112d708dc8d5d619
{ {
private static $loader; private static $loader;
@ -13,21 +13,24 @@ class ComposerAutoloaderInit5b4788472e0cb40219a653c677276921
} }
} }
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader() public static function getLoader()
{ {
if (null !== self::$loader) { if (null !== self::$loader) {
return self::$loader; return self::$loader;
} }
spl_autoload_register(array('ComposerAutoloaderInit5b4788472e0cb40219a653c677276921', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInit22183b783e201ec2112d708dc8d5d619', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(); self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit5b4788472e0cb40219a653c677276921', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInit22183b783e201ec2112d708dc8d5d619', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) { if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php'; require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit5b4788472e0cb40219a653c677276921::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInit22183b783e201ec2112d708dc8d5d619::getInitializer($loader));
} else { } else {
$map = require __DIR__ . '/autoload_namespaces.php'; $map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) { foreach ($map as $namespace => $path) {
@ -48,19 +51,19 @@ class ComposerAutoloaderInit5b4788472e0cb40219a653c677276921
$loader->register(true); $loader->register(true);
if ($useStaticLoader) { if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit5b4788472e0cb40219a653c677276921::$files; $includeFiles = Composer\Autoload\ComposerStaticInit22183b783e201ec2112d708dc8d5d619::$files;
} else { } else {
$includeFiles = require __DIR__ . '/autoload_files.php'; $includeFiles = require __DIR__ . '/autoload_files.php';
} }
foreach ($includeFiles as $fileIdentifier => $file) { foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire5b4788472e0cb40219a653c677276921($fileIdentifier, $file); composerRequire22183b783e201ec2112d708dc8d5d619($fileIdentifier, $file);
} }
return $loader; return $loader;
} }
} }
function composerRequire5b4788472e0cb40219a653c677276921($fileIdentifier, $file) function composerRequire22183b783e201ec2112d708dc8d5d619($fileIdentifier, $file)
{ {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file; require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload; namespace Composer\Autoload;
class ComposerStaticInit5b4788472e0cb40219a653c677276921 class ComposerStaticInit22183b783e201ec2112d708dc8d5d619
{ {
public static $files = array ( public static $files = array (
'841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php', '841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php',
@ -384,9 +384,9 @@ class ComposerStaticInit5b4788472e0cb40219a653c677276921
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit5b4788472e0cb40219a653c677276921::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInit22183b783e201ec2112d708dc8d5d619::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit5b4788472e0cb40219a653c677276921::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit22183b783e201ec2112d708dc8d5d619::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit5b4788472e0cb40219a653c677276921::$classMap; $loader->classMap = ComposerStaticInit22183b783e201ec2112d708dc8d5d619::$classMap;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }

View File

@ -177,17 +177,17 @@
}, },
{ {
"name": "symfony/options-resolver", "name": "symfony/options-resolver",
"version": "v3.4.38", "version": "v3.4.42",
"version_normalized": "3.4.38.0", "version_normalized": "3.4.42.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/options-resolver.git", "url": "https://github.com/symfony/options-resolver.git",
"reference": "730ef56164ed6c9356c159e9f5ff2b84d753b9ed" "reference": "3b9fe6db7fe3694307d182dd73983584af77d5fd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/730ef56164ed6c9356c159e9f5ff2b84d753b9ed", "url": "https://api.github.com/repos/symfony/options-resolver/zipball/3b9fe6db7fe3694307d182dd73983584af77d5fd",
"reference": "730ef56164ed6c9356c159e9f5ff2b84d753b9ed", "reference": "3b9fe6db7fe3694307d182dd73983584af77d5fd",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -199,7 +199,7 @@
"require": { "require": {
"php": "^5.5.9|>=7.0.8" "php": "^5.5.9|>=7.0.8"
}, },
"time": "2020-01-01T11:03:25+00:00", "time": "2020-05-21T13:02:25+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
@ -235,6 +235,20 @@
"config", "config",
"configuration", "configuration",
"options" "options"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
] ]
}, },
{ {

View File

@ -146,7 +146,7 @@ class OptionsResolver implements Options
$reflClosure = new \ReflectionFunction($value); $reflClosure = new \ReflectionFunction($value);
$params = $reflClosure->getParameters(); $params = $reflClosure->getParameters();
if (isset($params[0]) && null !== ($class = $params[0]->getClass()) && Options::class === $class->name) { if (isset($params[0]) && Options::class === $this->getParameterClassName($params[0])) {
// Initialize the option if no previous value exists // Initialize the option if no previous value exists
if (!isset($this->defaults[$option])) { if (!isset($this->defaults[$option])) {
$this->defaults[$option] = null; $this->defaults[$option] = null;
@ -1066,4 +1066,20 @@ class OptionsResolver implements Options
{ {
return (\function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type; return (\function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type;
} }
/**
* @return string|null
*/
private function getParameterClassName(\ReflectionParameter $parameter)
{
if (!method_exists($parameter, 'getType')) {
return ($class = $parameter->getClass()) ? $class->name : null;
}
if (!($type = $parameter->getType()) || $type->isBuiltin()) {
return null;
}
return method_exists($type, 'getName') ? $type->getName() : (string) $type;
}
} }

View File

@ -44,7 +44,7 @@ class OptionsResolverIntrospectorTest extends TestCase
$resolver->setDefined($option = 'foo'); $resolver->setDefined($option = 'foo');
$debug = new OptionsResolverIntrospector($resolver); $debug = new OptionsResolverIntrospector($resolver);
$this->assertSame('bar', $debug->getDefault($option)); $debug->getDefault($option);
} }
public function testGetDefaultThrowsOnNotDefinedOption() public function testGetDefaultThrowsOnNotDefinedOption()
@ -54,7 +54,7 @@ class OptionsResolverIntrospectorTest extends TestCase
$resolver = new OptionsResolver(); $resolver = new OptionsResolver();
$debug = new OptionsResolverIntrospector($resolver); $debug = new OptionsResolverIntrospector($resolver);
$this->assertSame('bar', $debug->getDefault('foo')); $debug->getDefault('foo');
} }
public function testGetLazyClosures() public function testGetLazyClosures()
@ -75,7 +75,7 @@ class OptionsResolverIntrospectorTest extends TestCase
$resolver->setDefined($option = 'foo'); $resolver->setDefined($option = 'foo');
$debug = new OptionsResolverIntrospector($resolver); $debug = new OptionsResolverIntrospector($resolver);
$this->assertSame('bar', $debug->getLazyClosures($option)); $debug->getLazyClosures($option);
} }
public function testGetLazyClosuresThrowsOnNotDefinedOption() public function testGetLazyClosuresThrowsOnNotDefinedOption()
@ -85,7 +85,7 @@ class OptionsResolverIntrospectorTest extends TestCase
$resolver = new OptionsResolver(); $resolver = new OptionsResolver();
$debug = new OptionsResolverIntrospector($resolver); $debug = new OptionsResolverIntrospector($resolver);
$this->assertSame('bar', $debug->getLazyClosures('foo')); $debug->getLazyClosures('foo');
} }
public function testGetAllowedTypes() public function testGetAllowedTypes()