- * @author Nicolas Grekas
- */
-interface TaggableCacheItemInterface extends CacheItemInterface
-{
- /**
- * Get all existing tags. These are the tags the item has when the item is
- * returned from the pool.
- *
- * @return array
- */
- public function getPreviousTags();
-
- /**
- * Overwrite all tags with a new set of tags.
- *
- * @param string[] $tags An array of tags
- *
- * @throws InvalidArgumentException When a tag is not valid.
- *
- * @return TaggableCacheItemInterface
- */
- public function setTags(array $tags);
-}
diff --git a/vendor/cache/tag-interop/TaggableCacheItemPoolInterface.php b/vendor/cache/tag-interop/TaggableCacheItemPoolInterface.php
deleted file mode 100644
index 055bf4b..0000000
--- a/vendor/cache/tag-interop/TaggableCacheItemPoolInterface.php
+++ /dev/null
@@ -1,60 +0,0 @@
-, Tobias Nyholm
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
-
-namespace Cache\TagInterop;
-
-use Psr\Cache\CacheItemPoolInterface;
-use Psr\Cache\InvalidArgumentException;
-
-/**
- * Interface for invalidating cached items using tags. This interface is a soon-to-be-PSR.
- *
- * @author Tobias Nyholm
- * @author Nicolas Grekas
- */
-interface TaggableCacheItemPoolInterface extends CacheItemPoolInterface
-{
- /**
- * Invalidates cached items using a tag.
- *
- * @param string $tag The tag to invalidate
- *
- * @throws InvalidArgumentException When $tags is not valid
- *
- * @return bool True on success
- */
- public function invalidateTag($tag);
-
- /**
- * Invalidates cached items using tags.
- *
- * @param string[] $tags An array of tags to invalidate
- *
- * @throws InvalidArgumentException When $tags is not valid
- *
- * @return bool True on success
- */
- public function invalidateTags(array $tags);
-
- /**
- * {@inheritdoc}
- *
- * @return TaggableCacheItemInterface
- */
- public function getItem($key);
-
- /**
- * {@inheritdoc}
- *
- * @return array|\Traversable|TaggableCacheItemInterface[]
- */
- public function getItems(array $keys = []);
-}
diff --git a/vendor/cache/tag-interop/composer.json b/vendor/cache/tag-interop/composer.json
deleted file mode 100644
index 03dacbe..0000000
--- a/vendor/cache/tag-interop/composer.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "name": "cache/tag-interop",
- "description": "Framework interoperable interfaces for tags",
- "license": "MIT",
- "type": "library",
- "keywords": [
- "cache",
- "psr6",
- "tag",
- "psr"
- ],
- "authors": [
- {
- "name": "Tobias Nyholm",
- "email": "tobias.nyholm@gmail.com",
- "homepage": "https://github.com/nyholm"
- },
- {
- "name": "Nicolas Grekas ",
- "email": "p@tchwork.com",
- "homepage": "https://github.com/nicolas-grekas"
- }
- ],
- "homepage": "https://www.php-cache.com/en/latest/",
- "require": {
- "php": "^5.5 || ^7.0 || ^8.0",
- "psr/cache": "^1.0 || ^2.0"
- },
- "autoload": {
- "psr-4": {
- "Cache\\TagInterop\\": ""
- }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
- }
-}
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
index 350f034..0fb0a2c 100644
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -6,23 +6,5 @@ $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
- 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
- 'Callback' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
- 'CallbackBody' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
- 'CallbackParam' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
- 'CallbackParameterToReference' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
- 'CallbackReturnReference' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
- 'CallbackReturnValue' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
- 'DOMDocumentWrapper' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
- 'DOMEvent' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
- 'ICallbackNamed' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
- 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
- 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
- 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
- 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
- 'phpQuery' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
- 'phpQueryEvents' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
- 'phpQueryObject' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
- 'phpQueryPlugins' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
);
diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php
index 2a84e1c..0aba306 100644
--- a/vendor/composer/autoload_files.php
+++ b/vendor/composer/autoload_files.php
@@ -9,19 +9,9 @@ return array(
'9b552a3cc426e3287cc811caefa3cf53' => $vendorDir . '/topthink/think-helper/src/helper.php',
'35fab96057f1bf5e7aba31a8a6d5fdde' => $vendorDir . '/topthink/think-orm/stubs/load_stubs.php',
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
- 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
- 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
- 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
+ '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
- '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
- '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
- '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
- 'fe62ba7e10580d903cc46d808b5961a4' => $vendorDir . '/tightenco/collect/src/Collect/Support/helpers.php',
- 'caf31cc6ec7cf2241cb6f12c226c3846' => $vendorDir . '/tightenco/collect/src/Collect/Support/alias.php',
- '6b998e7ad3182c0d21d23780badfa07b' => $vendorDir . '/yansongda/supports/src/Functions.php',
- 'b33e3d135e5d9e47d845c576147bda89' => $vendorDir . '/php-di/php-di/src/functions.php',
'223fa6f9b46fbe5d6b44c5ff847bfceb' => $vendorDir . '/taoser/think-addons/src/helper.php',
'1cfd2761b63b0a29ed23657ea394cb2d' => $vendorDir . '/topthink/think-captcha/src/helper.php',
- '8c783b3a3de2f6d9177022b5ccdcc841' => $vendorDir . '/yansongda/pay/src/Functions.php',
'd421242fd42b2ea6cd13f802bcf18a6e' => $baseDir . '/extend/taoler/com/form.php',
);
diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php
index 5e85e55..2bf9717 100644
--- a/vendor/composer/autoload_psr4.php
+++ b/vendor/composer/autoload_psr4.php
@@ -7,54 +7,21 @@ $baseDir = dirname($vendorDir);
return array(
'yzh52521\\EasyHttp\\' => array($vendorDir . '/yzh52521/easyhttp/src'),
- 'wamkj\\thinkphp\\' => array($vendorDir . '/wamkj/thinkphp6.0-databackup/src'),
'think\\view\\driver\\' => array($vendorDir . '/topthink/think-view/src'),
- 'think\\trace\\' => array($vendorDir . '/topthink/think-trace/src'),
- 'think\\migration\\' => array($vendorDir . '/topthink/think-migration/src'),
- 'think\\composer\\' => array($vendorDir . '/topthink/think-installer/src'),
'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'),
'think\\app\\' => array($vendorDir . '/topthink/think-multi-app/src'),
- 'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-template/src'),
+ 'think\\' => array($vendorDir . '/topthink/think-template/src', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/framework/src/think'),
'taoser\\think\\' => array($vendorDir . '/taoser/think-auth/src'),
'taoser\\' => array($vendorDir . '/taoser/think-addons/src', $vendorDir . '/taoser/think-setarr/src'),
- 'phpspirit\\databackup\\' => array($vendorDir . '/lotofbadcode/phpspirit_databackup/src'),
- 'liliuwei\\social\\' => array($vendorDir . '/liliuwei/thinkphp-social/src'),
'app\\' => array($baseDir . '/app'),
- 'Yansongda\\Supports\\' => array($vendorDir . '/yansongda/supports/src'),
- 'Yansongda\\Pay\\' => array($vendorDir . '/yansongda/pay/src'),
- 'Workerman\\' => array($vendorDir . '/workerman/workerman'),
- 'Tightenco\\Collect\\' => array($vendorDir . '/tightenco/collect/src/Collect'),
- 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
- 'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'),
- 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
'Symfony\\Component\\VarExporter\\' => array($vendorDir . '/symfony/var-exporter'),
- 'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
- 'QL\\' => array($vendorDir . '/jaeger/querylist/src'),
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
- 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
- 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
+ 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'),
+ 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'),
'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
- 'Psr\\EventDispatcher\\' => array($vendorDir . '/psr/event-dispatcher/src'),
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
- 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
- 'PhpDocReader\\' => array($vendorDir . '/php-di/phpdoc-reader/src/PhpDocReader'),
- 'Phinx\\' => array($vendorDir . '/topthink/think-migration/phinx/src/Phinx'),
- 'PHPSocketIO\\' => array($vendorDir . '/workerman/phpsocket.io/src'),
'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'),
- 'League\\MimeTypeDetection\\' => array($vendorDir . '/league/mime-type-detection/src'),
- 'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'),
- 'Laravel\\SerializableClosure\\' => array($vendorDir . '/laravel/serializable-closure/src'),
- 'Jaeger\\' => array($vendorDir . '/jaeger/g-http/src'),
- 'Invoker\\' => array($vendorDir . '/php-di/invoker/src'),
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
- 'Endroid\\QrCode\\' => array($vendorDir . '/endroid/qr-code/src'),
- 'DI\\' => array($vendorDir . '/php-di/php-di/src'),
- 'DASPRiD\\Enum\\' => array($vendorDir . '/dasprid/enum/src'),
- 'Channel\\' => array($vendorDir . '/workerman/channel/src'),
- 'Cache\\TagInterop\\' => array($vendorDir . '/cache/tag-interop'),
- 'Cache\\Adapter\\Filesystem\\' => array($vendorDir . '/cache/filesystem-adapter'),
- 'Cache\\Adapter\\Common\\' => array($vendorDir . '/cache/adapter-common'),
- 'BaconQrCode\\' => array($vendorDir . '/bacon/bacon-qr-code/src'),
);
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
index bec7df4..35bee46 100644
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInit1b32198725235c8d6500c87262ef30c2
+class ComposerAutoloaderInitbd5d3d6d2646baf3ad0aa6db972a53b0
{
private static $loader;
@@ -24,16 +24,16 @@ class ComposerAutoloaderInit1b32198725235c8d6500c87262ef30c2
require __DIR__ . '/platform_check.php';
- spl_autoload_register(array('ComposerAutoloaderInit1b32198725235c8d6500c87262ef30c2', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderInitbd5d3d6d2646baf3ad0aa6db972a53b0', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
- spl_autoload_unregister(array('ComposerAutoloaderInit1b32198725235c8d6500c87262ef30c2', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderInitbd5d3d6d2646baf3ad0aa6db972a53b0', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
- call_user_func(\Composer\Autoload\ComposerStaticInit1b32198725235c8d6500c87262ef30c2::getInitializer($loader));
+ call_user_func(\Composer\Autoload\ComposerStaticInitbd5d3d6d2646baf3ad0aa6db972a53b0::getInitializer($loader));
$loader->register(true);
- $filesToLoad = \Composer\Autoload\ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$files;
+ $filesToLoad = \Composer\Autoload\ComposerStaticInitbd5d3d6d2646baf3ad0aa6db972a53b0::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
index 3c638c2..232bde8 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -4,26 +4,16 @@
namespace Composer\Autoload;
-class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
+class ComposerStaticInitbd5d3d6d2646baf3ad0aa6db972a53b0
{
public static $files = array (
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
'35fab96057f1bf5e7aba31a8a6d5fdde' => __DIR__ . '/..' . '/topthink/think-orm/stubs/load_stubs.php',
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
- 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
- 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
- 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
+ '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
- '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
- '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
- '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
- 'fe62ba7e10580d903cc46d808b5961a4' => __DIR__ . '/..' . '/tightenco/collect/src/Collect/Support/helpers.php',
- 'caf31cc6ec7cf2241cb6f12c226c3846' => __DIR__ . '/..' . '/tightenco/collect/src/Collect/Support/alias.php',
- '6b998e7ad3182c0d21d23780badfa07b' => __DIR__ . '/..' . '/yansongda/supports/src/Functions.php',
- 'b33e3d135e5d9e47d845c576147bda89' => __DIR__ . '/..' . '/php-di/php-di/src/functions.php',
'223fa6f9b46fbe5d6b44c5ff847bfceb' => __DIR__ . '/..' . '/taoser/think-addons/src/helper.php',
'1cfd2761b63b0a29ed23657ea394cb2d' => __DIR__ . '/..' . '/topthink/think-captcha/src/helper.php',
- '8c783b3a3de2f6d9177022b5ccdcc841' => __DIR__ . '/..' . '/yansongda/pay/src/Functions.php',
'd421242fd42b2ea6cd13f802bcf18a6e' => __DIR__ . '/../..' . '/extend/taoler/com/form.php',
);
@@ -32,58 +22,22 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
array (
'yzh52521\\EasyHttp\\' => 18,
),
- 'w' =>
- array (
- 'wamkj\\thinkphp\\' => 15,
- ),
't' =>
array (
'think\\view\\driver\\' => 18,
- 'think\\trace\\' => 12,
- 'think\\migration\\' => 16,
- 'think\\composer\\' => 15,
'think\\captcha\\' => 14,
'think\\app\\' => 10,
'think\\' => 6,
'taoser\\think\\' => 13,
'taoser\\' => 7,
),
- 'p' =>
- array (
- 'phpspirit\\databackup\\' => 21,
- ),
- 'l' =>
- array (
- 'liliuwei\\social\\' => 16,
- ),
'a' =>
array (
'app\\' => 4,
),
- 'Y' =>
- array (
- 'Yansongda\\Supports\\' => 19,
- 'Yansongda\\Pay\\' => 14,
- ),
- 'W' =>
- array (
- 'Workerman\\' => 10,
- ),
- 'T' =>
- array (
- 'Tightenco\\Collect\\' => 18,
- ),
'S' =>
array (
- 'Symfony\\Polyfill\\Php80\\' => 23,
- 'Symfony\\Polyfill\\Php72\\' => 23,
- 'Symfony\\Polyfill\\Mbstring\\' => 26,
'Symfony\\Component\\VarExporter\\' => 30,
- 'Symfony\\Component\\VarDumper\\' => 28,
- ),
- 'Q' =>
- array (
- 'QL\\' => 3,
),
'P' =>
array (
@@ -91,54 +45,15 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
'Psr\\Log\\' => 8,
'Psr\\Http\\Message\\' => 17,
'Psr\\Http\\Client\\' => 16,
- 'Psr\\EventDispatcher\\' => 20,
'Psr\\Container\\' => 14,
- 'Psr\\Cache\\' => 10,
- 'PhpDocReader\\' => 13,
- 'Phinx\\' => 6,
- 'PHPSocketIO\\' => 12,
'PHPMailer\\PHPMailer\\' => 20,
),
- 'L' =>
- array (
- 'League\\MimeTypeDetection\\' => 25,
- 'League\\Flysystem\\' => 17,
- 'Laravel\\SerializableClosure\\' => 28,
- ),
- 'J' =>
- array (
- 'Jaeger\\' => 7,
- ),
- 'I' =>
- array (
- 'Invoker\\' => 8,
- ),
'G' =>
array (
'GuzzleHttp\\Psr7\\' => 16,
'GuzzleHttp\\Promise\\' => 19,
'GuzzleHttp\\' => 11,
),
- 'E' =>
- array (
- 'Endroid\\QrCode\\' => 15,
- ),
- 'D' =>
- array (
- 'DI\\' => 3,
- 'DASPRiD\\Enum\\' => 13,
- ),
- 'C' =>
- array (
- 'Channel\\' => 8,
- 'Cache\\TagInterop\\' => 17,
- 'Cache\\Adapter\\Filesystem\\' => 25,
- 'Cache\\Adapter\\Common\\' => 21,
- ),
- 'B' =>
- array (
- 'BaconQrCode\\' => 12,
- ),
);
public static $prefixDirsPsr4 = array (
@@ -146,26 +61,10 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
array (
0 => __DIR__ . '/..' . '/yzh52521/easyhttp/src',
),
- 'wamkj\\thinkphp\\' =>
- array (
- 0 => __DIR__ . '/..' . '/wamkj/thinkphp6.0-databackup/src',
- ),
'think\\view\\driver\\' =>
array (
0 => __DIR__ . '/..' . '/topthink/think-view/src',
),
- 'think\\trace\\' =>
- array (
- 0 => __DIR__ . '/..' . '/topthink/think-trace/src',
- ),
- 'think\\migration\\' =>
- array (
- 0 => __DIR__ . '/..' . '/topthink/think-migration/src',
- ),
- 'think\\composer\\' =>
- array (
- 0 => __DIR__ . '/..' . '/topthink/think-installer/src',
- ),
'think\\captcha\\' =>
array (
0 => __DIR__ . '/..' . '/topthink/think-captcha/src',
@@ -176,10 +75,10 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
),
'think\\' =>
array (
- 0 => __DIR__ . '/..' . '/topthink/framework/src/think',
+ 0 => __DIR__ . '/..' . '/topthink/think-template/src',
1 => __DIR__ . '/..' . '/topthink/think-helper/src',
2 => __DIR__ . '/..' . '/topthink/think-orm/src',
- 3 => __DIR__ . '/..' . '/topthink/think-template/src',
+ 3 => __DIR__ . '/..' . '/topthink/framework/src/think',
),
'taoser\\think\\' =>
array (
@@ -190,122 +89,39 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
0 => __DIR__ . '/..' . '/taoser/think-addons/src',
1 => __DIR__ . '/..' . '/taoser/think-setarr/src',
),
- 'phpspirit\\databackup\\' =>
- array (
- 0 => __DIR__ . '/..' . '/lotofbadcode/phpspirit_databackup/src',
- ),
- 'liliuwei\\social\\' =>
- array (
- 0 => __DIR__ . '/..' . '/liliuwei/thinkphp-social/src',
- ),
'app\\' =>
array (
0 => __DIR__ . '/../..' . '/app',
),
- 'Yansongda\\Supports\\' =>
- array (
- 0 => __DIR__ . '/..' . '/yansongda/supports/src',
- ),
- 'Yansongda\\Pay\\' =>
- array (
- 0 => __DIR__ . '/..' . '/yansongda/pay/src',
- ),
- 'Workerman\\' =>
- array (
- 0 => __DIR__ . '/..' . '/workerman/workerman',
- ),
- 'Tightenco\\Collect\\' =>
- array (
- 0 => __DIR__ . '/..' . '/tightenco/collect/src/Collect',
- ),
- 'Symfony\\Polyfill\\Php80\\' =>
- array (
- 0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
- ),
- 'Symfony\\Polyfill\\Php72\\' =>
- array (
- 0 => __DIR__ . '/..' . '/symfony/polyfill-php72',
- ),
- 'Symfony\\Polyfill\\Mbstring\\' =>
- array (
- 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
- ),
'Symfony\\Component\\VarExporter\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/var-exporter',
),
- 'Symfony\\Component\\VarDumper\\' =>
- array (
- 0 => __DIR__ . '/..' . '/symfony/var-dumper',
- ),
- 'QL\\' =>
- array (
- 0 => __DIR__ . '/..' . '/jaeger/querylist/src',
- ),
'Psr\\SimpleCache\\' =>
array (
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
),
'Psr\\Log\\' =>
array (
- 0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
+ 0 => __DIR__ . '/..' . '/psr/log/src',
),
'Psr\\Http\\Message\\' =>
array (
0 => __DIR__ . '/..' . '/psr/http-message/src',
+ 1 => __DIR__ . '/..' . '/psr/http-factory/src',
),
'Psr\\Http\\Client\\' =>
array (
0 => __DIR__ . '/..' . '/psr/http-client/src',
),
- 'Psr\\EventDispatcher\\' =>
- array (
- 0 => __DIR__ . '/..' . '/psr/event-dispatcher/src',
- ),
'Psr\\Container\\' =>
array (
0 => __DIR__ . '/..' . '/psr/container/src',
),
- 'Psr\\Cache\\' =>
- array (
- 0 => __DIR__ . '/..' . '/psr/cache/src',
- ),
- 'PhpDocReader\\' =>
- array (
- 0 => __DIR__ . '/..' . '/php-di/phpdoc-reader/src/PhpDocReader',
- ),
- 'Phinx\\' =>
- array (
- 0 => __DIR__ . '/..' . '/topthink/think-migration/phinx/src/Phinx',
- ),
- 'PHPSocketIO\\' =>
- array (
- 0 => __DIR__ . '/..' . '/workerman/phpsocket.io/src',
- ),
'PHPMailer\\PHPMailer\\' =>
array (
0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src',
),
- 'League\\MimeTypeDetection\\' =>
- array (
- 0 => __DIR__ . '/..' . '/league/mime-type-detection/src',
- ),
- 'League\\Flysystem\\' =>
- array (
- 0 => __DIR__ . '/..' . '/league/flysystem/src',
- ),
- 'Laravel\\SerializableClosure\\' =>
- array (
- 0 => __DIR__ . '/..' . '/laravel/serializable-closure/src',
- ),
- 'Jaeger\\' =>
- array (
- 0 => __DIR__ . '/..' . '/jaeger/g-http/src',
- ),
- 'Invoker\\' =>
- array (
- 0 => __DIR__ . '/..' . '/php-di/invoker/src',
- ),
'GuzzleHttp\\Psr7\\' =>
array (
0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
@@ -318,38 +134,6 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
array (
0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
),
- 'Endroid\\QrCode\\' =>
- array (
- 0 => __DIR__ . '/..' . '/endroid/qr-code/src',
- ),
- 'DI\\' =>
- array (
- 0 => __DIR__ . '/..' . '/php-di/php-di/src',
- ),
- 'DASPRiD\\Enum\\' =>
- array (
- 0 => __DIR__ . '/..' . '/dasprid/enum/src',
- ),
- 'Channel\\' =>
- array (
- 0 => __DIR__ . '/..' . '/workerman/channel/src',
- ),
- 'Cache\\TagInterop\\' =>
- array (
- 0 => __DIR__ . '/..' . '/cache/tag-interop',
- ),
- 'Cache\\Adapter\\Filesystem\\' =>
- array (
- 0 => __DIR__ . '/..' . '/cache/filesystem-adapter',
- ),
- 'Cache\\Adapter\\Common\\' =>
- array (
- 0 => __DIR__ . '/..' . '/cache/adapter-common',
- ),
- 'BaconQrCode\\' =>
- array (
- 0 => __DIR__ . '/..' . '/bacon/bacon-qr-code/src',
- ),
);
public static $fallbackDirsPsr0 = array (
@@ -357,34 +141,16 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
);
public static $classMap = array (
- 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
- 'Callback' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
- 'CallbackBody' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
- 'CallbackParam' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
- 'CallbackParameterToReference' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
- 'CallbackReturnReference' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
- 'CallbackReturnValue' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
- 'DOMDocumentWrapper' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
- 'DOMEvent' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
- 'ICallbackNamed' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
- 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
- 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
- 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
- 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
- 'phpQuery' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
- 'phpQueryEvents' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
- 'phpQueryObject' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
- 'phpQueryPlugins' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
- $loader->prefixLengthsPsr4 = ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$prefixLengthsPsr4;
- $loader->prefixDirsPsr4 = ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$prefixDirsPsr4;
- $loader->fallbackDirsPsr0 = ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$fallbackDirsPsr0;
- $loader->classMap = ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$classMap;
+ $loader->prefixLengthsPsr4 = ComposerStaticInitbd5d3d6d2646baf3ad0aa6db972a53b0::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInitbd5d3d6d2646baf3ad0aa6db972a53b0::$prefixDirsPsr4;
+ $loader->fallbackDirsPsr0 = ComposerStaticInitbd5d3d6d2646baf3ad0aa6db972a53b0::$fallbackDirsPsr0;
+ $loader->classMap = ComposerStaticInitbd5d3d6d2646baf3ad0aa6db972a53b0::$classMap;
}, null, ClassLoader::class);
}
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 9c34d1c..e687037 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -1,448 +1,50 @@
{
"packages": [
- {
- "name": "bacon/bacon-qr-code",
- "version": "2.0.8",
- "version_normalized": "2.0.8.0",
- "source": {
- "type": "git",
- "url": "https://github.com/Bacon/BaconQrCode.git",
- "reference": "8674e51bb65af933a5ffaf1c308a660387c35c22"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/8674e51bb65af933a5ffaf1c308a660387c35c22",
- "reference": "8674e51bb65af933a5ffaf1c308a660387c35c22",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "dasprid/enum": "^1.0.3",
- "ext-iconv": "*",
- "php": "^7.1 || ^8.0"
- },
- "require-dev": {
- "phly/keep-a-changelog": "^2.1",
- "phpunit/phpunit": "^7 | ^8 | ^9",
- "spatie/phpunit-snapshot-assertions": "^4.2.9",
- "squizlabs/php_codesniffer": "^3.4"
- },
- "suggest": {
- "ext-imagick": "to generate QR code images"
- },
- "time": "2022-12-07T17:46:57+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "BaconQrCode\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-2-Clause"
- ],
- "authors": [
- {
- "name": "Ben Scholzen 'DASPRiD'",
- "email": "mail@dasprids.de",
- "homepage": "https://dasprids.de/",
- "role": "Developer"
- }
- ],
- "description": "BaconQrCode is a QR code generator for PHP.",
- "homepage": "https://github.com/Bacon/BaconQrCode",
- "support": {
- "issues": "https://github.com/Bacon/BaconQrCode/issues",
- "source": "https://github.com/Bacon/BaconQrCode/tree/2.0.8"
- },
- "install-path": "../bacon/bacon-qr-code"
- },
- {
- "name": "cache/adapter-common",
- "version": "1.3.0",
- "version_normalized": "1.3.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-cache/adapter-common.git",
- "reference": "8788309be72aa7be69b88cdc0687549c74a7d479"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-cache/adapter-common/zipball/8788309be72aa7be69b88cdc0687549c74a7d479",
- "reference": "8788309be72aa7be69b88cdc0687549c74a7d479",
- "shasum": ""
- },
- "require": {
- "cache/tag-interop": "^1.0",
- "php": ">=7.4",
- "psr/cache": "^1.0 || ^2.0",
- "psr/log": "^1.0 || ^2.0 || ^3.0",
- "psr/simple-cache": "^1.0"
- },
- "require-dev": {
- "cache/integration-tests": "^0.17",
- "phpunit/phpunit": "^7.5.20 || ^9.5.10"
- },
- "time": "2022-01-15T15:47:19+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Cache\\Adapter\\Common\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Aaron Scherer",
- "email": "aequasi@gmail.com",
- "homepage": "https://github.com/aequasi"
- },
- {
- "name": "Tobias Nyholm",
- "email": "tobias.nyholm@gmail.com",
- "homepage": "https://github.com/nyholm"
- }
- ],
- "description": "Common classes for PSR-6 adapters",
- "homepage": "http://www.php-cache.com/en/latest/",
- "keywords": [
- "cache",
- "psr-6",
- "tag"
- ],
- "support": {
- "source": "https://github.com/php-cache/adapter-common/tree/1.3.0"
- },
- "install-path": "../cache/adapter-common"
- },
- {
- "name": "cache/filesystem-adapter",
- "version": "1.2.0",
- "version_normalized": "1.2.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-cache/filesystem-adapter.git",
- "reference": "f1faaae40aaa696ef899cef6f6888aedb90b419b"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-cache/filesystem-adapter/zipball/f1faaae40aaa696ef899cef6f6888aedb90b419b",
- "reference": "f1faaae40aaa696ef899cef6f6888aedb90b419b",
- "shasum": ""
- },
- "require": {
- "cache/adapter-common": "^1.0",
- "league/flysystem": "^1.0",
- "php": ">=7.4",
- "psr/cache": "^1.0 || ^2.0",
- "psr/simple-cache": "^1.0"
- },
- "provide": {
- "psr/cache-implementation": "^1.0",
- "psr/simple-cache-implementation": "^1.0"
- },
- "require-dev": {
- "cache/integration-tests": "^0.17",
- "phpunit/phpunit": "^7.5.20 || ^9.5.10"
- },
- "time": "2022-01-15T15:47:19+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Cache\\Adapter\\Filesystem\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Aaron Scherer",
- "email": "aequasi@gmail.com",
- "homepage": "https://github.com/aequasi"
- },
- {
- "name": "Tobias Nyholm",
- "email": "tobias.nyholm@gmail.com",
- "homepage": "https://github.com/nyholm"
- }
- ],
- "description": "A PSR-6 cache implementation using filesystem. This implementation supports tags",
- "homepage": "http://www.php-cache.com/en/latest/",
- "keywords": [
- "cache",
- "filesystem",
- "psr-6",
- "tag"
- ],
- "support": {
- "source": "https://github.com/php-cache/filesystem-adapter/tree/1.2.0"
- },
- "install-path": "../cache/filesystem-adapter"
- },
- {
- "name": "cache/tag-interop",
- "version": "1.1.0",
- "version_normalized": "1.1.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-cache/tag-interop.git",
- "reference": "b062b1d735357da50edf8387f7a8696f3027d328"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-cache/tag-interop/zipball/b062b1d735357da50edf8387f7a8696f3027d328",
- "reference": "b062b1d735357da50edf8387f7a8696f3027d328",
- "shasum": ""
- },
- "require": {
- "php": "^5.5 || ^7.0 || ^8.0",
- "psr/cache": "^1.0 || ^2.0"
- },
- "time": "2021-12-31T10:03:23+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Cache\\TagInterop\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Tobias Nyholm",
- "email": "tobias.nyholm@gmail.com",
- "homepage": "https://github.com/nyholm"
- },
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com",
- "homepage": "https://github.com/nicolas-grekas"
- }
- ],
- "description": "Framework interoperable interfaces for tags",
- "homepage": "https://www.php-cache.com/en/latest/",
- "keywords": [
- "cache",
- "psr",
- "psr6",
- "tag"
- ],
- "support": {
- "issues": "https://github.com/php-cache/tag-interop/issues",
- "source": "https://github.com/php-cache/tag-interop/tree/1.1.0"
- },
- "install-path": "../cache/tag-interop"
- },
- {
- "name": "dasprid/enum",
- "version": "1.0.4",
- "version_normalized": "1.0.4.0",
- "source": {
- "type": "git",
- "url": "https://github.com/DASPRiD/Enum.git",
- "reference": "8e6b6ea76eabbf19ea2bf5b67b98e1860474012f"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/DASPRiD/Enum/zipball/8e6b6ea76eabbf19ea2bf5b67b98e1860474012f",
- "reference": "8e6b6ea76eabbf19ea2bf5b67b98e1860474012f",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "php": ">=7.1 <9.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^7 | ^8 | ^9",
- "squizlabs/php_codesniffer": "*"
- },
- "time": "2023-03-01T18:44:03+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "DASPRiD\\Enum\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-2-Clause"
- ],
- "authors": [
- {
- "name": "Ben Scholzen 'DASPRiD'",
- "email": "mail@dasprids.de",
- "homepage": "https://dasprids.de/",
- "role": "Developer"
- }
- ],
- "description": "PHP 7.1 enum implementation",
- "keywords": [
- "enum",
- "map"
- ],
- "support": {
- "issues": "https://github.com/DASPRiD/Enum/issues",
- "source": "https://github.com/DASPRiD/Enum/tree/1.0.4"
- },
- "install-path": "../dasprid/enum"
- },
- {
- "name": "endroid/qr-code",
- "version": "4.6.1",
- "version_normalized": "4.6.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/endroid/qr-code.git",
- "reference": "a75c913b0e4d6ad275e49a2c1de1cacffc6c2184"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/endroid/qr-code/zipball/a75c913b0e4d6ad275e49a2c1de1cacffc6c2184",
- "reference": "a75c913b0e4d6ad275e49a2c1de1cacffc6c2184",
- "shasum": ""
- },
- "require": {
- "bacon/bacon-qr-code": "^2.0.5",
- "php": "^7.4||^8.0"
- },
- "require-dev": {
- "endroid/quality": "dev-master",
- "ext-gd": "*",
- "khanamiryan/qrcode-detector-decoder": "^1.0.4",
- "setasign/fpdf": "^1.8.2"
- },
- "suggest": {
- "ext-gd": "Enables you to write PNG images",
- "khanamiryan/qrcode-detector-decoder": "Enables you to use the image validator",
- "roave/security-advisories": "Makes sure package versions with known security issues are not installed",
- "setasign/fpdf": "Enables you to use the PDF writer"
- },
- "time": "2022-10-26T08:48:17+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.x-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Endroid\\QrCode\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jeroen van den Enden",
- "email": "info@endroid.nl"
- }
- ],
- "description": "Endroid QR Code",
- "homepage": "https://github.com/endroid/qr-code",
- "keywords": [
- "code",
- "endroid",
- "php",
- "qr",
- "qrcode"
- ],
- "support": {
- "issues": "https://github.com/endroid/qr-code/issues",
- "source": "https://github.com/endroid/qr-code/tree/4.6.1"
- },
- "funding": [
- {
- "url": "https://github.com/endroid",
- "type": "github"
- }
- ],
- "install-path": "../endroid/qr-code"
- },
{
"name": "guzzlehttp/guzzle",
- "version": "7.0.0",
- "version_normalized": "7.0.0.0",
+ "version": "7.7.0",
+ "version_normalized": "7.7.0.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "414c24961042f6616fb43e23fa69a785f9fc053e"
+ "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/414c24961042f6616fb43e23fa69a785f9fc053e",
- "reference": "414c24961042f6616fb43e23fa69a785f9fc053e",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5",
+ "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5",
"shasum": ""
},
"require": {
"ext-json": "*",
- "guzzlehttp/promises": "^1.0",
- "guzzlehttp/psr7": "^1.6.1",
- "php": "^7.2.5",
- "psr/http-client": "^1.0"
+ "guzzlehttp/promises": "^1.5.3 || ^2.0",
+ "guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
+ "php": "^7.2.5 || ^8.0",
+ "psr/http-client": "^1.0",
+ "symfony/deprecation-contracts": "^2.2 || ^3.0"
},
"provide": {
"psr/http-client-implementation": "1.0"
},
"require-dev": {
- "ergebnis/composer-normalize": "^2.0",
+ "bamarni/composer-bin-plugin": "^1.8.1",
"ext-curl": "*",
- "php-http/client-integration-tests": "dev-phpunit8",
- "phpunit/phpunit": "^8.5.5",
- "psr/log": "^1.1"
+ "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999",
+ "php-http/message-factory": "^1.1",
+ "phpunit/phpunit": "^8.5.29 || ^9.5.23",
+ "psr/log": "^1.1 || ^2.0 || ^3.0"
},
"suggest": {
"ext-curl": "Required for CURL handler support",
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
"psr/log": "Required for using the Log middleware"
},
- "time": "2020-06-27T08:47:54+00:00",
+ "time": "2023-05-21T14:04:53+00:00",
"type": "library",
"extra": {
- "branch-alias": {
- "dev-master": "7.0-dev"
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
}
},
"installation-source": "dist",
@@ -459,19 +61,43 @@
"MIT"
],
"authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
+ {
+ "name": "Jeremy Lindblom",
+ "email": "jeremeamia@gmail.com",
+ "homepage": "https://github.com/jeremeamia"
+ },
+ {
+ "name": "George Mponos",
+ "email": "gmponos@gmail.com",
+ "homepage": "https://github.com/gmponos"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ },
{
"name": "Márk Sági-Kazár",
"email": "mark.sagikazar@gmail.com",
- "homepage": "https://sagikazarmark.hu"
+ "homepage": "https://github.com/sagikazarmark"
+ },
+ {
+ "name": "Tobias Schultze",
+ "email": "webmaster@tubo-world.de",
+ "homepage": "https://github.com/Tobion"
}
],
"description": "Guzzle is a PHP HTTP client library",
- "homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
@@ -485,44 +111,56 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
- "source": "https://github.com/guzzle/guzzle/tree/master"
+ "source": "https://github.com/guzzle/guzzle/tree/7.7.0"
},
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/Nyholm",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle",
+ "type": "tidelift"
+ }
+ ],
"install-path": "../guzzlehttp/guzzle"
},
{
"name": "guzzlehttp/promises",
- "version": "1.5.3",
- "version_normalized": "1.5.3.0",
+ "version": "2.0.0",
+ "version_normalized": "2.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
- "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e"
+ "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e",
- "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/3a494dc7dc1d7d12e511890177ae2d0e6c107da6",
+ "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6",
+ "shasum": ""
},
"require": {
- "php": ">=5.5"
+ "php": "^7.2.5 || ^8.0"
},
"require-dev": {
- "symfony/phpunit-bridge": "^4.4 || ^5.1"
+ "bamarni/composer-bin-plugin": "^1.8.1",
+ "phpunit/phpunit": "^8.5.29 || ^9.5.23"
},
- "time": "2023-05-21T12:31:43+00:00",
+ "time": "2023-05-21T13:50:22+00:00",
"type": "library",
+ "extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ }
+ },
"installation-source": "dist",
"autoload": {
- "files": [
- "src/functions_include.php"
- ],
"psr-4": {
"GuzzleHttp\\Promise\\": "src/"
}
@@ -559,7 +197,7 @@
],
"support": {
"issues": "https://github.com/guzzle/promises/issues",
- "source": "https://github.com/guzzle/promises/tree/1.5.3"
+ "source": "https://github.com/guzzle/promises/tree/2.0.0"
},
"funding": [
{
@@ -579,47 +217,47 @@
},
{
"name": "guzzlehttp/psr7",
- "version": "1.9.1",
- "version_normalized": "1.9.1.0",
+ "version": "2.5.0",
+ "version_normalized": "2.5.0.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b"
+ "reference": "b635f279edd83fc275f822a1188157ffea568ff6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b",
- "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6",
+ "reference": "b635f279edd83fc275f822a1188157ffea568ff6",
+ "shasum": ""
},
"require": {
- "php": ">=5.4.0",
- "psr/http-message": "~1.0",
- "ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
+ "php": "^7.2.5 || ^8.0",
+ "psr/http-factory": "^1.0",
+ "psr/http-message": "^1.1 || ^2.0",
+ "ralouphie/getallheaders": "^3.0"
},
"provide": {
+ "psr/http-factory-implementation": "1.0",
"psr/http-message-implementation": "1.0"
},
"require-dev": {
- "ext-zlib": "*",
- "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10"
+ "bamarni/composer-bin-plugin": "^1.8.1",
+ "http-interop/http-factory-tests": "^0.9",
+ "phpunit/phpunit": "^8.5.29 || ^9.5.23"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
- "time": "2023-04-17T16:00:37+00:00",
+ "time": "2023-04-17T16:11:26+00:00",
"type": "library",
+ "extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ }
+ },
"installation-source": "dist",
"autoload": {
- "files": [
- "src/functions_include.php"
- ],
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
}
@@ -658,6 +296,11 @@
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://sagikazarmark.hu"
}
],
"description": "PSR-7 message implementation that also provides common utility methods",
@@ -673,7 +316,7 @@
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
- "source": "https://github.com/guzzle/psr7/tree/1.9.1"
+ "source": "https://github.com/guzzle/psr7/tree/2.5.0"
},
"funding": [
{
@@ -691,707 +334,6 @@
],
"install-path": "../guzzlehttp/psr7"
},
- {
- "name": "jaeger/g-http",
- "version": "V1.7.2",
- "version_normalized": "1.7.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/jae-jae/GHttp.git",
- "reference": "82585ddd5e2c6651e37ab1d8166efcdbb6b293d4"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/jae-jae/GHttp/zipball/82585ddd5e2c6651e37ab1d8166efcdbb6b293d4",
- "reference": "82585ddd5e2c6651e37ab1d8166efcdbb6b293d4",
- "shasum": ""
- },
- "require": {
- "cache/filesystem-adapter": "^1",
- "guzzlehttp/guzzle": "^6.0 | ^7.0"
- },
- "time": "2021-08-08T04:59:44+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Jaeger\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jaeger",
- "email": "JaegerCode@gmail.com"
- }
- ],
- "description": "Simple Http client base on GuzzleHttp",
- "support": {
- "issues": "https://github.com/jae-jae/GHttp/issues",
- "source": "https://github.com/jae-jae/GHttp/tree/V1.7.2"
- },
- "install-path": "../jaeger/g-http"
- },
- {
- "name": "jaeger/phpquery-single",
- "version": "1.1.1",
- "version_normalized": "1.1.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/jae-jae/phpQuery-single.git",
- "reference": "39a650ade692a6b480c22220dce0c198d6a946fb"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/jae-jae/phpQuery-single/zipball/39a650ade692a6b480c22220dce0c198d6a946fb",
- "reference": "39a650ade692a6b480c22220dce0c198d6a946fb",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "time": "2022-03-26T15:01:16+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "classmap": [
- "phpQuery.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Tobiasz Cudnik",
- "email": "tobiasz.cudnik@gmail.com",
- "homepage": "https://github.com/TobiaszCudnik",
- "role": "Developer"
- },
- {
- "name": "Jaeger",
- "role": "Packager"
- }
- ],
- "description": "phpQuery单文件版本,是Querylist的依赖(http://querylist.cc/),phpQuery项目主页:http://code.google.com/p/phpquery/",
- "homepage": "http://code.google.com/p/phpquery/",
- "support": {
- "issues": "https://github.com/jae-jae/phpQuery-single/issues",
- "source": "https://github.com/jae-jae/phpQuery-single/tree/1.1.1"
- },
- "install-path": "../jaeger/phpquery-single"
- },
- {
- "name": "jaeger/querylist",
- "version": "V4.2.8",
- "version_normalized": "4.2.8.0",
- "source": {
- "type": "git",
- "url": "https://github.com/jae-jae/QueryList.git",
- "reference": "39dc0ca9c668bec7a793e20472ccd7d26ef89ea4"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/jae-jae/QueryList/zipball/39dc0ca9c668bec7a793e20472ccd7d26ef89ea4",
- "reference": "39dc0ca9c668bec7a793e20472ccd7d26ef89ea4",
- "shasum": ""
- },
- "require": {
- "ext-dom": "*",
- "jaeger/g-http": "^1.1",
- "jaeger/phpquery-single": "^1",
- "php": ">=7.1",
- "tightenco/collect": ">5.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^8.5",
- "symfony/var-dumper": "^3.3"
- },
- "time": "2021-07-05T06:07:58+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "QL\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jaeger",
- "email": "JaegerCode@gmail.com"
- }
- ],
- "description": "Simple, elegant, extensible PHP Web Scraper (crawler/spider),Use the css3 dom selector,Based on phpQuery! 简洁、优雅、可扩展的PHP采集工具(爬虫),基于phpQuery。",
- "homepage": "http://querylist.cc",
- "keywords": [
- "QueryList",
- "phpQuery",
- "spider"
- ],
- "support": {
- "issues": "https://github.com/jae-jae/QueryList/issues",
- "source": "https://github.com/jae-jae/QueryList/tree/V4.2.8"
- },
- "funding": [
- {
- "url": "https://opencollective.com/querylist",
- "type": "open_collective"
- }
- ],
- "install-path": "../jaeger/querylist"
- },
- {
- "name": "laravel/serializable-closure",
- "version": "v1.3.0",
- "version_normalized": "1.3.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/laravel/serializable-closure.git",
- "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f23fe9d4e95255dacee1bf3525e0810d1a1b0f37",
- "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37",
- "shasum": ""
- },
- "require": {
- "php": "^7.3|^8.0"
- },
- "require-dev": {
- "nesbot/carbon": "^2.61",
- "pestphp/pest": "^1.21.3",
- "phpstan/phpstan": "^1.8.2",
- "symfony/var-dumper": "^5.4.11"
- },
- "time": "2023-01-30T18:31:20+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.x-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Laravel\\SerializableClosure\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Taylor Otwell",
- "email": "taylor@laravel.com"
- },
- {
- "name": "Nuno Maduro",
- "email": "nuno@laravel.com"
- }
- ],
- "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.",
- "keywords": [
- "closure",
- "laravel",
- "serializable"
- ],
- "support": {
- "issues": "https://github.com/laravel/serializable-closure/issues",
- "source": "https://github.com/laravel/serializable-closure"
- },
- "install-path": "../laravel/serializable-closure"
- },
- {
- "name": "league/flysystem",
- "version": "1.1.10",
- "version_normalized": "1.1.10.0",
- "source": {
- "type": "git",
- "url": "https://github.com/thephpleague/flysystem.git",
- "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1",
- "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "ext-fileinfo": "*",
- "league/mime-type-detection": "^1.3",
- "php": "^7.2.5 || ^8.0"
- },
- "conflict": {
- "league/flysystem-sftp": "<1.0.6"
- },
- "require-dev": {
- "phpspec/prophecy": "^1.11.1",
- "phpunit/phpunit": "^8.5.8"
- },
- "suggest": {
- "ext-ftp": "Allows you to use FTP server storage",
- "ext-openssl": "Allows you to use FTPS server storage",
- "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
- "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",
- "league/flysystem-azure": "Allows you to use Windows Azure Blob storage",
- "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching",
- "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem",
- "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
- "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib",
- "league/flysystem-webdav": "Allows you to use WebDAV storage",
- "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter",
- "spatie/flysystem-dropbox": "Allows you to use Dropbox storage",
- "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications"
- },
- "time": "2022-10-04T09:16:37+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "League\\Flysystem\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Frank de Jonge",
- "email": "info@frenky.net"
- }
- ],
- "description": "Filesystem abstraction: Many filesystems, one API.",
- "keywords": [
- "Cloud Files",
- "WebDAV",
- "abstraction",
- "aws",
- "cloud",
- "copy.com",
- "dropbox",
- "file systems",
- "files",
- "filesystem",
- "filesystems",
- "ftp",
- "rackspace",
- "remote",
- "s3",
- "sftp",
- "storage"
- ],
- "support": {
- "issues": "https://github.com/thephpleague/flysystem/issues",
- "source": "https://github.com/thephpleague/flysystem/tree/1.1.10"
- },
- "funding": [
- {
- "url": "https://offset.earth/frankdejonge",
- "type": "other"
- }
- ],
- "install-path": "../league/flysystem"
- },
- {
- "name": "league/mime-type-detection",
- "version": "1.11.0",
- "version_normalized": "1.11.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/thephpleague/mime-type-detection.git",
- "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd",
- "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd",
- "shasum": ""
- },
- "require": {
- "ext-fileinfo": "*",
- "php": "^7.2 || ^8.0"
- },
- "require-dev": {
- "friendsofphp/php-cs-fixer": "^3.2",
- "phpstan/phpstan": "^0.12.68",
- "phpunit/phpunit": "^8.5.8 || ^9.3"
- },
- "time": "2022-04-17T13:12:02+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "League\\MimeTypeDetection\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Frank de Jonge",
- "email": "info@frankdejonge.nl"
- }
- ],
- "description": "Mime-type detection for Flysystem",
- "support": {
- "issues": "https://github.com/thephpleague/mime-type-detection/issues",
- "source": "https://github.com/thephpleague/mime-type-detection/tree/1.11.0"
- },
- "funding": [
- {
- "url": "https://github.com/frankdejonge",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/league/flysystem",
- "type": "tidelift"
- }
- ],
- "install-path": "../league/mime-type-detection"
- },
- {
- "name": "liliuwei/thinkphp-social",
- "version": "v1.3",
- "version_normalized": "1.3.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/liliuwei/thinkphp-social.git",
- "reference": "2067fc2c2cc3b3d109602bc19c3e5a99c5f4c970"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/liliuwei/thinkphp-social/zipball/2067fc2c2cc3b3d109602bc19c3e5a99c5f4c970",
- "reference": "2067fc2c2cc3b3d109602bc19c3e5a99c5f4c970",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "php": ">=5.6.0",
- "topthink/framework": "^5.1 || ^6.0",
- "topthink/think-installer": "^2.0"
- },
- "time": "2021-01-13T05:11:12+00:00",
- "type": "think-extend",
- "extra": {
- "think-config": {
- "social": "src/config/config.php"
- },
- "think": {
- "config": {
- "social": "src/config/config.php"
- }
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "liliuwei\\social\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "liliuwei",
- "email": "974829947@qq.com"
- }
- ],
- "description": "适用于thinkphp5.1和6.0的社会化登录扩展",
- "keywords": [
- "Facebook登录",
- "Gitee登录",
- "Github登录",
- "Google登录",
- "Oschina登录",
- "QQ登录",
- "oauth",
- "think-social",
- "thinkphp",
- "thinkphp-social",
- "thinkphp5.1",
- "thinkphp6.0",
- "小米登录",
- "微信登录",
- "抖音登录",
- "新浪登录",
- "淘宝登录",
- "百度登录",
- "第三方授权登录",
- "谷歌登录",
- "钉钉登录"
- ],
- "support": {
- "issues": "https://github.com/liliuwei/thinkphp-social/issues",
- "source": "https://github.com/liliuwei/thinkphp-social/tree/v1.3"
- },
- "install-path": "../liliuwei/thinkphp-social"
- },
- {
- "name": "lotofbadcode/phpspirit_databackup",
- "version": "v1.2",
- "version_normalized": "1.2.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/lotofbadcode/phpspirit_databackup.git",
- "reference": "77c2421f8461392c044cf8c29918f495c22a5612"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/lotofbadcode/phpspirit_databackup/zipball/77c2421f8461392c044cf8c29918f495c22a5612",
- "reference": "77c2421f8461392c044cf8c29918f495c22a5612",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "php": ">=7.0"
- },
- "time": "2023-05-12T12:02:05+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "phpspirit\\databackup\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "代码庸医",
- "email": "3359964266@qq.com"
- }
- ],
- "description": "一个PHP数据库备份恢复的插件",
- "keywords": [
- "library",
- "php"
- ],
- "support": {
- "issues": "https://github.com/lotofbadcode/phpspirit_databackup/issues",
- "source": "https://github.com/lotofbadcode/phpspirit_databackup/tree/v1.2"
- },
- "install-path": "../lotofbadcode/phpspirit_databackup"
- },
- {
- "name": "php-di/invoker",
- "version": "2.3.3",
- "version_normalized": "2.3.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/PHP-DI/Invoker.git",
- "reference": "cd6d9f267d1a3474bdddf1be1da079f01b942786"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/cd6d9f267d1a3474bdddf1be1da079f01b942786",
- "reference": "cd6d9f267d1a3474bdddf1be1da079f01b942786",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3",
- "psr/container": "^1.0|^2.0"
- },
- "require-dev": {
- "athletic/athletic": "~0.1.8",
- "mnapoli/hard-mode": "~0.3.0",
- "phpunit/phpunit": "^9.0"
- },
- "time": "2021-12-13T09:22:56+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Invoker\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "Generic and extensible callable invoker",
- "homepage": "https://github.com/PHP-DI/Invoker",
- "keywords": [
- "callable",
- "dependency",
- "dependency-injection",
- "injection",
- "invoke",
- "invoker"
- ],
- "support": {
- "issues": "https://github.com/PHP-DI/Invoker/issues",
- "source": "https://github.com/PHP-DI/Invoker/tree/2.3.3"
- },
- "funding": [
- {
- "url": "https://github.com/mnapoli",
- "type": "github"
- }
- ],
- "install-path": "../php-di/invoker"
- },
- {
- "name": "php-di/php-di",
- "version": "6.4.0",
- "version_normalized": "6.4.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/PHP-DI/PHP-DI.git",
- "reference": "ae0f1b3b03d8b29dff81747063cbfd6276246cc4"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/ae0f1b3b03d8b29dff81747063cbfd6276246cc4",
- "reference": "ae0f1b3b03d8b29dff81747063cbfd6276246cc4",
- "shasum": ""
- },
- "require": {
- "laravel/serializable-closure": "^1.0",
- "php": ">=7.4.0",
- "php-di/invoker": "^2.0",
- "php-di/phpdoc-reader": "^2.0.1",
- "psr/container": "^1.0"
- },
- "provide": {
- "psr/container-implementation": "^1.0"
- },
- "require-dev": {
- "doctrine/annotations": "~1.10",
- "friendsofphp/php-cs-fixer": "^2.4",
- "mnapoli/phpunit-easymock": "^1.2",
- "ocramius/proxy-manager": "^2.11.2",
- "phpstan/phpstan": "^0.12",
- "phpunit/phpunit": "^9.5"
- },
- "suggest": {
- "doctrine/annotations": "Install it if you want to use annotations (version ~1.2)",
- "ocramius/proxy-manager": "Install it if you want to use lazy injection (version ~2.0)"
- },
- "time": "2022-04-09T16:46:38+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "files": [
- "src/functions.php"
- ],
- "psr-4": {
- "DI\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "The dependency injection container for humans",
- "homepage": "https://php-di.org/",
- "keywords": [
- "PSR-11",
- "container",
- "container-interop",
- "dependency injection",
- "di",
- "ioc",
- "psr11"
- ],
- "support": {
- "issues": "https://github.com/PHP-DI/PHP-DI/issues",
- "source": "https://github.com/PHP-DI/PHP-DI/tree/6.4.0"
- },
- "funding": [
- {
- "url": "https://github.com/mnapoli",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/php-di/php-di",
- "type": "tidelift"
- }
- ],
- "install-path": "../php-di/php-di"
- },
- {
- "name": "php-di/phpdoc-reader",
- "version": "2.2.1",
- "version_normalized": "2.2.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/PHP-DI/PhpDocReader.git",
- "reference": "66daff34cbd2627740ffec9469ffbac9f8c8185c"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/PHP-DI/PhpDocReader/zipball/66daff34cbd2627740ffec9469ffbac9f8c8185c",
- "reference": "66daff34cbd2627740ffec9469ffbac9f8c8185c",
- "shasum": ""
- },
- "require": {
- "php": ">=7.2.0"
- },
- "require-dev": {
- "mnapoli/hard-mode": "~0.3.0",
- "phpunit/phpunit": "^8.5|^9.0"
- },
- "time": "2020-10-12T12:39:22+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "PhpDocReader\\": "src/PhpDocReader"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)",
- "keywords": [
- "phpdoc",
- "reflection"
- ],
- "support": {
- "issues": "https://github.com/PHP-DI/PhpDocReader/issues",
- "source": "https://github.com/PHP-DI/PhpDocReader/tree/2.2.1"
- },
- "install-path": "../php-di/phpdoc-reader"
- },
{
"name": "phpmailer/phpmailer",
"version": "v6.8.0",
@@ -1475,87 +417,31 @@
],
"install-path": "../phpmailer/phpmailer"
},
- {
- "name": "psr/cache",
- "version": "1.0.1",
- "version_normalized": "1.0.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/cache.git",
- "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
- "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "php": ">=5.3.0"
- },
- "time": "2016-08-06T20:24:11+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Psr\\Cache\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interface for caching libraries",
- "keywords": [
- "cache",
- "psr",
- "psr-6"
- ],
- "install-path": "../psr/cache"
- },
{
"name": "psr/container",
- "version": "1.1.2",
- "version_normalized": "1.1.2.0",
+ "version": "2.0.2",
+ "version_normalized": "2.0.2.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
- "reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
+ "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
- "reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963",
+ "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963",
+ "shasum": ""
},
"require": {
"php": ">=7.4.0"
},
- "time": "2021-11-05T16:50:12+00:00",
+ "time": "2021-11-05T16:47:00+00:00",
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
"installation-source": "dist",
"autoload": {
"psr-4": {
@@ -1583,63 +469,10 @@
],
"support": {
"issues": "https://github.com/php-fig/container/issues",
- "source": "https://github.com/php-fig/container/tree/1.1.2"
+ "source": "https://github.com/php-fig/container/tree/2.0.2"
},
"install-path": "../psr/container"
},
- {
- "name": "psr/event-dispatcher",
- "version": "1.0.0",
- "version_normalized": "1.0.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/event-dispatcher.git",
- "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0",
- "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0",
- "shasum": ""
- },
- "require": {
- "php": ">=7.2.0"
- },
- "time": "2019-01-08T18:20:26+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Psr\\EventDispatcher\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Standard interfaces for event handling.",
- "keywords": [
- "events",
- "psr",
- "psr-14"
- ],
- "support": {
- "issues": "https://github.com/php-fig/event-dispatcher/issues",
- "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0"
- },
- "install-path": "../psr/event-dispatcher"
- },
{
"name": "psr/http-client",
"version": "1.0.2",
@@ -1695,6 +528,64 @@
},
"install-path": "../psr/http-client"
},
+ {
+ "name": "psr/http-factory",
+ "version": "1.0.2",
+ "version_normalized": "1.0.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-factory.git",
+ "reference": "e616d01114759c4c489f93b099585439f795fe35"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35",
+ "reference": "e616d01114759c4c489f93b099585439f795fe35",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.0.0",
+ "psr/http-message": "^1.0 || ^2.0"
+ },
+ "time": "2023-04-10T20:10:41+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interfaces for PSR-7 HTTP message factories",
+ "keywords": [
+ "factory",
+ "http",
+ "message",
+ "psr",
+ "psr-17",
+ "psr-7",
+ "request",
+ "response"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/http-factory/tree/1.0.2"
+ },
+ "install-path": "../psr/http-factory"
+ },
{
"name": "psr/http-message",
"version": "1.1",
@@ -1708,13 +599,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
@@ -1759,39 +644,33 @@
},
{
"name": "psr/log",
- "version": "1.1.4",
- "version_normalized": "1.1.4.0",
+ "version": "3.0.0",
+ "version_normalized": "3.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
- "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
+ "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
- "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001",
+ "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001",
+ "shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=8.0.0"
},
- "time": "2021-05-03T11:20:27+00:00",
+ "time": "2021-07-14T16:46:02+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "3.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
- "Psr\\Log\\": "Psr/Log/"
+ "Psr\\Log\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1812,39 +691,33 @@
"psr-3"
],
"support": {
- "source": "https://github.com/php-fig/log/tree/1.1.4"
+ "source": "https://github.com/php-fig/log/tree/3.0.0"
},
"install-path": "../psr/log"
},
{
"name": "psr/simple-cache",
- "version": "1.0.1",
- "version_normalized": "1.0.1.0",
+ "version": "3.0.0",
+ "version_normalized": "3.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/simple-cache.git",
- "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
+ "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
- "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865",
+ "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865",
+ "shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=8.0.0"
},
- "time": "2017-10-23T01:57:42+00:00",
+ "time": "2021-10-29T13:26:27+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "3.0.x-dev"
}
},
"installation-source": "dist",
@@ -1860,7 +733,7 @@
"authors": [
{
"name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "homepage": "https://www.php-fig.org/"
}
],
"description": "Common interfaces for simple caching",
@@ -1871,6 +744,9 @@
"psr-16",
"simple-cache"
],
+ "support": {
+ "source": "https://github.com/php-fig/simple-cache/tree/3.0.0"
+ },
"install-path": "../psr/simple-cache"
},
{
@@ -1921,331 +797,38 @@
"install-path": "../ralouphie/getallheaders"
},
{
- "name": "symfony/polyfill-mbstring",
- "version": "v1.27.0",
- "version_normalized": "1.27.0.0",
+ "name": "symfony/deprecation-contracts",
+ "version": "v3.3.0",
+ "version_normalized": "3.3.0.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
+ "url": "https://github.com/symfony/deprecation-contracts.git",
+ "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
- "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf",
+ "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf",
+ "shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=8.1"
},
- "provide": {
- "ext-mbstring": "*"
- },
- "suggest": {
- "ext-mbstring": "For best performance"
- },
- "time": "2022-11-03T14:55:06+00:00",
+ "time": "2023-05-23T14:45:45+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.27-dev"
+ "dev-main": "3.4-dev"
},
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
}
},
"installation-source": "dist",
"autoload": {
"files": [
- "bootstrap.php"
- ],
- "psr-4": {
- "Symfony\\Polyfill\\Mbstring\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill for the Mbstring extension",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "mbstring",
- "polyfill",
- "portable",
- "shim"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
- },
- "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"
- }
- ],
- "install-path": "../symfony/polyfill-mbstring"
- },
- {
- "name": "symfony/polyfill-php72",
- "version": "v1.27.0",
- "version_normalized": "1.27.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-php72.git",
- "reference": "869329b1e9894268a8a61dabb69153029b7a8c97"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97",
- "reference": "869329b1e9894268a8a61dabb69153029b7a8c97",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "php": ">=7.1"
- },
- "time": "2022-11-03T14:55:06+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.27-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "files": [
- "bootstrap.php"
- ],
- "psr-4": {
- "Symfony\\Polyfill\\Php72\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "polyfill",
- "portable",
- "shim"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-php72/tree/v1.27.0"
- },
- "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"
- }
- ],
- "install-path": "../symfony/polyfill-php72"
- },
- {
- "name": "symfony/polyfill-php80",
- "version": "v1.27.0",
- "version_normalized": "1.27.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
- "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "php": ">=7.1"
- },
- "time": "2022-11-03T14:55:06+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.27-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "files": [
- "bootstrap.php"
- ],
- "psr-4": {
- "Symfony\\Polyfill\\Php80\\": ""
- },
- "classmap": [
- "Resources/stubs"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Ion Bazan",
- "email": "ion.bazan@gmail.com"
- },
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "polyfill",
- "portable",
- "shim"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0"
- },
- "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"
- }
- ],
- "install-path": "../symfony/polyfill-php80"
- },
- {
- "name": "symfony/var-dumper",
- "version": "v4.4.47",
- "version_normalized": "4.4.47.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/var-dumper.git",
- "reference": "1069c7a3fca74578022fab6f81643248d02f8e63"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1069c7a3fca74578022fab6f81643248d02f8e63",
- "reference": "1069c7a3fca74578022fab6f81643248d02f8e63",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "php": ">=7.1.3",
- "symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php72": "~1.5",
- "symfony/polyfill-php80": "^1.16"
- },
- "conflict": {
- "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
- "symfony/console": "<3.4"
- },
- "require-dev": {
- "ext-iconv": "*",
- "symfony/console": "^3.4|^4.0|^5.0",
- "symfony/process": "^4.4|^5.0",
- "twig/twig": "^1.43|^2.13|^3.0.4"
- },
- "suggest": {
- "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
- "ext-intl": "To show region name in time zone dump",
- "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
- },
- "time": "2022-10-03T15:15:11+00:00",
- "bin": [
- "Resources/bin/var-dump-server"
- ],
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "files": [
- "Resources/functions/dump.php"
- ],
- "psr-4": {
- "Symfony\\Component\\VarDumper\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
+ "function.php"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -2262,14 +845,10 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Provides mechanisms for walking through any arbitrary PHP variable",
+ "description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
- "keywords": [
- "debug",
- "dump"
- ],
"support": {
- "source": "https://github.com/symfony/var-dumper/tree/v4.4.47"
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0"
},
"funding": [
{
@@ -2285,37 +864,30 @@
"type": "tidelift"
}
],
- "install-path": "../symfony/var-dumper"
+ "install-path": "../symfony/deprecation-contracts"
},
{
"name": "symfony/var-exporter",
- "version": "v5.4.21",
- "version_normalized": "5.4.21.0",
+ "version": "v6.3.2",
+ "version_normalized": "6.3.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-exporter.git",
- "reference": "be74908a6942fdd331554b3cec27ff41b45ccad4"
+ "reference": "3400949782c0cb5b3e73aa64cfd71dde000beccc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-exporter/zipball/be74908a6942fdd331554b3cec27ff41b45ccad4",
- "reference": "be74908a6942fdd331554b3cec27ff41b45ccad4",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "url": "https://api.github.com/repos/symfony/var-exporter/zipball/3400949782c0cb5b3e73aa64cfd71dde000beccc",
+ "reference": "3400949782c0cb5b3e73aa64cfd71dde000beccc",
+ "shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/polyfill-php80": "^1.16"
+ "php": ">=8.1"
},
"require-dev": {
- "symfony/var-dumper": "^4.4.9|^5.0.9|^6.0"
+ "symfony/var-dumper": "^5.4|^6.0"
},
- "time": "2023-02-21T19:46:44+00:00",
+ "time": "2023-07-26T17:39:03+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -2348,10 +920,12 @@
"export",
"hydrate",
"instantiate",
+ "lazy-loading",
+ "proxy",
"serialize"
],
"support": {
- "source": "https://github.com/symfony/var-exporter/tree/v5.4.21"
+ "source": "https://github.com/symfony/var-exporter/tree/v6.3.2"
},
"funding": [
{
@@ -2371,27 +945,27 @@
},
{
"name": "taoser/think-addons",
- "version": "v1.0.9",
- "version_normalized": "1.0.9.0",
+ "version": "v2.0.0",
+ "version_normalized": "2.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/taoser/think-addons.git",
- "reference": "00112adf200b897deecbd1bbabc33ad22377b008"
+ "reference": "ef97225aca7f0ec1da275c4ae025686899a91ad2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/taoser/think-addons/zipball/00112adf200b897deecbd1bbabc33ad22377b008",
- "reference": "00112adf200b897deecbd1bbabc33ad22377b008",
+ "url": "https://api.github.com/repos/taoser/think-addons/zipball/ef97225aca7f0ec1da275c4ae025686899a91ad2",
+ "reference": "ef97225aca7f0ec1da275c4ae025686899a91ad2",
"shasum": ""
},
"require": {
- "php": ">=7.1.0",
- "symfony/var-exporter": "^5.4",
- "topthink/framework": "^6.0",
+ "php": ">=8.0.0",
+ "symfony/var-exporter": "^6.0",
+ "topthink/framework": "^8.0",
"topthink/think-helper": "^3.0.0",
- "topthink/think-view": "^1.0"
+ "topthink/think-view": "^2.0"
},
- "time": "2023-06-10T05:08:45+00:00",
+ "time": "2023-08-02T06:40:11+00:00",
"type": "library",
"extra": {
"think": {
@@ -2422,39 +996,33 @@
"email": "changlin_zhao@qq.com"
}
],
- "description": "The ThinkPHP6 Addons Package",
+ "description": "The ThinkPHP8 Addons Package",
"support": {
"issues": "https://github.com/taoser/think-addons/issues",
- "source": "https://github.com/taoser/think-addons/tree/v1.0.9"
+ "source": "https://github.com/taoser/think-addons/tree/v2.0.0"
},
"install-path": "../taoser/think-addons"
},
{
"name": "taoser/think-auth",
- "version": "v1.0.1",
- "version_normalized": "1.0.1.0",
+ "version": "v2.0.0",
+ "version_normalized": "2.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/taoser/think-auth.git",
- "reference": "d3aa853b7d2a34624bcc566150105f2815e68ad0"
+ "reference": "db57156530dd8e2c020afc6e64abc1ad64e9e06c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/taoser/think-auth/zipball/d3aa853b7d2a34624bcc566150105f2815e68ad0",
- "reference": "d3aa853b7d2a34624bcc566150105f2815e68ad0",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "url": "https://api.github.com/repos/taoser/think-auth/zipball/db57156530dd8e2c020afc6e64abc1ad64e9e06c",
+ "reference": "db57156530dd8e2c020afc6e64abc1ad64e9e06c",
+ "shasum": ""
},
"require": {
- "php": ">=7.1.0",
- "topthink/framework": "^6.0"
+ "php": ">=8.0.0",
+ "topthink/framework": "^8.0"
},
- "time": "2023-02-26T03:08:39+00:00",
+ "time": "2023-08-02T06:28:49+00:00",
"type": "think-extend",
"extra": {
"think": {
@@ -2483,33 +1051,33 @@
"homepage": "https://github.com/taoser/think-auth",
"keywords": [
"think-auth",
- "thinkphp6"
+ "thinkphp8"
],
"support": {
"issues": "https://github.com/taoser/think-auth/issues",
- "source": "https://github.com/taoser/think-auth/tree/v1.0.1"
+ "source": "https://github.com/taoser/think-auth/tree/v2.0.0"
},
"install-path": "../taoser/think-auth"
},
{
"name": "taoser/think-setarr",
- "version": "v0.0.3",
- "version_normalized": "0.0.3.0",
+ "version": "v0.0.5",
+ "version_normalized": "0.0.5.0",
"source": {
"type": "git",
"url": "https://github.com/taoser/think-setarr.git",
- "reference": "6651c31ef42417a6294ef08e6fb970917b7e7f86"
+ "reference": "e436e2d855c2014dae19cbdecfd3d6c57c04aca8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/taoser/think-setarr/zipball/6651c31ef42417a6294ef08e6fb970917b7e7f86",
- "reference": "6651c31ef42417a6294ef08e6fb970917b7e7f86",
+ "url": "https://api.github.com/repos/taoser/think-setarr/zipball/e436e2d855c2014dae19cbdecfd3d6c57c04aca8",
+ "reference": "e436e2d855c2014dae19cbdecfd3d6c57c04aca8",
"shasum": ""
},
"require": {
"php": ">=7.2.0"
},
- "time": "2022-04-16T23:08:43+00:00",
+ "time": "2022-05-09T04:22:56+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -2530,112 +1098,43 @@
"description": "php confing",
"support": {
"issues": "https://github.com/taoser/think-setarr/issues",
- "source": "https://github.com/taoser/think-setarr/tree/v0.0.3"
+ "source": "https://github.com/taoser/think-setarr/tree/v0.0.5"
},
"install-path": "../taoser/think-setarr"
},
- {
- "name": "tightenco/collect",
- "version": "v8.83.27",
- "version_normalized": "8.83.27.0",
- "source": {
- "type": "git",
- "url": "https://github.com/tighten/collect.git",
- "reference": "07eed6cf7441c7a69c379fdcb118eec1a1fdd0e6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/tighten/collect/zipball/07eed6cf7441c7a69c379fdcb118eec1a1fdd0e6",
- "reference": "07eed6cf7441c7a69c379fdcb118eec1a1fdd0e6",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "php": "^7.3|^8.0",
- "symfony/var-dumper": "^3.4 || ^4.0 || ^5.0 || ^6.0"
- },
- "require-dev": {
- "mockery/mockery": "^1.0",
- "nesbot/carbon": "^2.23.0",
- "phpunit/phpunit": "^8.3"
- },
- "time": "2023-01-13T18:05:42+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "files": [
- "src/Collect/Support/helpers.php",
- "src/Collect/Support/alias.php"
- ],
- "psr-4": {
- "Tightenco\\Collect\\": "src/Collect"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Taylor Otwell",
- "email": "taylorotwell@gmail.com"
- }
- ],
- "description": "Collect - Illuminate Collections as a separate package.",
- "keywords": [
- "collection",
- "laravel"
- ],
- "support": {
- "issues": "https://github.com/tighten/collect/issues",
- "source": "https://github.com/tighten/collect/tree/v8.83.27"
- },
- "install-path": "../tightenco/collect"
- },
{
"name": "topthink/framework",
- "version": "v6.1.3",
- "version_normalized": "6.1.3.0",
+ "version": "v8.0.1",
+ "version_normalized": "8.0.1.0",
"source": {
"type": "git",
"url": "https://github.com/top-think/framework.git",
- "reference": "7c324e7011246f0064b055b62ab9c3921cf0a041"
+ "reference": "23101f0ad7581de32442553e045cffd7686a337b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/top-think/framework/zipball/7c324e7011246f0064b055b62ab9c3921cf0a041",
- "reference": "7c324e7011246f0064b055b62ab9c3921cf0a041",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "url": "https://api.github.com/repos/top-think/framework/zipball/23101f0ad7581de32442553e045cffd7686a337b",
+ "reference": "23101f0ad7581de32442553e045cffd7686a337b",
+ "shasum": ""
},
"require": {
"ext-json": "*",
"ext-mbstring": "*",
- "php": ">=7.2.5",
- "psr/container": "~1.0",
+ "php": ">=8.0.0",
+ "psr/container": "^2.0",
"psr/http-message": "^1.0",
- "psr/log": "~1.0",
- "psr/simple-cache": "^1.0",
- "topthink/think-helper": "^3.1.1",
- "topthink/think-orm": "^2.0|^3.0"
+ "psr/log": "^3.0",
+ "psr/simple-cache": "^3.0",
+ "topthink/think-helper": "^3.1",
+ "topthink/think-orm": "^3.0"
},
"require-dev": {
"guzzlehttp/psr7": "^2.1.0",
"mikey179/vfsstream": "^1.6",
"mockery/mockery": "^1.2",
- "phpunit/phpunit": "^7.0"
+ "phpunit/phpunit": "^9.5"
},
- "time": "2023-05-22T03:02:08+00:00",
+ "time": "2023-07-09T09:12:43+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -2667,7 +1166,7 @@
],
"support": {
"issues": "https://github.com/top-think/framework/issues",
- "source": "https://github.com/top-think/framework/tree/v6.1.3"
+ "source": "https://github.com/top-think/framework/tree/v8.0.1"
},
"install-path": "../topthink/framework"
},
@@ -2684,13 +1183,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-captcha/zipball/b1ef360670578214edeebcf824aaf6ab7ee0528b",
"reference": "b1ef360670578214edeebcf824aaf6ab7ee0528b",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "shasum": ""
},
"require": {
"topthink/framework": "^6.0|^8.0"
@@ -2746,13 +1239,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-helper/zipball/769acbe50a4274327162f9c68ec2e89a38eb2aff",
"reference": "769acbe50a4274327162f9c68ec2e89a38eb2aff",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "shasum": ""
},
"require": {
"php": ">=7.1.0"
@@ -2764,12 +1251,12 @@
"type": "library",
"installation-source": "dist",
"autoload": {
- "psr-4": {
- "think\\": "src"
- },
"files": [
"src/helper.php"
- ]
+ ],
+ "psr-4": {
+ "think\\": "src"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -2788,117 +1275,6 @@
},
"install-path": "../topthink/think-helper"
},
- {
- "name": "topthink/think-installer",
- "version": "v2.0.5",
- "version_normalized": "2.0.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/top-think/think-installer.git",
- "reference": "38ba647706e35d6704b5d370c06f8a160b635f88"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/top-think/think-installer/zipball/38ba647706e35d6704b5d370c06f8a160b635f88",
- "reference": "38ba647706e35d6704b5d370c06f8a160b635f88",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "composer-plugin-api": "^1.0||^2.0"
- },
- "require-dev": {
- "composer/composer": "^1.0||^2.0"
- },
- "time": "2021-01-14T12:12:14+00:00",
- "type": "composer-plugin",
- "extra": {
- "class": "think\\composer\\Plugin"
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "think\\composer\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "yunwuxin",
- "email": "448901948@qq.com"
- }
- ],
- "support": {
- "issues": "https://github.com/top-think/think-installer/issues",
- "source": "https://github.com/top-think/think-installer/tree/v2.0.5"
- },
- "install-path": "../topthink/think-installer"
- },
- {
- "name": "topthink/think-migration",
- "version": "v3.0.5",
- "version_normalized": "3.0.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/top-think/think-migration.git",
- "reference": "7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/top-think/think-migration/zipball/7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca",
- "reference": "7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca",
- "shasum": ""
- },
- "require": {
- "topthink/framework": "^6.0",
- "topthink/think-helper": "^3.0.3"
- },
- "require-dev": {
- "fzaninotto/faker": "^1.8"
- },
- "suggest": {
- "fzaninotto/faker": "Required to use the factory builder (^1.8)."
- },
- "time": "2023-02-26T13:16:22+00:00",
- "type": "library",
- "extra": {
- "think": {
- "services": [
- "think\\migration\\Service"
- ]
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Phinx\\": "phinx/src/Phinx",
- "think\\migration\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "yunwuxin",
- "email": "448901948@qq.com"
- }
- ],
- "support": {
- "issues": "https://github.com/top-think/think-migration/issues",
- "source": "https://github.com/top-think/think-migration/tree/v3.0.5"
- },
- "install-path": "../topthink/think-migration"
- },
{
"name": "topthink/think-multi-app",
"version": "v1.0.17",
@@ -2912,13 +1288,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-multi-app/zipball/4055a6187296ac16c0bc7bbab4ed5d92f82f791c",
"reference": "4055a6187296ac16c0bc7bbab4ed5d92f82f791c",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "shasum": ""
},
"require": {
"php": ">=7.1.0",
@@ -2958,37 +1328,31 @@
},
{
"name": "topthink/think-orm",
- "version": "v2.0.61",
- "version_normalized": "2.0.61.0",
+ "version": "v3.0.11",
+ "version_normalized": "3.0.11.0",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-orm.git",
- "reference": "10528ebf4a5106b19c3bac9c6deae7a67ff49de6"
+ "reference": "38a6da3ae03bcae4ea2f484a4cf05687a88a5488"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/top-think/think-orm/zipball/10528ebf4a5106b19c3bac9c6deae7a67ff49de6",
- "reference": "10528ebf4a5106b19c3bac9c6deae7a67ff49de6",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "url": "https://api.github.com/repos/top-think/think-orm/zipball/38a6da3ae03bcae4ea2f484a4cf05687a88a5488",
+ "reference": "38a6da3ae03bcae4ea2f484a4cf05687a88a5488",
+ "shasum": ""
},
"require": {
"ext-json": "*",
"ext-pdo": "*",
- "php": ">=7.1.0",
- "psr/log": "^1.0|^2.0",
- "psr/simple-cache": "^1.0|^2.0",
+ "php": ">=8.0.0",
+ "psr/log": ">=1.0",
+ "psr/simple-cache": ">=1.0",
"topthink/think-helper": "^3.1"
},
"require-dev": {
- "phpunit/phpunit": "^7|^8|^9.5"
+ "phpunit/phpunit": "^8|^9.5|^10"
},
- "time": "2023-04-20T14:27:51+00:00",
+ "time": "2023-07-18T11:04:31+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -3009,43 +1373,37 @@
"email": "liu21st@gmail.com"
}
],
- "description": "think orm",
+ "description": "the PHP Database&ORM Framework",
"keywords": [
"database",
"orm"
],
"support": {
"issues": "https://github.com/top-think/think-orm/issues",
- "source": "https://github.com/top-think/think-orm/tree/v2.0.61"
+ "source": "https://github.com/top-think/think-orm/tree/v3.0.11"
},
"install-path": "../topthink/think-orm"
},
{
"name": "topthink/think-template",
- "version": "v2.0.9",
- "version_normalized": "2.0.9.0",
+ "version": "v3.0.0",
+ "version_normalized": "3.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-template.git",
- "reference": "6d25642ae0e306166742fd7073dc7a159e18073c"
+ "reference": "4352d2cf627abfb8b49f830686c25c02f59c23f2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/top-think/think-template/zipball/6d25642ae0e306166742fd7073dc7a159e18073c",
- "reference": "6d25642ae0e306166742fd7073dc7a159e18073c",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "url": "https://api.github.com/repos/top-think/think-template/zipball/4352d2cf627abfb8b49f830686c25c02f59c23f2",
+ "reference": "4352d2cf627abfb8b49f830686c25c02f59c23f2",
+ "shasum": ""
},
"require": {
- "php": ">=7.1.0",
- "psr/simple-cache": "^1.0"
+ "php": ">=8.0.0",
+ "psr/simple-cache": ">=1.0"
},
- "time": "2023-02-14T10:50:39+00:00",
+ "time": "2023-02-25T12:11:14+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -3066,96 +1424,30 @@
"description": "the php template engine",
"support": {
"issues": "https://github.com/top-think/think-template/issues",
- "source": "https://github.com/top-think/think-template/tree/v2.0.9"
+ "source": "https://github.com/top-think/think-template/tree/v3.0.0"
},
"install-path": "../topthink/think-template"
},
- {
- "name": "topthink/think-trace",
- "version": "v1.6",
- "version_normalized": "1.6.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/top-think/think-trace.git",
- "reference": "136cd5d97e8bdb780e4b5c1637c588ed7ca3e142"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/top-think/think-trace/zipball/136cd5d97e8bdb780e4b5c1637c588ed7ca3e142",
- "reference": "136cd5d97e8bdb780e4b5c1637c588ed7ca3e142",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "php": ">=7.1.0",
- "topthink/framework": "^6.0|^8.0"
- },
- "time": "2023-02-07T08:36:32+00:00",
- "type": "library",
- "extra": {
- "think": {
- "services": [
- "think\\trace\\Service"
- ],
- "config": {
- "trace": "src/config.php"
- }
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "think\\trace\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "liu21st",
- "email": "liu21st@gmail.com"
- }
- ],
- "description": "thinkphp debug trace",
- "support": {
- "issues": "https://github.com/top-think/think-trace/issues",
- "source": "https://github.com/top-think/think-trace/tree/v1.6"
- },
- "install-path": "../topthink/think-trace"
- },
{
"name": "topthink/think-view",
- "version": "v1.0.14",
- "version_normalized": "1.0.14.0",
+ "version": "v2.0.0",
+ "version_normalized": "2.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-view.git",
- "reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d"
+ "reference": "d2a076011c96d2edd8016703a827fb54b2683c62"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/top-think/think-view/zipball/edce0ae2c9551ab65f9e94a222604b0dead3576d",
- "reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "url": "https://api.github.com/repos/top-think/think-view/zipball/d2a076011c96d2edd8016703a827fb54b2683c62",
+ "reference": "d2a076011c96d2edd8016703a827fb54b2683c62",
+ "shasum": ""
},
"require": {
- "php": ">=7.1.0",
- "topthink/think-template": "^2.0"
+ "php": ">=8.0.0",
+ "topthink/think-template": "^3.0"
},
- "time": "2019-11-06T11:40:13+00:00",
+ "time": "2023-02-25T12:18:09+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -3174,372 +1466,12 @@
}
],
"description": "thinkphp template driver",
+ "support": {
+ "issues": "https://github.com/top-think/think-view/issues",
+ "source": "https://github.com/top-think/think-view/tree/v2.0.0"
+ },
"install-path": "../topthink/think-view"
},
- {
- "name": "wamkj/thinkphp6.0-databackup",
- "version": "v1.0",
- "version_normalized": "1.0.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/wamkj/thinkphp6.0-databackup.git",
- "reference": "28a0e406d827132942723a3c9f69bb20c98e652f"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/wamkj/thinkphp6.0-databackup/zipball/28a0e406d827132942723a3c9f69bb20c98e652f",
- "reference": "28a0e406d827132942723a3c9f69bb20c98e652f",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "php": ">=7.1.0",
- "topthink/framework": "^6.0"
- },
- "time": "2020-02-15T13:04:16+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "wamkj\\thinkphp\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "wamkj",
- "email": "1149183529@qq.com"
- }
- ],
- "description": "thinkphp6.0的数据库自动备份扩展",
- "keywords": [
- "think-databackup",
- "thinkphp"
- ],
- "support": {
- "issues": "https://github.com/wamkj/thinkphp6.0-databackup/issues",
- "source": "https://github.com/wamkj/thinkphp6.0-databackup/tree/v1.0"
- },
- "install-path": "../wamkj/thinkphp6.0-databackup"
- },
- {
- "name": "workerman/channel",
- "version": "v1.2.0",
- "version_normalized": "1.2.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/walkor/channel.git",
- "reference": "fbfb81c7ebc5858c4053f226cbb5d15fe670ff6e"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/walkor/channel/zipball/fbfb81c7ebc5858c4053f226cbb5d15fe670ff6e",
- "reference": "fbfb81c7ebc5858c4053f226cbb5d15fe670ff6e",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "workerman/workerman": ">=4.0.12"
- },
- "time": "2023-04-04T02:47:35+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Channel\\": "./src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "homepage": "http://www.workerman.net",
- "support": {
- "issues": "https://github.com/walkor/channel/issues",
- "source": "https://github.com/walkor/channel/tree/v1.2.0"
- },
- "install-path": "../workerman/channel"
- },
- {
- "name": "workerman/phpsocket.io",
- "version": "v1.1.18",
- "version_normalized": "1.1.18.0",
- "source": {
- "type": "git",
- "url": "https://github.com/walkor/phpsocket.io.git",
- "reference": "b89b3f2ed44f6f79fd9895e2d198b52b3fb4783b"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/walkor/phpsocket.io/zipball/b89b3f2ed44f6f79fd9895e2d198b52b3fb4783b",
- "reference": "b89b3f2ed44f6f79fd9895e2d198b52b3fb4783b",
- "shasum": ""
- },
- "require": {
- "workerman/channel": ">=1.0.0",
- "workerman/workerman": "^4.0.0"
- },
- "time": "2023-06-16T01:41:34+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "PHPSocketIO\\": "./src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "homepage": "http://www.workerman.net",
- "keywords": [
- "Socket.io"
- ],
- "support": {
- "issues": "https://github.com/walkor/phpsocket.io/issues",
- "source": "https://github.com/walkor/phpsocket.io/tree/v1.1.18"
- },
- "funding": [
- {
- "url": "https://opencollective.com/walkor",
- "type": "open_collective"
- },
- {
- "url": "https://www.patreon.com/walkor",
- "type": "patreon"
- }
- ],
- "install-path": "../workerman/phpsocket.io"
- },
- {
- "name": "workerman/workerman",
- "version": "v4.1.10",
- "version_normalized": "4.1.10.0",
- "source": {
- "type": "git",
- "url": "https://github.com/walkor/workerman.git",
- "reference": "e967b79f95b9251a72acb971be05623ec1a51e83"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/walkor/workerman/zipball/e967b79f95b9251a72acb971be05623ec1a51e83",
- "reference": "e967b79f95b9251a72acb971be05623ec1a51e83",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
- },
- "require": {
- "php": ">=7.0"
- },
- "suggest": {
- "ext-event": "For better performance. "
- },
- "time": "2023-05-01T02:12:20+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Workerman\\": "./"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "walkor",
- "email": "walkor@workerman.net",
- "homepage": "http://www.workerman.net",
- "role": "Developer"
- }
- ],
- "description": "An asynchronous event driven PHP framework for easily building fast, scalable network applications.",
- "homepage": "http://www.workerman.net",
- "keywords": [
- "asynchronous",
- "event-loop"
- ],
- "support": {
- "email": "walkor@workerman.net",
- "forum": "http://wenda.workerman.net/",
- "issues": "https://github.com/walkor/workerman/issues",
- "source": "https://github.com/walkor/workerman",
- "wiki": "http://doc.workerman.net/"
- },
- "funding": [
- {
- "url": "https://opencollective.com/workerman",
- "type": "open_collective"
- },
- {
- "url": "https://www.patreon.com/walkor",
- "type": "patreon"
- }
- ],
- "install-path": "../workerman/workerman"
- },
- {
- "name": "yansongda/pay",
- "version": "v3.1.12",
- "version_normalized": "3.1.12.0",
- "source": {
- "type": "git",
- "url": "https://github.com/yansongda/pay.git",
- "reference": "7ff004f05f9d6e288ff9b4deef585d30395f37f2"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/yansongda/pay/zipball/7ff004f05f9d6e288ff9b4deef585d30395f37f2",
- "reference": "7ff004f05f9d6e288ff9b4deef585d30395f37f2",
- "shasum": ""
- },
- "require": {
- "ext-bcmath": "*",
- "ext-json": "*",
- "ext-libxml": "*",
- "ext-openssl": "*",
- "ext-simplexml": "*",
- "php": ">=7.4",
- "psr/container": "^1.1 | ^2.0",
- "psr/event-dispatcher": "^1.0",
- "psr/http-client": "^1.0",
- "psr/http-message": "^1.0",
- "psr/log": "^1.1 | ^2.0 | ^3.0",
- "yansongda/supports": "~3.2.0"
- },
- "require-dev": {
- "friendsofphp/php-cs-fixer": "^3.0",
- "guzzlehttp/guzzle": "^7.0",
- "mockery/mockery": "^1.4",
- "monolog/monolog": "^2.2",
- "phpstan/phpstan": "^1.0.0",
- "phpunit/phpunit": "^9.0",
- "symfony/event-dispatcher": "^5.2.0",
- "symfony/http-foundation": "^5.2.0",
- "symfony/psr-http-message-bridge": "^2.1",
- "symfony/var-dumper": "^5.1"
- },
- "suggest": {
- "hyperf/utils": "Hyperf 框架下使用 SDK,请安装",
- "illuminate/container": "Laravel 框架下使用 SDK,请安装",
- "php-di/php-di": "其它/无框架下使用 SDK,请安装"
- },
- "time": "2022-09-03T05:39:21+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "files": [
- "src/Functions.php"
- ],
- "psr-4": {
- "Yansongda\\Pay\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "yansongda",
- "email": "me@yansongda.cn"
- }
- ],
- "description": "可能是我用过的最优雅的 Alipay 和 WeChat 的支付 SDK 扩展包了",
- "keywords": [
- "alipay",
- "pay",
- "wechat"
- ],
- "support": {
- "homepage": "https://pay.yansongda.cn",
- "issues": "https://github.com/yansongda/pay/issues",
- "source": "https://github.com/yansongda/pay"
- },
- "install-path": "../yansongda/pay"
- },
- {
- "name": "yansongda/supports",
- "version": "v3.2.5",
- "version_normalized": "3.2.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/yansongda/supports.git",
- "reference": "c3f736efe169696cef94730976e604a61c345b5c"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/yansongda/supports/zipball/c3f736efe169696cef94730976e604a61c345b5c",
- "reference": "c3f736efe169696cef94730976e604a61c345b5c",
- "shasum": ""
- },
- "require": {
- "php": ">=7.4"
- },
- "require-dev": {
- "friendsofphp/php-cs-fixer": "^3.0",
- "mockery/mockery": "^1.4",
- "monolog/monolog": "^2.0",
- "phpstan/phpstan": "^1.1.0",
- "phpunit/phpunit": "^9.0",
- "symfony/console": "^5.1"
- },
- "suggest": {
- "monolog/monolog": "Use logger",
- "symfony/console": "Use stdout logger"
- },
- "time": "2022-03-28T10:25:04+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "files": [
- "src/Functions.php"
- ],
- "psr-4": {
- "Yansongda\\Supports\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "yansongda",
- "email": "me@yansongda.cn"
- }
- ],
- "description": "common components",
- "keywords": [
- "array",
- "collection",
- "config",
- "support"
- ],
- "support": {
- "issues": "https://github.com/yansongda/supports/issues",
- "source": "https://github.com/yansongda/supports"
- },
- "install-path": "../yansongda/supports"
- },
{
"name": "yzh52521/easyhttp",
"version": "v1.0.7",
@@ -3553,13 +1485,7 @@
"type": "zip",
"url": "https://api.github.com/repos/yzh52521/easyhttp/zipball/52cb9aba60a725bef77acd9c4c48ecc78931af9e",
"reference": "52cb9aba60a725bef77acd9c4c48ecc78931af9e",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "shasum": ""
},
"require": {
"guzzlehttp/guzzle": "^6.0|^7.0",
@@ -3603,7 +1529,5 @@
}
],
"dev": true,
- "dev-package-names": [
- "topthink/think-trace"
- ]
+ "dev-package-names": []
}
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index 3c23038..23e0f3d 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -1,195 +1,42 @@
array(
'name' => 'taoser/taoler',
- 'pretty_version' => 'dev-master',
- 'version' => 'dev-master',
- 'reference' => '4be45082e6e9bbe7fa38b4fca5566a08fe1a24a6',
+ 'pretty_version' => '3.0.x-dev',
+ 'version' => '3.0.9999999.9999999-dev',
+ 'reference' => '0c2f0154a81dd0a6268da627982d1bf41c0ef231',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev' => true,
),
'versions' => array(
- 'bacon/bacon-qr-code' => array(
- 'pretty_version' => '2.0.8',
- 'version' => '2.0.8.0',
- 'reference' => '8674e51bb65af933a5ffaf1c308a660387c35c22',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../bacon/bacon-qr-code',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'cache/adapter-common' => array(
- 'pretty_version' => '1.3.0',
- 'version' => '1.3.0.0',
- 'reference' => '8788309be72aa7be69b88cdc0687549c74a7d479',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../cache/adapter-common',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'cache/filesystem-adapter' => array(
- 'pretty_version' => '1.2.0',
- 'version' => '1.2.0.0',
- 'reference' => 'f1faaae40aaa696ef899cef6f6888aedb90b419b',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../cache/filesystem-adapter',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'cache/tag-interop' => array(
- 'pretty_version' => '1.1.0',
- 'version' => '1.1.0.0',
- 'reference' => 'b062b1d735357da50edf8387f7a8696f3027d328',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../cache/tag-interop',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'dasprid/enum' => array(
- 'pretty_version' => '1.0.4',
- 'version' => '1.0.4.0',
- 'reference' => '8e6b6ea76eabbf19ea2bf5b67b98e1860474012f',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../dasprid/enum',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'endroid/qr-code' => array(
- 'pretty_version' => '4.6.1',
- 'version' => '4.6.1.0',
- 'reference' => 'a75c913b0e4d6ad275e49a2c1de1cacffc6c2184',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../endroid/qr-code',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
'guzzlehttp/guzzle' => array(
- 'pretty_version' => '7.0.0',
- 'version' => '7.0.0.0',
- 'reference' => '414c24961042f6616fb43e23fa69a785f9fc053e',
+ 'pretty_version' => '7.7.0',
+ 'version' => '7.7.0.0',
+ 'reference' => 'fb7566caccf22d74d1ab270de3551f72a58399f5',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
'aliases' => array(),
'dev_requirement' => false,
),
'guzzlehttp/promises' => array(
- 'pretty_version' => '1.5.3',
- 'version' => '1.5.3.0',
- 'reference' => '67ab6e18aaa14d753cc148911d273f6e6cb6721e',
+ 'pretty_version' => '2.0.0',
+ 'version' => '2.0.0.0',
+ 'reference' => '3a494dc7dc1d7d12e511890177ae2d0e6c107da6',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/promises',
'aliases' => array(),
'dev_requirement' => false,
),
'guzzlehttp/psr7' => array(
- 'pretty_version' => '1.9.1',
- 'version' => '1.9.1.0',
- 'reference' => 'e4490cabc77465aaee90b20cfc9a770f8c04be6b',
+ 'pretty_version' => '2.5.0',
+ 'version' => '2.5.0.0',
+ 'reference' => 'b635f279edd83fc275f822a1188157ffea568ff6',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
'aliases' => array(),
'dev_requirement' => false,
),
- 'jaeger/g-http' => array(
- 'pretty_version' => 'V1.7.2',
- 'version' => '1.7.2.0',
- 'reference' => '82585ddd5e2c6651e37ab1d8166efcdbb6b293d4',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../jaeger/g-http',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'jaeger/phpquery-single' => array(
- 'pretty_version' => '1.1.1',
- 'version' => '1.1.1.0',
- 'reference' => '39a650ade692a6b480c22220dce0c198d6a946fb',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../jaeger/phpquery-single',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'jaeger/querylist' => array(
- 'pretty_version' => 'V4.2.8',
- 'version' => '4.2.8.0',
- 'reference' => '39dc0ca9c668bec7a793e20472ccd7d26ef89ea4',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../jaeger/querylist',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'laravel/serializable-closure' => array(
- 'pretty_version' => 'v1.3.0',
- 'version' => '1.3.0.0',
- 'reference' => 'f23fe9d4e95255dacee1bf3525e0810d1a1b0f37',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../laravel/serializable-closure',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'league/flysystem' => array(
- 'pretty_version' => '1.1.10',
- 'version' => '1.1.10.0',
- 'reference' => '3239285c825c152bcc315fe0e87d6b55f5972ed1',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../league/flysystem',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'league/mime-type-detection' => array(
- 'pretty_version' => '1.11.0',
- 'version' => '1.11.0.0',
- 'reference' => 'ff6248ea87a9f116e78edd6002e39e5128a0d4dd',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../league/mime-type-detection',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'liliuwei/thinkphp-social' => array(
- 'pretty_version' => 'v1.3',
- 'version' => '1.3.0.0',
- 'reference' => '2067fc2c2cc3b3d109602bc19c3e5a99c5f4c970',
- 'type' => 'think-extend',
- 'install_path' => __DIR__ . '/../liliuwei/thinkphp-social',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'lotofbadcode/phpspirit_databackup' => array(
- 'pretty_version' => 'v1.2',
- 'version' => '1.2.0.0',
- 'reference' => '77c2421f8461392c044cf8c29918f495c22a5612',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../lotofbadcode/phpspirit_databackup',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'php-di/invoker' => array(
- 'pretty_version' => '2.3.3',
- 'version' => '2.3.3.0',
- 'reference' => 'cd6d9f267d1a3474bdddf1be1da079f01b942786',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../php-di/invoker',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'php-di/php-di' => array(
- 'pretty_version' => '6.4.0',
- 'version' => '6.4.0.0',
- 'reference' => 'ae0f1b3b03d8b29dff81747063cbfd6276246cc4',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../php-di/php-di',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'php-di/phpdoc-reader' => array(
- 'pretty_version' => '2.2.1',
- 'version' => '2.2.1.0',
- 'reference' => '66daff34cbd2627740ffec9469ffbac9f8c8185c',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../php-di/phpdoc-reader',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
'phpmailer/phpmailer' => array(
'pretty_version' => 'v6.8.0',
'version' => '6.8.0.0',
@@ -199,45 +46,15 @@
'aliases' => array(),
'dev_requirement' => false,
),
- 'psr/cache' => array(
- 'pretty_version' => '1.0.1',
- 'version' => '1.0.1.0',
- 'reference' => 'd11b50ad223250cf17b86e38383413f5a6764bf8',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../psr/cache',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'psr/cache-implementation' => array(
- 'dev_requirement' => false,
- 'provided' => array(
- 0 => '^1.0',
- ),
- ),
'psr/container' => array(
- 'pretty_version' => '1.1.2',
- 'version' => '1.1.2.0',
- 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea',
+ 'pretty_version' => '2.0.2',
+ 'version' => '2.0.2.0',
+ 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/container',
'aliases' => array(),
'dev_requirement' => false,
),
- 'psr/container-implementation' => array(
- 'dev_requirement' => false,
- 'provided' => array(
- 0 => '^1.0',
- ),
- ),
- 'psr/event-dispatcher' => array(
- 'pretty_version' => '1.0.0',
- 'version' => '1.0.0.0',
- 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../psr/event-dispatcher',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
'psr/http-client' => array(
'pretty_version' => '1.0.2',
'version' => '1.0.2.0',
@@ -253,6 +70,21 @@
0 => '1.0',
),
),
+ 'psr/http-factory' => array(
+ 'pretty_version' => '1.0.2',
+ 'version' => '1.0.2.0',
+ 'reference' => 'e616d01114759c4c489f93b099585439f795fe35',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/http-factory',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'psr/http-factory-implementation' => array(
+ 'dev_requirement' => false,
+ 'provided' => array(
+ 0 => '1.0',
+ ),
+ ),
'psr/http-message' => array(
'pretty_version' => '1.1',
'version' => '1.1.0.0',
@@ -269,29 +101,23 @@
),
),
'psr/log' => array(
- 'pretty_version' => '1.1.4',
- 'version' => '1.1.4.0',
- 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
+ 'pretty_version' => '3.0.0',
+ 'version' => '3.0.0.0',
+ 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/log',
'aliases' => array(),
'dev_requirement' => false,
),
'psr/simple-cache' => array(
- 'pretty_version' => '1.0.1',
- 'version' => '1.0.1.0',
- 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
+ 'pretty_version' => '3.0.0',
+ 'version' => '3.0.0.0',
+ 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/simple-cache',
'aliases' => array(),
'dev_requirement' => false,
),
- 'psr/simple-cache-implementation' => array(
- 'dev_requirement' => false,
- 'provided' => array(
- 0 => '^1.0',
- ),
- ),
'ralouphie/getallheaders' => array(
'pretty_version' => '3.0.3',
'version' => '3.0.3.0',
@@ -301,100 +127,64 @@
'aliases' => array(),
'dev_requirement' => false,
),
- 'symfony/polyfill-mbstring' => array(
- 'pretty_version' => 'v1.27.0',
- 'version' => '1.27.0.0',
- 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534',
+ 'symfony/deprecation-contracts' => array(
+ 'pretty_version' => 'v3.3.0',
+ 'version' => '3.3.0.0',
+ 'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf',
'type' => 'library',
- 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'symfony/polyfill-php72' => array(
- 'pretty_version' => 'v1.27.0',
- 'version' => '1.27.0.0',
- 'reference' => '869329b1e9894268a8a61dabb69153029b7a8c97',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../symfony/polyfill-php72',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'symfony/polyfill-php80' => array(
- 'pretty_version' => 'v1.27.0',
- 'version' => '1.27.0.0',
- 'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../symfony/polyfill-php80',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'symfony/var-dumper' => array(
- 'pretty_version' => 'v4.4.47',
- 'version' => '4.4.47.0',
- 'reference' => '1069c7a3fca74578022fab6f81643248d02f8e63',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../symfony/var-dumper',
+ 'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/var-exporter' => array(
- 'pretty_version' => 'v5.4.21',
- 'version' => '5.4.21.0',
- 'reference' => 'be74908a6942fdd331554b3cec27ff41b45ccad4',
+ 'pretty_version' => 'v6.3.2',
+ 'version' => '6.3.2.0',
+ 'reference' => '3400949782c0cb5b3e73aa64cfd71dde000beccc',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/var-exporter',
'aliases' => array(),
'dev_requirement' => false,
),
'taoser/taoler' => array(
- 'pretty_version' => 'dev-master',
- 'version' => 'dev-master',
- 'reference' => '4be45082e6e9bbe7fa38b4fca5566a08fe1a24a6',
+ 'pretty_version' => '3.0.x-dev',
+ 'version' => '3.0.9999999.9999999-dev',
+ 'reference' => '0c2f0154a81dd0a6268da627982d1bf41c0ef231',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'taoser/think-addons' => array(
- 'pretty_version' => 'v1.0.9',
- 'version' => '1.0.9.0',
- 'reference' => '00112adf200b897deecbd1bbabc33ad22377b008',
+ 'pretty_version' => 'v2.0.0',
+ 'version' => '2.0.0.0',
+ 'reference' => 'ef97225aca7f0ec1da275c4ae025686899a91ad2',
'type' => 'library',
'install_path' => __DIR__ . '/../taoser/think-addons',
'aliases' => array(),
'dev_requirement' => false,
),
'taoser/think-auth' => array(
- 'pretty_version' => 'v1.0.1',
- 'version' => '1.0.1.0',
- 'reference' => 'd3aa853b7d2a34624bcc566150105f2815e68ad0',
+ 'pretty_version' => 'v2.0.0',
+ 'version' => '2.0.0.0',
+ 'reference' => 'db57156530dd8e2c020afc6e64abc1ad64e9e06c',
'type' => 'think-extend',
'install_path' => __DIR__ . '/../taoser/think-auth',
'aliases' => array(),
'dev_requirement' => false,
),
'taoser/think-setarr' => array(
- 'pretty_version' => 'v0.0.3',
- 'version' => '0.0.3.0',
- 'reference' => '6651c31ef42417a6294ef08e6fb970917b7e7f86',
+ 'pretty_version' => 'v0.0.5',
+ 'version' => '0.0.5.0',
+ 'reference' => 'e436e2d855c2014dae19cbdecfd3d6c57c04aca8',
'type' => 'library',
'install_path' => __DIR__ . '/../taoser/think-setarr',
'aliases' => array(),
'dev_requirement' => false,
),
- 'tightenco/collect' => array(
- 'pretty_version' => 'v8.83.27',
- 'version' => '8.83.27.0',
- 'reference' => '07eed6cf7441c7a69c379fdcb118eec1a1fdd0e6',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../tightenco/collect',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
'topthink/framework' => array(
- 'pretty_version' => 'v6.1.3',
- 'version' => '6.1.3.0',
- 'reference' => '7c324e7011246f0064b055b62ab9c3921cf0a041',
+ 'pretty_version' => 'v8.0.1',
+ 'version' => '8.0.1.0',
+ 'reference' => '23101f0ad7581de32442553e045cffd7686a337b',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/framework',
'aliases' => array(),
@@ -418,24 +208,6 @@
'aliases' => array(),
'dev_requirement' => false,
),
- 'topthink/think-installer' => array(
- 'pretty_version' => 'v2.0.5',
- 'version' => '2.0.5.0',
- 'reference' => '38ba647706e35d6704b5d370c06f8a160b635f88',
- 'type' => 'composer-plugin',
- 'install_path' => __DIR__ . '/../topthink/think-installer',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'topthink/think-migration' => array(
- 'pretty_version' => 'v3.0.5',
- 'version' => '3.0.5.0',
- 'reference' => '7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../topthink/think-migration',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
'topthink/think-multi-app' => array(
'pretty_version' => 'v1.0.17',
'version' => '1.0.17.0',
@@ -446,95 +218,32 @@
'dev_requirement' => false,
),
'topthink/think-orm' => array(
- 'pretty_version' => 'v2.0.61',
- 'version' => '2.0.61.0',
- 'reference' => '10528ebf4a5106b19c3bac9c6deae7a67ff49de6',
+ 'pretty_version' => 'v3.0.11',
+ 'version' => '3.0.11.0',
+ 'reference' => '38a6da3ae03bcae4ea2f484a4cf05687a88a5488',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-orm',
'aliases' => array(),
'dev_requirement' => false,
),
'topthink/think-template' => array(
- 'pretty_version' => 'v2.0.9',
- 'version' => '2.0.9.0',
- 'reference' => '6d25642ae0e306166742fd7073dc7a159e18073c',
+ 'pretty_version' => 'v3.0.0',
+ 'version' => '3.0.0.0',
+ 'reference' => '4352d2cf627abfb8b49f830686c25c02f59c23f2',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-template',
'aliases' => array(),
'dev_requirement' => false,
),
- 'topthink/think-trace' => array(
- 'pretty_version' => 'v1.6',
- 'version' => '1.6.0.0',
- 'reference' => '136cd5d97e8bdb780e4b5c1637c588ed7ca3e142',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../topthink/think-trace',
- 'aliases' => array(),
- 'dev_requirement' => true,
- ),
'topthink/think-view' => array(
- 'pretty_version' => 'v1.0.14',
- 'version' => '1.0.14.0',
- 'reference' => 'edce0ae2c9551ab65f9e94a222604b0dead3576d',
+ 'pretty_version' => 'v2.0.0',
+ 'version' => '2.0.0.0',
+ 'reference' => 'd2a076011c96d2edd8016703a827fb54b2683c62',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-view',
'aliases' => array(),
'dev_requirement' => false,
),
- 'wamkj/thinkphp6.0-databackup' => array(
- 'pretty_version' => 'v1.0',
- 'version' => '1.0.0.0',
- 'reference' => '28a0e406d827132942723a3c9f69bb20c98e652f',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../wamkj/thinkphp6.0-databackup',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'workerman/channel' => array(
- 'pretty_version' => 'v1.2.0',
- 'version' => '1.2.0.0',
- 'reference' => 'fbfb81c7ebc5858c4053f226cbb5d15fe670ff6e',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../workerman/channel',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'workerman/phpsocket.io' => array(
- 'pretty_version' => 'v1.1.18',
- 'version' => '1.1.18.0',
- 'reference' => 'b89b3f2ed44f6f79fd9895e2d198b52b3fb4783b',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../workerman/phpsocket.io',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'workerman/workerman' => array(
- 'pretty_version' => 'v4.1.10',
- 'version' => '4.1.10.0',
- 'reference' => 'e967b79f95b9251a72acb971be05623ec1a51e83',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../workerman/workerman',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'yansongda/pay' => array(
- 'pretty_version' => 'v3.1.12',
- 'version' => '3.1.12.0',
- 'reference' => '7ff004f05f9d6e288ff9b4deef585d30395f37f2',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../yansongda/pay',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
- 'yansongda/supports' => array(
- 'pretty_version' => 'v3.2.5',
- 'version' => '3.2.5.0',
- 'reference' => 'c3f736efe169696cef94730976e604a61c345b5c',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../yansongda/supports',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
'yzh52521/easyhttp' => array(
'pretty_version' => 'v1.0.7',
'version' => '1.0.7.0',
diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php
index 580fa96..4c3a5d6 100644
--- a/vendor/composer/platform_check.php
+++ b/vendor/composer/platform_check.php
@@ -4,8 +4,8 @@
$issues = array();
-if (!(PHP_VERSION_ID >= 70400)) {
- $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
+if (!(PHP_VERSION_ID >= 80100)) {
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
diff --git a/vendor/dasprid/enum/.github/workflows/tests.yml b/vendor/dasprid/enum/.github/workflows/tests.yml
deleted file mode 100644
index 94b2562..0000000
--- a/vendor/dasprid/enum/.github/workflows/tests.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-name: Tests
-
-on: [push, pull_request]
-
-jobs:
- php-tests:
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: true
- matrix:
- php: [8.2, 8.1, 8.0, 7.4, 7.3, 7.2, 7.1]
- dependency-version: [prefer-stable]
- os: [ubuntu-latest, windows-latest]
-
- name: ${{ matrix.os }} - PHP${{ matrix.php }} - ${{ matrix.dependency-version }}
-
- steps:
- - name: Set git to use LF
- run: |
- git config --global core.autocrlf false
- git config --global core.eol lf
-
- - name: Checkout code
- uses: actions/checkout@v3
-
- - name: Cache dependencies
- uses: actions/cache@v3
- with:
- path: ~/.composer/cache/files
- key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
-
- - name: Setup PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: ${{ matrix.php }}
- coverage: none
-
- - name: Install dependencies
- run: |
- composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
-
- - name: Execute tests
- run: vendor/bin/phpunit
-
- - name: Code Sniffer
- run: vendor/bin/phpcs
-
diff --git a/vendor/dasprid/enum/LICENSE b/vendor/dasprid/enum/LICENSE
deleted file mode 100644
index d45a356..0000000
--- a/vendor/dasprid/enum/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2017, Ben Scholzen 'DASPRiD'
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/dasprid/enum/README.md b/vendor/dasprid/enum/README.md
deleted file mode 100644
index da37045..0000000
--- a/vendor/dasprid/enum/README.md
+++ /dev/null
@@ -1,164 +0,0 @@
-# PHP 7.1 enums
-
-[](https://github.com/DASPRiD/Enum/actions?query=workflow%3Atests)
-[](https://coveralls.io/github/DASPRiD/Enum?branch=master)
-[](https://packagist.org/packages/dasprid/enum)
-[](https://packagist.org/packages/dasprid/enum)
-[](https://packagist.org/packages/dasprid/enum)
-
-It is a well known fact that PHP is missing a basic enum type, ignoring the rather incomplete `SplEnum` implementation
-which is only available as a PECL extension. There are also quite a few other userland enum implementations around,
-but all of them have one or another compromise. This library tries to close that gap as far as PHP allows it to.
-
-## Usage
-
-### Basics
-
-At its core, there is the `DASPRiD\Enum\AbstractEnum` class, which by default will work with constants like any other
-enum implementation you might know. The first clear difference is that you should define all the constants as protected
-(so nobody outside your class can read them but the `AbstractEnum` can still do so). The other even mightier difference
-is that, for simple enums, the value of the constant doesn't matter at all. Let's have a look at a simple example:
-
-```php
-use DASPRiD\Enum\AbstractEnum;
-
-/**
- * @method static self MONDAY()
- * @method static self TUESDAY()
- * @method static self WEDNESDAY()
- * @method static self THURSDAY()
- * @method static self FRIDAY()
- * @method static self SATURDAY()
- * @method static self SUNDAY()
- */
-final class WeekDay extends AbstractEnum
-{
- protected const MONDAY = null;
- protected const TUESDAY = null;
- protected const WEDNESDAY = null;
- protected const THURSDAY = null;
- protected const FRIDAY = null;
- protected const SATURDAY = null;
- protected const SUNDAY = null;
-}
-```
-
-If you need to provide constants for either internal use or public use, you can mark them as either private or public,
-in which case they will be ignored by the enum, which only considers protected constants as valid values. As you can
-see, we specifically defined the generated magic methods in a class level doc block, so anyone using this class will
-automatically have proper auto-completion in their IDE. Now since you have defined the enum, you can simply use it like
-that:
-
-```php
-function tellItLikeItIs(WeekDay $weekDay)
-{
- switch ($weekDay) {
- case WeekDay::MONDAY():
- echo 'Mondays are bad.';
- break;
-
- case WeekDay::FRIDAY():
- echo 'Fridays are better.';
- break;
-
- case WeekDay::SATURDAY():
- case WeekDay::SUNDAY():
- echo 'Weekends are best.';
- break;
-
- default:
- echo 'Midweek days are so-so.';
- }
-}
-
-tellItLikeItIs(WeekDay::MONDAY());
-tellItLikeItIs(WeekDay::WEDNESDAY());
-tellItLikeItIs(WeekDay::FRIDAY());
-tellItLikeItIs(WeekDay::SATURDAY());
-tellItLikeItIs(WeekDay::SUNDAY());
-```
-
-### More complex example
-
-Of course, all enums are singletons, which are not cloneable or serializable. Thus you can be sure that there is always
-just one instance of the same type. Of course, the values of constants are not completely useless, let's have a look at
-a more complex example:
-
-```php
-use DASPRiD\Enum\AbstractEnum;
-
-/**
- * @method static self MERCURY()
- * @method static self VENUS()
- * @method static self EARTH()
- * @method static self MARS()
- * @method static self JUPITER()
- * @method static self SATURN()
- * @method static self URANUS()
- * @method static self NEPTUNE()
- */
-final class Planet extends AbstractEnum
-{
- protected const MERCURY = [3.303e+23, 2.4397e6];
- protected const VENUS = [4.869e+24, 6.0518e6];
- protected const EARTH = [5.976e+24, 6.37814e6];
- protected const MARS = [6.421e+23, 3.3972e6];
- protected const JUPITER = [1.9e+27, 7.1492e7];
- protected const SATURN = [5.688e+26, 6.0268e7];
- protected const URANUS = [8.686e+25, 2.5559e7];
- protected const NEPTUNE = [1.024e+26, 2.4746e7];
-
- /**
- * Universal gravitational constant.
- *
- * @var float
- */
- private const G = 6.67300E-11;
-
- /**
- * Mass in kilograms.
- *
- * @var float
- */
- private $mass;
-
- /**
- * Radius in meters.
- *
- * @var float
- */
- private $radius;
-
- protected function __construct(float $mass, float $radius)
- {
- $this->mass = $mass;
- $this->radius = $radius;
- }
-
- public function mass() : float
- {
- return $this->mass;
- }
-
- public function radius() : float
- {
- return $this->radius;
- }
-
- public function surfaceGravity() : float
- {
- return self::G * $this->mass / ($this->radius * $this->radius);
- }
-
- public function surfaceWeight(float $otherMass) : float
- {
- return $otherMass * $this->surfaceGravity();
- }
-}
-
-$myMass = 80;
-
-foreach (Planet::values() as $planet) {
- printf("Your weight on %s is %f\n", $planet, $planet->surfaceWeight($myMass));
-}
-```
diff --git a/vendor/dasprid/enum/composer.json b/vendor/dasprid/enum/composer.json
deleted file mode 100644
index 133e279..0000000
--- a/vendor/dasprid/enum/composer.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "name": "dasprid/enum",
- "description": "PHP 7.1 enum implementation",
- "license": "BSD-2-Clause",
- "authors": [
- {
- "name": "Ben Scholzen 'DASPRiD'",
- "email": "mail@dasprids.de",
- "homepage": "https://dasprids.de/",
- "role": "Developer"
- }
- ],
- "keywords": [
- "enum",
- "map"
- ],
- "require": {
- "php": ">=7.1 <9.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^7 | ^8 | ^9",
- "squizlabs/php_codesniffer": "*"
- },
- "autoload": {
- "psr-4": {
- "DASPRiD\\Enum\\": "src/"
- }
- },
- "autoload-dev": {
- "psr-4": {
- "DASPRiD\\EnumTest\\": "test/"
- }
- }
-}
diff --git a/vendor/dasprid/enum/phpunit.xml.dist b/vendor/dasprid/enum/phpunit.xml.dist
deleted file mode 100644
index 307a430..0000000
--- a/vendor/dasprid/enum/phpunit.xml.dist
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
- ./test
-
-
-
-
-
- src
-
-
-
diff --git a/vendor/dasprid/enum/src/AbstractEnum.php b/vendor/dasprid/enum/src/AbstractEnum.php
deleted file mode 100644
index 79fe81c..0000000
--- a/vendor/dasprid/enum/src/AbstractEnum.php
+++ /dev/null
@@ -1,241 +0,0 @@
->
- */
- private static $values = [];
-
- /**
- * @var array
- */
- private static $allValuesLoaded = [];
-
- /**
- * @var array
- */
- private static $constants = [];
-
- /**
- * The constructor is private by default to avoid arbitrary enum creation.
- *
- * When creating your own constructor for a parameterized enum, make sure to declare it as protected, so that
- * the static methods are able to construct it. Avoid making it public, as that would allow creation of
- * non-singleton enum instances.
- */
- private function __construct()
- {
- }
-
- /**
- * Magic getter which forwards all calls to {@see self::valueOf()}.
- *
- * @return static
- */
- final public static function __callStatic(string $name, array $arguments) : self
- {
- return static::valueOf($name);
- }
-
- /**
- * Returns an enum with the specified name.
- *
- * The name must match exactly an identifier used to declare an enum in this type (extraneous whitespace characters
- * are not permitted).
- *
- * @return static
- * @throws IllegalArgumentException if the enum has no constant with the specified name
- */
- final public static function valueOf(string $name) : self
- {
- if (isset(self::$values[static::class][$name])) {
- return self::$values[static::class][$name];
- }
-
- $constants = self::constants();
-
- if (array_key_exists($name, $constants)) {
- return self::createValue($name, $constants[$name][0], $constants[$name][1]);
- }
-
- throw new IllegalArgumentException(sprintf('No enum constant %s::%s', static::class, $name));
- }
-
- /**
- * @return static
- */
- private static function createValue(string $name, int $ordinal, array $arguments) : self
- {
- $instance = new static(...$arguments);
- $instance->name = $name;
- $instance->ordinal = $ordinal;
- self::$values[static::class][$name] = $instance;
- return $instance;
- }
-
- /**
- * Obtains all possible types defined by this enum.
- *
- * @return static[]
- */
- final public static function values() : array
- {
- if (isset(self::$allValuesLoaded[static::class])) {
- return self::$values[static::class];
- }
-
- if (! isset(self::$values[static::class])) {
- self::$values[static::class] = [];
- }
-
- foreach (self::constants() as $name => $constant) {
- if (array_key_exists($name, self::$values[static::class])) {
- continue;
- }
-
- static::createValue($name, $constant[0], $constant[1]);
- }
-
- uasort(self::$values[static::class], function (self $a, self $b) {
- return $a->ordinal() <=> $b->ordinal();
- });
-
- self::$allValuesLoaded[static::class] = true;
- return self::$values[static::class];
- }
-
- private static function constants() : array
- {
- if (isset(self::$constants[static::class])) {
- return self::$constants[static::class];
- }
-
- self::$constants[static::class] = [];
- $reflectionClass = new ReflectionClass(static::class);
- $ordinal = -1;
-
- foreach ($reflectionClass->getReflectionConstants() as $reflectionConstant) {
- if (! $reflectionConstant->isProtected()) {
- continue;
- }
-
- $value = $reflectionConstant->getValue();
-
- self::$constants[static::class][$reflectionConstant->name] = [
- ++$ordinal,
- is_array($value) ? $value : []
- ];
- }
-
- return self::$constants[static::class];
- }
-
- /**
- * Returns the name of this enum constant, exactly as declared in its enum declaration.
- *
- * Most programmers should use the {@see self::__toString()} method in preference to this one, as the toString
- * method may return a more user-friendly name. This method is designed primarily for use in specialized situations
- * where correctness depends on getting the exact name, which will not vary from release to release.
- */
- final public function name() : string
- {
- return $this->name;
- }
-
- /**
- * Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial
- * constant is assigned an ordinal of zero).
- *
- * Most programmers will have no use for this method. It is designed for use by sophisticated enum-based data
- * structures.
- */
- final public function ordinal() : int
- {
- return $this->ordinal;
- }
-
- /**
- * Compares this enum with the specified object for order.
- *
- * Returns negative integer, zero or positive integer as this object is less than, equal to or greater than the
- * specified object.
- *
- * Enums are only comparable to other enums of the same type. The natural order implemented by this method is the
- * order in which the constants are declared.
- *
- * @throws MismatchException if the passed enum is not of the same type
- */
- final public function compareTo(self $other) : int
- {
- if (! $other instanceof static) {
- throw new MismatchException(sprintf(
- 'The passed enum %s is not of the same type as %s',
- get_class($other),
- static::class
- ));
- }
-
- return $this->ordinal - $other->ordinal;
- }
-
- /**
- * Forbid cloning enums.
- *
- * @throws CloneNotSupportedException
- */
- final public function __clone()
- {
- throw new CloneNotSupportedException();
- }
-
- /**
- * Forbid serializing enums.
- *
- * @throws SerializeNotSupportedException
- */
- final public function __sleep() : array
- {
- throw new SerializeNotSupportedException();
- }
-
- /**
- * Forbid unserializing enums.
- *
- * @throws UnserializeNotSupportedException
- */
- final public function __wakeup() : void
- {
- throw new UnserializeNotSupportedException();
- }
-
- /**
- * Turns the enum into a string representation.
- *
- * You may override this method to give a more user-friendly version.
- */
- public function __toString() : string
- {
- return $this->name;
- }
-}
diff --git a/vendor/dasprid/enum/src/EnumMap.php b/vendor/dasprid/enum/src/EnumMap.php
deleted file mode 100644
index 95b8856..0000000
--- a/vendor/dasprid/enum/src/EnumMap.php
+++ /dev/null
@@ -1,385 +0,0 @@
-
- */
- private $keyUniverse;
-
- /**
- * Array representation of this map. The ith element is the value to which universe[i] is currently mapped, or null
- * if it isn't mapped to anything, or NullValue if it's mapped to null.
- *
- * @var array
- */
- private $values;
-
- /**
- * @var int
- */
- private $size = 0;
-
- /**
- * Creates a new enum map.
- *
- * @param string $keyType the type of the keys, must extend AbstractEnum
- * @param string $valueType the type of the values
- * @param bool $allowNullValues whether to allow null values
- * @throws IllegalArgumentException when key type does not extend AbstractEnum
- */
- public function __construct(string $keyType, string $valueType, bool $allowNullValues)
- {
- if (! is_subclass_of($keyType, AbstractEnum::class)) {
- throw new IllegalArgumentException(sprintf(
- 'Class %s does not extend %s',
- $keyType,
- AbstractEnum::class
- ));
- }
-
- $this->keyType = $keyType;
- $this->valueType = $valueType;
- $this->allowNullValues = $allowNullValues;
- $this->keyUniverse = $keyType::values();
- $this->values = array_fill(0, count($this->keyUniverse), null);
- }
-
- public function __serialize(): array
- {
- $values = [];
-
- foreach ($this->values as $ordinal => $value) {
- if (null === $value) {
- continue;
- }
-
- $values[$ordinal] = $this->unmaskNull($value);
- }
-
- return [
- 'keyType' => $this->keyType,
- 'valueType' => $this->valueType,
- 'allowNullValues' => $this->allowNullValues,
- 'values' => $values,
- ];
- }
-
- public function __unserialize(array $data): void
- {
- $this->unserialize(serialize($data));
- }
-
- /**
- * Checks whether the map types match the supplied ones.
- *
- * You should call this method when an EnumMap is passed to you and you want to ensure that it's made up of the
- * correct types.
- *
- * @throws ExpectationException when supplied key type mismatches local key type
- * @throws ExpectationException when supplied value type mismatches local value type
- * @throws ExpectationException when the supplied map allows null values, abut should not
- */
- public function expect(string $keyType, string $valueType, bool $allowNullValues) : void
- {
- if ($keyType !== $this->keyType) {
- throw new ExpectationException(sprintf(
- 'Callee expected an EnumMap with key type %s, but got %s',
- $keyType,
- $this->keyType
- ));
- }
-
- if ($valueType !== $this->valueType) {
- throw new ExpectationException(sprintf(
- 'Callee expected an EnumMap with value type %s, but got %s',
- $keyType,
- $this->keyType
- ));
- }
-
- if ($allowNullValues !== $this->allowNullValues) {
- throw new ExpectationException(sprintf(
- 'Callee expected an EnumMap with nullable flag %s, but got %s',
- ($allowNullValues ? 'true' : 'false'),
- ($this->allowNullValues ? 'true' : 'false')
- ));
- }
- }
-
- /**
- * Returns the number of key-value mappings in this map.
- */
- public function size() : int
- {
- return $this->size;
- }
-
- /**
- * Returns true if this map maps one or more keys to the specified value.
- */
- public function containsValue($value) : bool
- {
- return in_array($this->maskNull($value), $this->values, true);
- }
-
- /**
- * Returns true if this map contains a mapping for the specified key.
- */
- public function containsKey(AbstractEnum $key) : bool
- {
- $this->checkKeyType($key);
- return null !== $this->values[$key->ordinal()];
- }
-
- /**
- * Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
- *
- * More formally, if this map contains a mapping from a key to a value, then this method returns the value;
- * otherwise it returns null (there can be at most one such mapping).
- *
- * A return value of null does not necessarily indicate that the map contains no mapping for the key; it's also
- * possible that hte map explicitly maps the key to null. The {@see self::containsKey()} operation may be used to
- * distinguish these two cases.
- *
- * @return mixed
- */
- public function get(AbstractEnum $key)
- {
- $this->checkKeyType($key);
- return $this->unmaskNull($this->values[$key->ordinal()]);
- }
-
- /**
- * Associates the specified value with the specified key in this map.
- *
- * If the map previously contained a mapping for this key, the old value is replaced.
- *
- * @return mixed the previous value associated with the specified key, or null if there was no mapping for the key.
- * (a null return can also indicate that the map previously associated null with the specified key.)
- * @throws IllegalArgumentException when the passed values does not match the internal value type
- */
- public function put(AbstractEnum $key, $value)
- {
- $this->checkKeyType($key);
-
- if (! $this->isValidValue($value)) {
- throw new IllegalArgumentException(sprintf('Value is not of type %s', $this->valueType));
- }
-
- $index = $key->ordinal();
- $oldValue = $this->values[$index];
- $this->values[$index] = $this->maskNull($value);
-
- if (null === $oldValue) {
- ++$this->size;
- }
-
- return $this->unmaskNull($oldValue);
- }
-
- /**
- * Removes the mapping for this key frm this map if present.
- *
- * @return mixed the previous value associated with the specified key, or null if there was no mapping for the key.
- * (a null return can also indicate that the map previously associated null with the specified key.)
- */
- public function remove(AbstractEnum $key)
- {
- $this->checkKeyType($key);
-
- $index = $key->ordinal();
- $oldValue = $this->values[$index];
- $this->values[$index] = null;
-
- if (null !== $oldValue) {
- --$this->size;
- }
-
- return $this->unmaskNull($oldValue);
- }
-
- /**
- * Removes all mappings from this map.
- */
- public function clear() : void
- {
- $this->values = array_fill(0, count($this->keyUniverse), null);
- $this->size = 0;
- }
-
- /**
- * Compares the specified map with this map for quality.
- *
- * Returns true if the two maps represent the same mappings.
- */
- public function equals(self $other) : bool
- {
- if ($this === $other) {
- return true;
- }
-
- if ($this->size !== $other->size) {
- return false;
- }
-
- return $this->values === $other->values;
- }
-
- /**
- * Returns the values contained in this map.
- *
- * The array will contain the values in the order their corresponding keys appear in the map, which is their natural
- * order (the order in which the num constants are declared).
- */
- public function values() : array
- {
- return array_values(array_map(function ($value) {
- return $this->unmaskNull($value);
- }, array_filter($this->values, function ($value) : bool {
- return null !== $value;
- })));
- }
-
- public function serialize() : string
- {
- return serialize($this->__serialize());
- }
-
- public function unserialize($serialized) : void
- {
- $data = unserialize($serialized);
- $this->__construct($data['keyType'], $data['valueType'], $data['allowNullValues']);
-
- foreach ($this->keyUniverse as $key) {
- if (array_key_exists($key->ordinal(), $data['values'])) {
- $this->put($key, $data['values'][$key->ordinal()]);
- }
- }
- }
-
- public function getIterator() : Traversable
- {
- foreach ($this->keyUniverse as $key) {
- if (null === $this->values[$key->ordinal()]) {
- continue;
- }
-
- yield $key => $this->unmaskNull($this->values[$key->ordinal()]);
- }
- }
-
- private function maskNull($value)
- {
- if (null === $value) {
- return NullValue::instance();
- }
-
- return $value;
- }
-
- private function unmaskNull($value)
- {
- if ($value instanceof NullValue) {
- return null;
- }
-
- return $value;
- }
-
- /**
- * @throws IllegalArgumentException when the passed key does not match the internal key type
- */
- private function checkKeyType(AbstractEnum $key) : void
- {
- if (get_class($key) !== $this->keyType) {
- throw new IllegalArgumentException(sprintf(
- 'Object of type %s is not the same type as %s',
- get_class($key),
- $this->keyType
- ));
- }
- }
-
- private function isValidValue($value) : bool
- {
- if (null === $value) {
- if ($this->allowNullValues) {
- return true;
- }
-
- return false;
- }
-
- switch ($this->valueType) {
- case 'mixed':
- return true;
-
- case 'bool':
- case 'boolean':
- return is_bool($value);
-
- case 'int':
- case 'integer':
- return is_int($value);
-
- case 'float':
- case 'double':
- return is_float($value);
-
- case 'string':
- return is_string($value);
-
- case 'object':
- return is_object($value);
-
- case 'array':
- return is_array($value);
- }
-
- return $value instanceof $this->valueType;
- }
-}
diff --git a/vendor/dasprid/enum/src/Exception/CloneNotSupportedException.php b/vendor/dasprid/enum/src/Exception/CloneNotSupportedException.php
deleted file mode 100644
index 4b37dbe..0000000
--- a/vendor/dasprid/enum/src/Exception/CloneNotSupportedException.php
+++ /dev/null
@@ -1,10 +0,0 @@
-getProperty('constants');
- $constantsProperty->setAccessible(true);
- $constantsProperty->setValue([]);
-
- $valuesProperty = $reflectionClass->getProperty('values');
- $valuesProperty->setAccessible(true);
- $valuesProperty->setValue([]);
-
- $allValuesLoadedProperty = $reflectionClass->getProperty('allValuesLoaded');
- $allValuesLoadedProperty->setAccessible(true);
- $allValuesLoadedProperty->setValue([]);
- }
-
- public function testToString() : void
- {
- $weekday = WeekDay::FRIDAY();
- self::assertSame('FRIDAY', (string) $weekday);
- }
-
- public function testName() : void
- {
- $this->assertSame('WEDNESDAY', WeekDay::WEDNESDAY()->name());
- }
-
- public function testOrdinal() : void
- {
- $this->assertSame(2, WeekDay::WEDNESDAY()->ordinal());
- }
-
- public function testSameInstanceIsReturned() : void
- {
- self::assertSame(WeekDay::FRIDAY(), WeekDay::FRIDAY());
- }
-
- public static function testValueOf() : void
- {
- self::assertSame(WeekDay::FRIDAY(), WeekDay::valueOf('FRIDAY'));
- }
-
- public function testValueOfInvalidConstant() : void
- {
- $this->expectException(IllegalArgumentException::class);
- WeekDay::valueOf('CATURDAY');
- }
-
- public function testExceptionOnCloneAttempt() : void
- {
- $this->expectException(CloneNotSupportedException::class);
- clone WeekDay::FRIDAY();
- }
-
- public function testExceptionOnSerializeAttempt() : void
- {
- $this->expectException(SerializeNotSupportedException::class);
- serialize(WeekDay::FRIDAY());
- }
-
- public function testExceptionOnUnserializeAttempt() : void
- {
- $this->expectException(UnserializeNotSupportedException::class);
- unserialize('O:24:"DASPRiD\\EnumTest\\WeekDay":0:{}');
- }
-
- public function testReturnValueOfValuesIsSortedByOrdinal() : void
- {
- // Initialize some week days out of order
- WeekDay::SATURDAY();
- WeekDay::TUESDAY();
-
- $ordinals = array_values(array_map(function (WeekDay $weekDay) : int {
- return $weekDay->ordinal();
- }, WeekDay::values()));
-
- self::assertSame([0, 1, 2, 3, 4, 5, 6], $ordinals);
-
- $cachedOrdinals = array_values(array_map(function (WeekDay $weekDay) : int {
- return $weekDay->ordinal();
- }, WeekDay::values()));
- $this->assertSame($ordinals, $cachedOrdinals);
- }
-
- public function testCompareTo() : void
- {
- $this->assertSame(-4, WeekDay::WEDNESDAY()->compareTo(WeekDay::SUNDAY()));
- $this->assertSame(4, WeekDay::SUNDAY()->compareTo(WeekDay::WEDNESDAY()));
- $this->assertSame(0, WeekDay::WEDNESDAY()->compareTo(WeekDay::WEDNESDAY()));
- }
-
- public function testCompareToWrongEnum() : void
- {
- $this->expectException(MismatchException::class);
- WeekDay::MONDAY()->compareTo(Planet::EARTH());
- }
-
- public function testParameterizedEnum() : void
- {
- $planet = Planet::EARTH();
- $this->assertSame(5.976e+24, $planet->mass());
- $this->assertSame(6.37814e6, $planet->radius());
- }
-}
diff --git a/vendor/dasprid/enum/test/EnumMapTest.php b/vendor/dasprid/enum/test/EnumMapTest.php
deleted file mode 100644
index d51a86c..0000000
--- a/vendor/dasprid/enum/test/EnumMapTest.php
+++ /dev/null
@@ -1,243 +0,0 @@
-expectException(IllegalArgumentException::class);
- new EnumMap(stdClass::class, 'string', false);
- }
-
- public function testUnexpectedKeyType() : void
- {
- $this->expectException(ExpectationException::class);
- $map = new EnumMap(WeekDay::class, 'string', false);
- $map->expect(Planet::class, 'string', false);
- }
-
- public function testUnexpectedValueType() : void
- {
- $this->expectException(ExpectationException::class);
- $map = new EnumMap(WeekDay::class, 'string', false);
- $map->expect(WeekDay::class, 'int', false);
- }
-
- public function testUnexpectedNullableValueType() : void
- {
- $this->expectException(ExpectationException::class);
- $map = new EnumMap(WeekDay::class, 'string', true);
- $map->expect(WeekDay::class, 'string', false);
- }
-
- public function testExpectedTypes() : void
- {
- $map = new EnumMap(WeekDay::class, 'string', true);
- $map->expect(WeekDay::class, 'string', true);
- $this->addToAssertionCount(1);
- }
-
- public function testSize() : void
- {
- $map = new EnumMap(WeekDay::class, 'string', true);
- $this->assertSame(0, $map->size());
- $map->put(WeekDay::MONDAY(), 'foo');
- $this->assertSame(1, $map->size());
- }
-
- public function testContainsValue() : void
- {
- $map = new EnumMap(WeekDay::class, 'string', true);
- $this->assertFalse($map->containsValue('foo'));
- $map->put(WeekDay::TUESDAY(), 'foo');
- $this->assertTrue($map->containsValue('foo'));
- $this->assertFalse($map->containsValue(null));
- $map->put(WeekDay::WEDNESDAY(), null);
- $this->assertTrue($map->containsValue(null));
- }
-
- public function testContainsKey() : void
- {
- $map = new EnumMap(WeekDay::class, 'string', true);
- $this->assertFalse($map->containsKey(WeekDay::TUESDAY()));
- $map->put(WeekDay::TUESDAY(), 'foo');
- $this->assertTrue($map->containsKey(WeekDay::TUESDAY()));
- $map->put(WeekDay::WEDNESDAY(), null);
- $this->assertTrue($map->containsKey(WeekDay::WEDNESDAY()));
- }
-
- public function testPutAndGet() : void
- {
- $map = new EnumMap(WeekDay::class, 'string', true);
- $map->put(WeekDay::TUESDAY(), 'foo');
- $map->put(WeekDay::FRIDAY(), null);
- $this->assertSame('foo', $map->get(WeekDay::TUESDAY()));
- $this->assertSame(null, $map->get(WeekDay::WEDNESDAY()));
- $this->assertSame(null, $map->get(WeekDay::FRIDAY()));
- }
-
- public function testPutInvalidKey() : void
- {
- $this->expectException(IllegalArgumentException::class);
- $map = new EnumMap(WeekDay::class, 'string', true);
- $map->put(Planet::MARS(), 'foo');
- }
-
- public function invalidValues() : array
- {
- return [
- ['bool', null, false],
- ['bool', 0],
- ['boolean', 0],
- ['int', 2.4],
- ['integer', 5.3],
- ['float', 3],
- ['double', 7],
- ['string', 1],
- ['object', 1],
- ['array', 1],
- [stdClass::class, 1],
- ];
- }
-
- /**
- * @dataProvider invalidValues
- * @param mixed $value
- */
- public function testPutInvalidValue(string $valueType, $value, bool $allowNull = true) : void
- {
- $this->expectException(IllegalArgumentException::class);
- $map = new EnumMap(WeekDay::class, $valueType, $allowNull);
- $map->put(WeekDay::TUESDAY(), $value);
- }
-
- public function validValues() : array
- {
- return [
- ['bool', null],
- ['mixed', 'foo'],
- ['mixed', 1],
- ['mixed', new stdClass()],
- ['bool', true],
- ['boolean', false],
- ['int', 1],
- ['integer', 4],
- ['float', 2.5],
- ['double', 6.4],
- ['string', 'foo'],
- ['object', new stdClass()],
- ['array', ['foo']],
- [stdClass::class, new stdClass()],
- ];
- }
-
- /**
- * @dataProvider validValues
- * @param mixed $value
- */
- public function testPutValidValue(string $valueType, $value, bool $allowNull = true) : void
- {
- $map = new EnumMap(WeekDay::class, $valueType, $allowNull);
- $map->put(WeekDay::TUESDAY(), $value);
- $this->addToAssertionCount(1);
- }
-
- public function testRemove() : void
- {
- $map = new EnumMap(WeekDay::class, 'string', true);
- $map->put(WeekDay::TUESDAY(), 'foo');
- $map->remove(WeekDay::TUESDAY());
- $map->remove(WeekDay::WEDNESDAY());
- $this->assertSame(null, $map->get(WeekDay::TUESDAY()));
- $this->assertSame(0, $map->size());
- }
-
- public function testClear() : void
- {
- $map = new EnumMap(WeekDay::class, 'string', true);
- $map->put(WeekDay::TUESDAY(), 'foo');
- $map->clear();
- $this->assertSame(null, $map->get(WeekDay::TUESDAY()));
- $this->assertSame(0, $map->size());
- }
-
- public function testEqualsWithSameInstance() : void
- {
- $map = new EnumMap(WeekDay::class, 'string', true);
- $this->assertTrue($map->equals($map));
- }
-
- public function testEqualsWithDifferentSize() : void
- {
- $mapA = new EnumMap(WeekDay::class, 'string', true);
- $mapB = new EnumMap(WeekDay::class, 'string', true);
- $mapB->put(WeekDay::MONDAY(), 'foo');
-
- $this->assertFalse($mapA->equals($mapB));
- }
-
- public function testEqualsWithDifferentValues() : void
- {
- $mapA = new EnumMap(WeekDay::class, 'string', true);
- $mapA->put(WeekDay::MONDAY(), 'foo');
- $mapB = new EnumMap(WeekDay::class, 'string', true);
- $mapB->put(WeekDay::MONDAY(), 'bar');
-
- $this->assertFalse($mapA->equals($mapB));
- }
-
- public function testEqualsWithDifferentConstants() : void
- {
- $mapA = new EnumMap(WeekDay::class, 'string', true);
- $mapA->put(WeekDay::MONDAY(), 'foo');
- $mapB = new EnumMap(WeekDay::class, 'string', true);
- $mapB->put(WeekDay::TUESDAY(), 'foo');
-
- $this->assertFalse($mapA->equals($mapB));
- }
-
- public function testValues() : void
- {
- $map = new EnumMap(WeekDay::class, 'string', true);
- $this->assertSame([], $map->values());
-
- $map->put(WeekDay::FRIDAY(), 'foo');
- $map->put(WeekDay::TUESDAY(), 'bar');
- $map->put(WeekDay::SUNDAY(), null);
-
- $this->assertSame(['bar', 'foo', null], $map->values());
- }
-
- public function testSerializeAndUnserialize() : void
- {
- $mapA = new EnumMap(WeekDay::class, 'string', true);
- $mapA->put(WeekDay::MONDAY(), 'foo');
- $mapB = unserialize(serialize($mapA));
-
- $this->assertTrue($mapA->equals($mapB));
- }
-
- public function testIterator() : void
- {
- $map = new EnumMap(WeekDay::class, 'string', true);
- $map->put(WeekDay::FRIDAY(), 'foo');
- $map->put(WeekDay::TUESDAY(), 'bar');
- $map->put(WeekDay::SUNDAY(), null);
-
- $result = [];
-
- foreach ($map as $key => $value) {
- $result[$key->ordinal()] = $value;
- }
-
- $this->assertSame([1 => 'bar', 4 => 'foo', 6 => null], $result);
- }
-}
diff --git a/vendor/dasprid/enum/test/NullValueTest.php b/vendor/dasprid/enum/test/NullValueTest.php
deleted file mode 100644
index 9f70640..0000000
--- a/vendor/dasprid/enum/test/NullValueTest.php
+++ /dev/null
@@ -1,31 +0,0 @@
-expectException(CloneNotSupportedException::class);
- clone NullValue::instance();
- }
-
- public function testExceptionOnSerializeAttempt() : void
- {
- $this->expectException(SerializeNotSupportedException::class);
- serialize(NullValue::instance());
- }
-
- public function testExceptionOnUnserializeAttempt() : void
- {
- $this->expectException(UnserializeNotSupportedException::class);
- unserialize('O:22:"DASPRiD\\Enum\\NullValue":0:{}');
- }
-}
diff --git a/vendor/dasprid/enum/test/Planet.php b/vendor/dasprid/enum/test/Planet.php
deleted file mode 100644
index 3c44c1d..0000000
--- a/vendor/dasprid/enum/test/Planet.php
+++ /dev/null
@@ -1,73 +0,0 @@
-mass = $mass;
- $this->radius = $radius;
- }
-
- public function mass() : float
- {
- return $this->mass;
- }
-
- public function radius() : float
- {
- return $this->radius;
- }
-
- public function surfaceGravity() : float
- {
- return self::G * $this->mass / ($this->radius * $this->radius);
- }
-
- public function surfaceWeight(float $otherMass) : float
- {
- return $otherMass * $this->surfaceGravity();
- }
-}
diff --git a/vendor/dasprid/enum/test/WeekDay.php b/vendor/dasprid/enum/test/WeekDay.php
deleted file mode 100644
index 70b8db5..0000000
--- a/vendor/dasprid/enum/test/WeekDay.php
+++ /dev/null
@@ -1,26 +0,0 @@
-writer(new PngWriter())
- ->writerOptions([])
- ->data('Custom QR code contents')
- ->encoding(new Encoding('UTF-8'))
- ->errorCorrectionLevel(new ErrorCorrectionLevelHigh())
- ->size(300)
- ->margin(10)
- ->roundBlockSizeMode(new RoundBlockSizeModeMargin())
- ->logoPath(__DIR__.'/assets/symfony.png')
- ->labelText('This is the label')
- ->labelFont(new NotoSans(20))
- ->labelAlignment(new LabelAlignmentCenter())
- ->validateResult(false)
- ->build();
-```
-
-## Usage: without using the builder
-
-```php
-use Endroid\QrCode\Color\Color;
-use Endroid\QrCode\Encoding\Encoding;
-use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelLow;
-use Endroid\QrCode\QrCode;
-use Endroid\QrCode\Label\Label;
-use Endroid\QrCode\Logo\Logo;
-use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeMargin;
-use Endroid\QrCode\Writer\PngWriter;
-use Endroid\QrCode\Writer\ValidationException;
-
-$writer = new PngWriter();
-
-// Create QR code
-$qrCode = QrCode::create('Life is too short to be generating QR codes')
- ->setEncoding(new Encoding('UTF-8'))
- ->setErrorCorrectionLevel(new ErrorCorrectionLevelLow())
- ->setSize(300)
- ->setMargin(10)
- ->setRoundBlockSizeMode(new RoundBlockSizeModeMargin())
- ->setForegroundColor(new Color(0, 0, 0))
- ->setBackgroundColor(new Color(255, 255, 255));
-
-// Create generic logo
-$logo = Logo::create(__DIR__.'/assets/symfony.png')
- ->setResizeToWidth(50);
-
-// Create generic label
-$label = Label::create('Label')
- ->setTextColor(new Color(255, 0, 0));
-
-$result = $writer->write($qrCode, $logo, $label);
-
-// Validate the result
-$writer->validateResult($result, 'Life is too short to be generating QR codes');
-```
-
-## Usage: working with results
-
-```php
-
-// Directly output the QR code
-header('Content-Type: '.$result->getMimeType());
-echo $result->getString();
-
-// Save it to a file
-$result->saveToFile(__DIR__.'/qrcode.png');
-
-// Generate a data URI to include image data inline (i.e. inside an tag)
-$dataUri = $result->getDataUri();
-```
-
-
-
-### Writer options
-
-```php
-use Endroid\QrCode\Writer\SvgWriter;
-
-$builder->setWriterOptions([SvgWriter::WRITER_OPTION_EXCLUDE_XML_DECLARATION => true]);
-```
-
-### Encoding
-
-If you use a barcode scanner you can have some troubles while reading the
-generated QR codes. Depending on the encoding you chose you will have an extra
-amount of data corresponding to the ECI block. Some barcode scanner are not
-programmed to interpret this block of information. To ensure a maximum
-compatibility you can use the `ISO-8859-1` encoding that is the default
-encoding used by barcode scanners (if your character set supports it,
-i.e. no Chinese characters are present).
-
-### Round block size mode
-
-By default block sizes are rounded to guarantee sharp images and improve
-readability. However some other rounding variants are available.
-
-* `margin (default)`: the size of the QR code is shrunk if necessary but the size
- of the final image remains unchanged due to additional margin being added.
-* `enlarge`: the size of the QR code and the final image are enlarged when
- rounding differences occur.
-* `shrink`: the size of the QR code and the final image are
- shrunk when rounding differences occur.
-* `none`: No rounding. This mode can be used when blocks don't need to be rounded
- to pixels (for instance SVG).
-
-## Readability
-
-The readability of a QR code is primarily determined by the size, the input
-length, the error correction level and any possible logo over the image so you
-can tweak these parameters if you are looking for optimal results. You can also
-check $qrCode->getRoundBlockSize() value to see if block dimensions are rounded
-so that the image is more sharp and readable. Please note that rounding block
-size can result in additional padding to compensate for the rounding difference.
-And finally the encoding (default UTF-8 to support large character sets) can be
-set to `ISO-8859-1` if possible to improve readability.
-
-## Validating the generated QR code
-
-If you need to be extra sure the QR code you generated is readable and contains
-the exact data you requested you can enable the validation reader, which is
-disabled by default. You can do this either via the builder or directly on any
-writer that supports validation. See the examples above.
-
-Please note that validation affects performance so only use it in case of problems.
-
-## Symfony integration
-
-The [endroid/qr-code-bundle](https://github.com/endroid/qr-code-bundle)
-integrates the QR code library in Symfony for an even better experience.
-
-* Configure your defaults (like image size, default writer etc.)
-* Support for multiple configurations and injection via aliases
-* Generate QR codes for defined configurations via URL like /qr-code//Hello
-* Generate QR codes or URLs directly from Twig using dedicated functions
-
-Read the [bundle documentation](https://github.com/endroid/qr-code-bundle)
-for more information.
-
-## Versioning
-
-Version numbers follow the MAJOR.MINOR.PATCH scheme. Backwards compatibility
-breaking changes will be kept to a minimum but be aware that these can occur.
-Lock your dependencies for production and test your code when upgrading.
-
-## License
-
-This bundle is under the MIT license. For the full copyright and license
-information please view the LICENSE file that was distributed with this source code.
diff --git a/vendor/endroid/qr-code/assets/blackfire.png b/vendor/endroid/qr-code/assets/blackfire.png
deleted file mode 100644
index bc378fd..0000000
Binary files a/vendor/endroid/qr-code/assets/blackfire.png and /dev/null differ
diff --git a/vendor/endroid/qr-code/assets/noto_sans.otf b/vendor/endroid/qr-code/assets/noto_sans.otf
deleted file mode 100644
index 296fbeb..0000000
Binary files a/vendor/endroid/qr-code/assets/noto_sans.otf and /dev/null differ
diff --git a/vendor/endroid/qr-code/assets/open_sans.ttf b/vendor/endroid/qr-code/assets/open_sans.ttf
deleted file mode 100644
index db43334..0000000
Binary files a/vendor/endroid/qr-code/assets/open_sans.ttf and /dev/null differ
diff --git a/vendor/endroid/qr-code/composer.json b/vendor/endroid/qr-code/composer.json
deleted file mode 100644
index 9fd62c0..0000000
--- a/vendor/endroid/qr-code/composer.json
+++ /dev/null
@@ -1,51 +0,0 @@
-{
- "name": "endroid/qr-code",
- "description": "Endroid QR Code",
- "keywords": ["endroid", "qrcode", "qr", "code", "php"],
- "homepage": "https://github.com/endroid/qr-code",
- "type": "library",
- "license": "MIT",
- "authors": [
- {
- "name": "Jeroen van den Enden",
- "email": "info@endroid.nl"
- }
- ],
- "require": {
- "php": "^7.4||^8.0",
- "bacon/bacon-qr-code": "^2.0.5"
- },
- "require-dev": {
- "ext-gd": "*",
- "endroid/quality": "dev-master",
- "khanamiryan/qrcode-detector-decoder": "^1.0.4",
- "setasign/fpdf": "^1.8.2"
- },
- "suggest": {
- "ext-gd": "Enables you to write PNG images",
- "khanamiryan/qrcode-detector-decoder": "Enables you to use the image validator",
- "roave/security-advisories": "Makes sure package versions with known security issues are not installed",
- "setasign/fpdf": "Enables you to use the PDF writer"
- },
- "autoload": {
- "psr-4": {
- "Endroid\\QrCode\\": "src/"
- }
- },
- "autoload-dev": {
- "psr-4": {
- "Endroid\\QrCode\\Tests\\": "tests/"
- }
- },
- "config": {
- "sort-packages": true,
- "preferred-install": {
- "endroid/*": "source"
- }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "4.x-dev"
- }
- }
-}
diff --git a/vendor/endroid/qr-code/src/Bacon/ErrorCorrectionLevelConverter.php b/vendor/endroid/qr-code/src/Bacon/ErrorCorrectionLevelConverter.php
deleted file mode 100644
index 90f23e0..0000000
--- a/vendor/endroid/qr-code/src/Bacon/ErrorCorrectionLevelConverter.php
+++ /dev/null
@@ -1,30 +0,0 @@
-getErrorCorrectionLevel());
- $baconMatrix = Encoder::encode($qrCode->getData(), $baconErrorCorrectionLevel, strval($qrCode->getEncoding()))->getMatrix();
-
- $blockValues = [];
- $columnCount = $baconMatrix->getWidth();
- $rowCount = $baconMatrix->getHeight();
- for ($rowIndex = 0; $rowIndex < $rowCount; ++$rowIndex) {
- $blockValues[$rowIndex] = [];
- for ($columnIndex = 0; $columnIndex < $columnCount; ++$columnIndex) {
- $blockValues[$rowIndex][$columnIndex] = $baconMatrix->get($columnIndex, $rowIndex);
- }
- }
-
- return new Matrix($blockValues, $qrCode->getSize(), $qrCode->getMargin(), $qrCode->getRoundBlockSizeMode());
- }
-}
diff --git a/vendor/endroid/qr-code/src/Builder/Builder.php b/vendor/endroid/qr-code/src/Builder/Builder.php
deleted file mode 100644
index 63fd28b..0000000
--- a/vendor/endroid/qr-code/src/Builder/Builder.php
+++ /dev/null
@@ -1,279 +0,0 @@
-{
- * data: string,
- * writer: WriterInterface,
- * writerOptions: array,
- * qrCodeClass: class-string,
- * logoClass: class-string,
- * labelClass: class-string,
- * validateResult: bool,
- * size?: int,
- * encoding?: EncodingInterface,
- * errorCorrectionLevel?: ErrorCorrectionLevelInterface,
- * roundBlockSizeMode?: RoundBlockSizeModeInterface,
- * margin?: int,
- * backgroundColor?: ColorInterface,
- * foregroundColor?: ColorInterface,
- * labelText?: string,
- * labelFont?: FontInterface,
- * labelAlignment?: LabelAlignmentInterface,
- * labelMargin?: MarginInterface,
- * labelTextColor?: ColorInterface,
- * logoPath?: string,
- * logoResizeToWidth?: int,
- * logoResizeToHeight?: int,
- * logoPunchoutBackground?: bool
- * }
- */
- private array $options;
-
- public function __construct()
- {
- $this->options = [
- 'data' => '',
- 'writer' => new PngWriter(),
- 'writerOptions' => [],
- 'qrCodeClass' => QrCode::class,
- 'logoClass' => Logo::class,
- 'labelClass' => Label::class,
- 'validateResult' => false,
- ];
- }
-
- public static function create(): BuilderInterface
- {
- return new self();
- }
-
- public function writer(WriterInterface $writer): BuilderInterface
- {
- $this->options['writer'] = $writer;
-
- return $this;
- }
-
- /** @param array $writerOptions */
- public function writerOptions(array $writerOptions): BuilderInterface
- {
- $this->options['writerOptions'] = $writerOptions;
-
- return $this;
- }
-
- public function data(string $data): BuilderInterface
- {
- $this->options['data'] = $data;
-
- return $this;
- }
-
- public function encoding(EncodingInterface $encoding): BuilderInterface
- {
- $this->options['encoding'] = $encoding;
-
- return $this;
- }
-
- public function errorCorrectionLevel(ErrorCorrectionLevelInterface $errorCorrectionLevel): BuilderInterface
- {
- $this->options['errorCorrectionLevel'] = $errorCorrectionLevel;
-
- return $this;
- }
-
- public function size(int $size): BuilderInterface
- {
- $this->options['size'] = $size;
-
- return $this;
- }
-
- public function margin(int $margin): BuilderInterface
- {
- $this->options['margin'] = $margin;
-
- return $this;
- }
-
- public function roundBlockSizeMode(RoundBlockSizeModeInterface $roundBlockSizeMode): BuilderInterface
- {
- $this->options['roundBlockSizeMode'] = $roundBlockSizeMode;
-
- return $this;
- }
-
- public function foregroundColor(ColorInterface $foregroundColor): BuilderInterface
- {
- $this->options['foregroundColor'] = $foregroundColor;
-
- return $this;
- }
-
- public function backgroundColor(ColorInterface $backgroundColor): BuilderInterface
- {
- $this->options['backgroundColor'] = $backgroundColor;
-
- return $this;
- }
-
- public function logoPath(string $logoPath): BuilderInterface
- {
- $this->options['logoPath'] = $logoPath;
-
- return $this;
- }
-
- public function logoResizeToWidth(int $logoResizeToWidth): BuilderInterface
- {
- $this->options['logoResizeToWidth'] = $logoResizeToWidth;
-
- return $this;
- }
-
- public function logoResizeToHeight(int $logoResizeToHeight): BuilderInterface
- {
- $this->options['logoResizeToHeight'] = $logoResizeToHeight;
-
- return $this;
- }
-
- public function logoPunchoutBackground(bool $logoPunchoutBackground): BuilderInterface
- {
- $this->options['logoPunchoutBackground'] = $logoPunchoutBackground;
-
- return $this;
- }
-
- public function labelText(string $labelText): BuilderInterface
- {
- $this->options['labelText'] = $labelText;
-
- return $this;
- }
-
- public function labelFont(FontInterface $labelFont): BuilderInterface
- {
- $this->options['labelFont'] = $labelFont;
-
- return $this;
- }
-
- public function labelAlignment(LabelAlignmentInterface $labelAlignment): BuilderInterface
- {
- $this->options['labelAlignment'] = $labelAlignment;
-
- return $this;
- }
-
- public function labelMargin(MarginInterface $labelMargin): BuilderInterface
- {
- $this->options['labelMargin'] = $labelMargin;
-
- return $this;
- }
-
- public function labelTextColor(ColorInterface $labelTextColor): BuilderInterface
- {
- $this->options['labelTextColor'] = $labelTextColor;
-
- return $this;
- }
-
- public function validateResult(bool $validateResult): BuilderInterface
- {
- $this->options['validateResult'] = $validateResult;
-
- return $this;
- }
-
- public function build(): ResultInterface
- {
- $writer = $this->options['writer'];
-
- if ($this->options['validateResult'] && !$writer instanceof ValidatingWriterInterface) {
- throw ValidationException::createForUnsupportedWriter(strval(get_class($writer)));
- }
-
- /** @var QrCode $qrCode */
- $qrCode = $this->buildObject($this->options['qrCodeClass']);
-
- /** @var LogoInterface|null $logo */
- $logo = $this->buildObject($this->options['logoClass'], 'logo');
-
- /** @var LabelInterface|null $label */
- $label = $this->buildObject($this->options['labelClass'], 'label');
-
- $result = $writer->write($qrCode, $logo, $label, $this->options['writerOptions']);
-
- if ($this->options['validateResult'] && $writer instanceof ValidatingWriterInterface) {
- $writer->validateResult($result, $qrCode->getData());
- }
-
- return $result;
- }
-
- /**
- * @param class-string $class
- *
- * @return mixed
- */
- private function buildObject(string $class, string $optionsPrefix = null)
- {
- /** @var \ReflectionClass $reflectionClass */
- $reflectionClass = new \ReflectionClass($class);
-
- $arguments = [];
- $hasBuilderOptions = false;
- $missingRequiredArguments = [];
- /** @var \ReflectionMethod $constructor */
- $constructor = $reflectionClass->getConstructor();
- $constructorParameters = $constructor->getParameters();
- foreach ($constructorParameters as $parameter) {
- $optionName = null === $optionsPrefix ? $parameter->getName() : $optionsPrefix.ucfirst($parameter->getName());
- if (isset($this->options[$optionName])) {
- $hasBuilderOptions = true;
- $arguments[] = $this->options[$optionName];
- } elseif ($parameter->isDefaultValueAvailable()) {
- $arguments[] = $parameter->getDefaultValue();
- } else {
- $missingRequiredArguments[] = $optionName;
- }
- }
-
- if (!$hasBuilderOptions) {
- return null;
- }
-
- if (count($missingRequiredArguments) > 0) {
- throw new \Exception(sprintf('Missing required arguments: %s', implode(', ', $missingRequiredArguments)));
- }
-
- return $reflectionClass->newInstanceArgs($arguments);
- }
-}
diff --git a/vendor/endroid/qr-code/src/Builder/BuilderInterface.php b/vendor/endroid/qr-code/src/Builder/BuilderInterface.php
deleted file mode 100644
index 5e69bc2..0000000
--- a/vendor/endroid/qr-code/src/Builder/BuilderInterface.php
+++ /dev/null
@@ -1,63 +0,0 @@
- $writerOptions */
- public function writerOptions(array $writerOptions): BuilderInterface;
-
- public function data(string $data): BuilderInterface;
-
- public function encoding(EncodingInterface $encoding): BuilderInterface;
-
- public function errorCorrectionLevel(ErrorCorrectionLevelInterface $errorCorrectionLevel): BuilderInterface;
-
- public function size(int $size): BuilderInterface;
-
- public function margin(int $margin): BuilderInterface;
-
- public function roundBlockSizeMode(RoundBlockSizeModeInterface $roundBlockSizeMode): BuilderInterface;
-
- public function foregroundColor(ColorInterface $foregroundColor): BuilderInterface;
-
- public function backgroundColor(ColorInterface $backgroundColor): BuilderInterface;
-
- public function logoPath(string $logoPath): BuilderInterface;
-
- public function logoResizeToWidth(int $logoResizeToWidth): BuilderInterface;
-
- public function logoResizeToHeight(int $logoResizeToHeight): BuilderInterface;
-
- public function logoPunchoutBackground(bool $logoPunchoutBackground): BuilderInterface;
-
- public function labelText(string $labelText): BuilderInterface;
-
- public function labelFont(FontInterface $labelFont): BuilderInterface;
-
- public function labelAlignment(LabelAlignmentInterface $labelAlignment): BuilderInterface;
-
- public function labelMargin(MarginInterface $labelMargin): BuilderInterface;
-
- public function labelTextColor(ColorInterface $labelTextColor): BuilderInterface;
-
- public function validateResult(bool $validateResult): BuilderInterface;
-
- public function build(): ResultInterface;
-}
diff --git a/vendor/endroid/qr-code/src/Builder/BuilderRegistry.php b/vendor/endroid/qr-code/src/Builder/BuilderRegistry.php
deleted file mode 100644
index cf1449c..0000000
--- a/vendor/endroid/qr-code/src/Builder/BuilderRegistry.php
+++ /dev/null
@@ -1,25 +0,0 @@
- */
- private array $builders = [];
-
- public function getBuilder(string $name): BuilderInterface
- {
- if (!isset($this->builders[$name])) {
- throw new \Exception(sprintf('Builder with name "%s" not available from registry', $name));
- }
-
- return $this->builders[$name];
- }
-
- public function addBuilder(string $name, BuilderInterface $builder): void
- {
- $this->builders[$name] = $builder;
- }
-}
diff --git a/vendor/endroid/qr-code/src/Builder/BuilderRegistryInterface.php b/vendor/endroid/qr-code/src/Builder/BuilderRegistryInterface.php
deleted file mode 100644
index 048d649..0000000
--- a/vendor/endroid/qr-code/src/Builder/BuilderRegistryInterface.php
+++ /dev/null
@@ -1,12 +0,0 @@
-red = $red;
- $this->green = $green;
- $this->blue = $blue;
- $this->alpha = $alpha;
- }
-
- public function getRed(): int
- {
- return $this->red;
- }
-
- public function getGreen(): int
- {
- return $this->green;
- }
-
- public function getBlue(): int
- {
- return $this->blue;
- }
-
- public function getAlpha(): int
- {
- return $this->alpha;
- }
-
- public function getOpacity(): float
- {
- return 1 - $this->alpha / 127;
- }
-
- public function getHex(): string
- {
- return sprintf('#%02x%02x%02x', $this->red, $this->green, $this->blue);
- }
-
- public function toArray(): array
- {
- return [
- 'red' => $this->red,
- 'green' => $this->green,
- 'blue' => $this->blue,
- 'alpha' => $this->alpha,
- ];
- }
-}
diff --git a/vendor/endroid/qr-code/src/Color/ColorInterface.php b/vendor/endroid/qr-code/src/Color/ColorInterface.php
deleted file mode 100644
index 398be26..0000000
--- a/vendor/endroid/qr-code/src/Color/ColorInterface.php
+++ /dev/null
@@ -1,23 +0,0 @@
- */
- public function toArray(): array;
-}
diff --git a/vendor/endroid/qr-code/src/Encoding/Encoding.php b/vendor/endroid/qr-code/src/Encoding/Encoding.php
deleted file mode 100644
index 2126d1e..0000000
--- a/vendor/endroid/qr-code/src/Encoding/Encoding.php
+++ /dev/null
@@ -1,24 +0,0 @@
-value = $value;
- }
-
- public function __toString(): string
- {
- return $this->value;
- }
-}
diff --git a/vendor/endroid/qr-code/src/Encoding/EncodingInterface.php b/vendor/endroid/qr-code/src/Encoding/EncodingInterface.php
deleted file mode 100644
index f57001b..0000000
--- a/vendor/endroid/qr-code/src/Encoding/EncodingInterface.php
+++ /dev/null
@@ -1,10 +0,0 @@
-width = $width;
- $this->height = $height;
- }
-
- public static function createForLabel(LabelInterface $label): self
- {
- if (false !== strpos($label->getText(), "\n")) {
- throw new \Exception('Label does not support line breaks');
- }
-
- if (!function_exists('imagettfbbox')) {
- throw new \Exception('Function "imagettfbbox" does not exist: check your FreeType installation');
- }
-
- $labelBox = imagettfbbox($label->getFont()->getSize(), 0, $label->getFont()->getPath(), $label->getText());
-
- if (!is_array($labelBox)) {
- throw new \Exception('Unable to generate label image box: check your FreeType installation');
- }
-
- return new self(
- intval($labelBox[2] - $labelBox[0]),
- intval($labelBox[0] - $labelBox[7])
- );
- }
-
- public function getWidth(): int
- {
- return $this->width;
- }
-
- public function getHeight(): int
- {
- return $this->height;
- }
-}
diff --git a/vendor/endroid/qr-code/src/ImageData/LogoImageData.php b/vendor/endroid/qr-code/src/ImageData/LogoImageData.php
deleted file mode 100644
index 75b4078..0000000
--- a/vendor/endroid/qr-code/src/ImageData/LogoImageData.php
+++ /dev/null
@@ -1,164 +0,0 @@
-data = $data;
- $this->image = $image;
- $this->mimeType = $mimeType;
- $this->width = $width;
- $this->height = $height;
- $this->punchoutBackground = $punchoutBackground;
- }
-
- public static function createForLogo(LogoInterface $logo): self
- {
- $data = @file_get_contents($logo->getPath());
-
- if (!is_string($data)) {
- throw new \Exception(sprintf('Invalid data at path "%s"', $logo->getPath()));
- }
-
- if (false !== filter_var($logo->getPath(), FILTER_VALIDATE_URL)) {
- $mimeType = self::detectMimeTypeFromUrl($logo->getPath());
- } else {
- $mimeType = self::detectMimeTypeFromPath($logo->getPath());
- }
-
- $width = $logo->getResizeToWidth();
- $height = $logo->getResizeToHeight();
-
- if ('image/svg+xml' === $mimeType) {
- if (null === $width || null === $height) {
- throw new \Exception('SVG Logos require an explicitly set resize width and height');
- }
-
- return new self($data, null, $mimeType, $width, $height, $logo->getPunchoutBackground());
- }
-
- $image = @imagecreatefromstring($data);
-
- if (!$image) {
- throw new \Exception(sprintf('Unable to parse image data at path "%s"', $logo->getPath()));
- }
-
- // No target width and height specified: use from original image
- if (null !== $width && null !== $height) {
- return new self($data, $image, $mimeType, $width, $height, $logo->getPunchoutBackground());
- }
-
- // Only target width specified: calculate height
- if (null !== $width && null === $height) {
- return new self($data, $image, $mimeType, $width, intval(imagesy($image) * $width / imagesx($image)), $logo->getPunchoutBackground());
- }
-
- // Only target height specified: calculate width
- if (null === $width && null !== $height) {
- return new self($data, $image, $mimeType, intval(imagesx($image) * $height / imagesy($image)), $height, $logo->getPunchoutBackground());
- }
-
- return new self($data, $image, $mimeType, imagesx($image), imagesy($image), $logo->getPunchoutBackground());
- }
-
- public function getData(): string
- {
- return $this->data;
- }
-
- /** @return mixed */
- public function getImage()
- {
- if (null === $this->image) {
- throw new \Exception('SVG Images have no image resource');
- }
-
- return $this->image;
- }
-
- public function getMimeType(): string
- {
- return $this->mimeType;
- }
-
- public function getWidth(): int
- {
- return $this->width;
- }
-
- public function getHeight(): int
- {
- return $this->height;
- }
-
- public function getPunchoutBackground(): bool
- {
- return $this->punchoutBackground;
- }
-
- public function createDataUri(): string
- {
- return 'data:'.$this->mimeType.';base64,'.base64_encode($this->data);
- }
-
- private static function detectMimeTypeFromUrl(string $url): string
- {
- /** @var mixed $format */
- $format = PHP_VERSION_ID >= 80000 ? true : 1;
-
- $headers = get_headers($url, $format);
-
- if (!is_array($headers) || !isset($headers['Content-Type'])) {
- throw new \Exception(sprintf('Content type could not be determined for logo URL "%s"', $url));
- }
-
- return is_array($headers['Content-Type']) ? $headers['Content-Type'][1] : $headers['Content-Type'];
- }
-
- private static function detectMimeTypeFromPath(string $path): string
- {
- if (!function_exists('mime_content_type')) {
- throw new \Exception('You need the ext-fileinfo extension to determine logo mime type');
- }
-
- $mimeType = @mime_content_type($path);
-
- if (!is_string($mimeType)) {
- throw new \Exception('Could not determine mime type');
- }
-
- if (!preg_match('#^image/#', $mimeType)) {
- throw new \Exception('Logo path is not an image');
- }
-
- // Passing mime type image/svg results in invisible images
- if ('image/svg' === $mimeType) {
- return 'image/svg+xml';
- }
-
- return $mimeType;
- }
-}
diff --git a/vendor/endroid/qr-code/src/Label/Alignment/LabelAlignmentCenter.php b/vendor/endroid/qr-code/src/Label/Alignment/LabelAlignmentCenter.php
deleted file mode 100644
index c13e287..0000000
--- a/vendor/endroid/qr-code/src/Label/Alignment/LabelAlignmentCenter.php
+++ /dev/null
@@ -1,9 +0,0 @@
-validatePath($path);
-
- $this->path = $path;
- $this->size = $size;
- }
-
- private function validatePath(string $path): void
- {
- if (!file_exists($path)) {
- throw new \Exception(sprintf('Invalid font path "%s"', $path));
- }
- }
-
- public function getPath(): string
- {
- return $this->path;
- }
-
- public function getSize(): int
- {
- return $this->size;
- }
-}
diff --git a/vendor/endroid/qr-code/src/Label/Font/FontInterface.php b/vendor/endroid/qr-code/src/Label/Font/FontInterface.php
deleted file mode 100644
index 1c0de9a..0000000
--- a/vendor/endroid/qr-code/src/Label/Font/FontInterface.php
+++ /dev/null
@@ -1,12 +0,0 @@
-size = $size;
- }
-
- public function getPath(): string
- {
- return __DIR__.'/../../../assets/noto_sans.otf';
- }
-
- public function getSize(): int
- {
- return $this->size;
- }
-}
diff --git a/vendor/endroid/qr-code/src/Label/Font/OpenSans.php b/vendor/endroid/qr-code/src/Label/Font/OpenSans.php
deleted file mode 100644
index 4daab73..0000000
--- a/vendor/endroid/qr-code/src/Label/Font/OpenSans.php
+++ /dev/null
@@ -1,25 +0,0 @@
-size = $size;
- }
-
- public function getPath(): string
- {
- return __DIR__.'/../../../assets/open_sans.ttf';
- }
-
- public function getSize(): int
- {
- return $this->size;
- }
-}
diff --git a/vendor/endroid/qr-code/src/Label/Label.php b/vendor/endroid/qr-code/src/Label/Label.php
deleted file mode 100644
index 4c51c75..0000000
--- a/vendor/endroid/qr-code/src/Label/Label.php
+++ /dev/null
@@ -1,102 +0,0 @@
-text = $text;
- $this->font = $font ?? new Font(__DIR__.'/../../assets/noto_sans.otf', 16);
- $this->alignment = $alignment ?? new LabelAlignmentCenter();
- $this->margin = $margin ?? new Margin(0, 10, 10, 10);
- $this->textColor = $textColor ?? new Color(0, 0, 0);
- }
-
- public static function create(string $text): self
- {
- return new self($text);
- }
-
- public function getText(): string
- {
- return $this->text;
- }
-
- public function setText(string $text): self
- {
- $this->text = $text;
-
- return $this;
- }
-
- public function getFont(): FontInterface
- {
- return $this->font;
- }
-
- public function setFont(FontInterface $font): self
- {
- $this->font = $font;
-
- return $this;
- }
-
- public function getAlignment(): LabelAlignmentInterface
- {
- return $this->alignment;
- }
-
- public function setAlignment(LabelAlignmentInterface $alignment): self
- {
- $this->alignment = $alignment;
-
- return $this;
- }
-
- public function getMargin(): MarginInterface
- {
- return $this->margin;
- }
-
- public function setMargin(MarginInterface $margin): self
- {
- $this->margin = $margin;
-
- return $this;
- }
-
- public function getTextColor(): ColorInterface
- {
- return $this->textColor;
- }
-
- public function setTextColor(ColorInterface $textColor): self
- {
- $this->textColor = $textColor;
-
- return $this;
- }
-}
diff --git a/vendor/endroid/qr-code/src/Label/LabelInterface.php b/vendor/endroid/qr-code/src/Label/LabelInterface.php
deleted file mode 100644
index a7d2ed6..0000000
--- a/vendor/endroid/qr-code/src/Label/LabelInterface.php
+++ /dev/null
@@ -1,23 +0,0 @@
-top = $top;
- $this->right = $right;
- $this->bottom = $bottom;
- $this->left = $left;
- }
-
- public function getTop(): int
- {
- return $this->top;
- }
-
- public function getRight(): int
- {
- return $this->right;
- }
-
- public function getBottom(): int
- {
- return $this->bottom;
- }
-
- public function getLeft(): int
- {
- return $this->left;
- }
-
- /** @return array */
- public function toArray(): array
- {
- return [
- 'top' => $this->top,
- 'right' => $this->right,
- 'bottom' => $this->bottom,
- 'left' => $this->left,
- ];
- }
-}
diff --git a/vendor/endroid/qr-code/src/Label/Margin/MarginInterface.php b/vendor/endroid/qr-code/src/Label/Margin/MarginInterface.php
deleted file mode 100644
index bc428bd..0000000
--- a/vendor/endroid/qr-code/src/Label/Margin/MarginInterface.php
+++ /dev/null
@@ -1,19 +0,0 @@
- */
- public function toArray(): array;
-}
diff --git a/vendor/endroid/qr-code/src/Logo/Logo.php b/vendor/endroid/qr-code/src/Logo/Logo.php
deleted file mode 100644
index b50d743..0000000
--- a/vendor/endroid/qr-code/src/Logo/Logo.php
+++ /dev/null
@@ -1,74 +0,0 @@
-path = $path;
- $this->resizeToWidth = $resizeToWidth;
- $this->resizeToHeight = $resizeToHeight;
- $this->punchoutBackground = $punchoutBackground;
- }
-
- public static function create(string $path): self
- {
- return new self($path);
- }
-
- public function getPath(): string
- {
- return $this->path;
- }
-
- public function setPath(string $path): self
- {
- $this->path = $path;
-
- return $this;
- }
-
- public function getResizeToWidth(): ?int
- {
- return $this->resizeToWidth;
- }
-
- public function setResizeToWidth(?int $resizeToWidth): self
- {
- $this->resizeToWidth = $resizeToWidth;
-
- return $this;
- }
-
- public function getResizeToHeight(): ?int
- {
- return $this->resizeToHeight;
- }
-
- public function setResizeToHeight(?int $resizeToHeight): self
- {
- $this->resizeToHeight = $resizeToHeight;
-
- return $this;
- }
-
- public function getPunchoutBackground(): bool
- {
- return $this->punchoutBackground;
- }
-
- public function setPunchoutBackground(bool $punchoutBackground): self
- {
- $this->punchoutBackground = $punchoutBackground;
-
- return $this;
- }
-}
diff --git a/vendor/endroid/qr-code/src/Logo/LogoInterface.php b/vendor/endroid/qr-code/src/Logo/LogoInterface.php
deleted file mode 100644
index 13d940c..0000000
--- a/vendor/endroid/qr-code/src/Logo/LogoInterface.php
+++ /dev/null
@@ -1,16 +0,0 @@
-> */
- private array $blockValues = [];
-
- private float $blockSize;
- private int $innerSize;
- private int $outerSize;
- private int $marginLeft;
- private int $marginRight;
-
- /** @param array> $blockValues */
- public function __construct(array $blockValues, int $size, int $margin, RoundBlockSizeModeInterface $roundBlockSizeMode)
- {
- $this->blockValues = $blockValues;
-
- $this->blockSize = $size / $this->getBlockCount();
- $this->innerSize = $size;
- $this->outerSize = $size + 2 * $margin;
-
- if ($roundBlockSizeMode instanceof RoundBlockSizeModeEnlarge) {
- $this->blockSize = intval(ceil($this->blockSize));
- $this->innerSize = intval($this->blockSize * $this->getBlockCount());
- $this->outerSize = $this->innerSize + 2 * $margin;
- } elseif ($roundBlockSizeMode instanceof RoundBlockSizeModeShrink) {
- $this->blockSize = intval(floor($this->blockSize));
- $this->innerSize = intval($this->blockSize * $this->getBlockCount());
- $this->outerSize = $this->innerSize + 2 * $margin;
- } elseif ($roundBlockSizeMode instanceof RoundBlockSizeModeMargin) {
- $this->blockSize = intval(floor($this->blockSize));
- $this->innerSize = intval($this->blockSize * $this->getBlockCount());
- }
-
- if ($this->blockSize < 1) {
- throw new \Exception('Too much data: increase image dimensions or lower error correction level');
- }
-
- $this->marginLeft = intval(($this->outerSize - $this->innerSize) / 2);
- $this->marginRight = $this->outerSize - $this->innerSize - $this->marginLeft;
- }
-
- public function getBlockValue(int $rowIndex, int $columnIndex): int
- {
- return $this->blockValues[$rowIndex][$columnIndex];
- }
-
- public function getBlockCount(): int
- {
- return count($this->blockValues[0]);
- }
-
- public function getBlockSize(): float
- {
- return $this->blockSize;
- }
-
- public function getInnerSize(): int
- {
- return $this->innerSize;
- }
-
- public function getOuterSize(): int
- {
- return $this->outerSize;
- }
-
- public function getMarginLeft(): int
- {
- return $this->marginLeft;
- }
-
- public function getMarginRight(): int
- {
- return $this->marginRight;
- }
-}
diff --git a/vendor/endroid/qr-code/src/Matrix/MatrixFactoryInterface.php b/vendor/endroid/qr-code/src/Matrix/MatrixFactoryInterface.php
deleted file mode 100644
index be501f1..0000000
--- a/vendor/endroid/qr-code/src/Matrix/MatrixFactoryInterface.php
+++ /dev/null
@@ -1,12 +0,0 @@
-data = $data;
- $this->encoding = $encoding ?? new Encoding('UTF-8');
- $this->errorCorrectionLevel = $errorCorrectionLevel ?? new ErrorCorrectionLevelLow();
- $this->size = $size;
- $this->margin = $margin;
- $this->roundBlockSizeMode = $roundBlockSizeMode ?? new RoundBlockSizeModeMargin();
- $this->foregroundColor = $foregroundColor ?? new Color(0, 0, 0);
- $this->backgroundColor = $backgroundColor ?? new Color(255, 255, 255);
- }
-
- public static function create(string $data): self
- {
- return new self($data);
- }
-
- public function getData(): string
- {
- return $this->data;
- }
-
- public function setData(string $data): self
- {
- $this->data = $data;
-
- return $this;
- }
-
- public function getEncoding(): EncodingInterface
- {
- return $this->encoding;
- }
-
- public function setEncoding(Encoding $encoding): self
- {
- $this->encoding = $encoding;
-
- return $this;
- }
-
- public function getErrorCorrectionLevel(): ErrorCorrectionLevelInterface
- {
- return $this->errorCorrectionLevel;
- }
-
- public function setErrorCorrectionLevel(ErrorCorrectionLevelInterface $errorCorrectionLevel): self
- {
- $this->errorCorrectionLevel = $errorCorrectionLevel;
-
- return $this;
- }
-
- public function getSize(): int
- {
- return $this->size;
- }
-
- public function setSize(int $size): self
- {
- $this->size = $size;
-
- return $this;
- }
-
- public function getMargin(): int
- {
- return $this->margin;
- }
-
- public function setMargin(int $margin): self
- {
- $this->margin = $margin;
-
- return $this;
- }
-
- public function getRoundBlockSizeMode(): RoundBlockSizeModeInterface
- {
- return $this->roundBlockSizeMode;
- }
-
- public function setRoundBlockSizeMode(RoundBlockSizeModeInterface $roundBlockSizeMode): self
- {
- $this->roundBlockSizeMode = $roundBlockSizeMode;
-
- return $this;
- }
-
- public function getForegroundColor(): ColorInterface
- {
- return $this->foregroundColor;
- }
-
- public function setForegroundColor(ColorInterface $foregroundColor): self
- {
- $this->foregroundColor = $foregroundColor;
-
- return $this;
- }
-
- public function getBackgroundColor(): ColorInterface
- {
- return $this->backgroundColor;
- }
-
- public function setBackgroundColor(ColorInterface $backgroundColor): self
- {
- $this->backgroundColor = $backgroundColor;
-
- return $this;
- }
-}
diff --git a/vendor/endroid/qr-code/src/QrCodeInterface.php b/vendor/endroid/qr-code/src/QrCodeInterface.php
deleted file mode 100644
index 2c96984..0000000
--- a/vendor/endroid/qr-code/src/QrCodeInterface.php
+++ /dev/null
@@ -1,29 +0,0 @@
-create($qrCode);
-
- return new BinaryResult($matrix);
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/ConsoleWriter.php b/vendor/endroid/qr-code/src/Writer/ConsoleWriter.php
deleted file mode 100644
index 92b8126..0000000
--- a/vendor/endroid/qr-code/src/Writer/ConsoleWriter.php
+++ /dev/null
@@ -1,29 +0,0 @@
-create($qrCode);
-
- return new ConsoleResult($matrix, $qrCode->getForegroundColor(), $qrCode->getBackgroundColor());
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/DebugWriter.php b/vendor/endroid/qr-code/src/Writer/DebugWriter.php
deleted file mode 100644
index d514b0e..0000000
--- a/vendor/endroid/qr-code/src/Writer/DebugWriter.php
+++ /dev/null
@@ -1,32 +0,0 @@
-create($qrCode);
-
- return new DebugResult($matrix, $qrCode, $logo, $label, $options);
- }
-
- public function validateResult(ResultInterface $result, string $expectedData): void
- {
- if (!$result instanceof DebugResult) {
- throw new \Exception('Unable to write logo: instance of DebugResult expected');
- }
-
- $result->setValidateResult(true);
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/EpsWriter.php b/vendor/endroid/qr-code/src/Writer/EpsWriter.php
deleted file mode 100644
index eb0a0cd..0000000
--- a/vendor/endroid/qr-code/src/Writer/EpsWriter.php
+++ /dev/null
@@ -1,44 +0,0 @@
-create($qrCode);
-
- $lines = [
- '%!PS-Adobe-3.0 EPSF-3.0',
- '%%BoundingBox: 0 0 '.$matrix->getOuterSize().' '.$matrix->getOuterSize(),
- '/F { rectfill } def',
- number_format($qrCode->getBackgroundColor()->getRed() / 100, 2, '.', ',').' '.number_format($qrCode->getBackgroundColor()->getGreen() / 100, 2, '.', ',').' '.number_format($qrCode->getBackgroundColor()->getBlue() / 100, 2, '.', ',').' setrgbcolor',
- '0 0 '.$matrix->getOuterSize().' '.$matrix->getOuterSize().' F',
- number_format($qrCode->getForegroundColor()->getRed() / 100, 2, '.', ',').' '.number_format($qrCode->getForegroundColor()->getGreen() / 100, 2, '.', ',').' '.number_format($qrCode->getForegroundColor()->getBlue() / 100, 2, '.', ',').' setrgbcolor',
- ];
-
- for ($rowIndex = 0; $rowIndex < $matrix->getBlockCount(); ++$rowIndex) {
- for ($columnIndex = 0; $columnIndex < $matrix->getBlockCount(); ++$columnIndex) {
- if (1 === $matrix->getBlockValue($matrix->getBlockCount() - 1 - $rowIndex, $columnIndex)) {
- $x = $matrix->getMarginLeft() + $matrix->getBlockSize() * $columnIndex;
- $y = $matrix->getMarginLeft() + $matrix->getBlockSize() * $rowIndex;
- $lines[] = number_format($x, self::DECIMAL_PRECISION, '.', '').' '.number_format($y, self::DECIMAL_PRECISION, '.', '').' '.number_format($matrix->getBlockSize(), self::DECIMAL_PRECISION, '.', '').' '.number_format($matrix->getBlockSize(), self::DECIMAL_PRECISION, '.', '').' F';
- }
- }
- }
-
- return new EpsResult($matrix, $lines);
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/PdfWriter.php b/vendor/endroid/qr-code/src/Writer/PdfWriter.php
deleted file mode 100644
index a087ba7..0000000
--- a/vendor/endroid/qr-code/src/Writer/PdfWriter.php
+++ /dev/null
@@ -1,133 +0,0 @@
-create($qrCode);
-
- $unit = 'mm';
- if (isset($options[self::WRITER_OPTION_UNIT])) {
- $unit = $options[self::WRITER_OPTION_UNIT];
- }
-
- $allowedUnits = ['mm', 'pt', 'cm', 'in'];
- if (!in_array($unit, $allowedUnits)) {
- throw new \Exception(sprintf('PDF Measure unit should be one of [%s]', implode(', ', $allowedUnits)));
- }
-
- $labelSpace = 0;
- if ($label instanceof LabelInterface) {
- $labelSpace = 30;
- }
-
- if (!class_exists(\FPDF::class)) {
- throw new \Exception('Unable to find FPDF: check your installation');
- }
-
- $foregroundColor = $qrCode->getForegroundColor();
- if ($foregroundColor->getAlpha() > 0) {
- throw new \Exception('PDF Writer does not support alpha channels');
- }
- $backgroundColor = $qrCode->getBackgroundColor();
- if ($backgroundColor->getAlpha() > 0) {
- throw new \Exception('PDF Writer does not support alpha channels');
- }
-
- if (isset($options[self::WRITER_OPTION_PDF])) {
- $fpdf = $options[self::WRITER_OPTION_PDF];
- if (!$fpdf instanceof \FPDF) {
- throw new \Exception('pdf option must be an instance of FPDF');
- }
- } else {
- // @todo Check how to add label height later
- $fpdf = new \FPDF('P', $unit, [$matrix->getOuterSize(), $matrix->getOuterSize() + $labelSpace]);
- $fpdf->AddPage();
- }
-
- $x = 0;
- if (isset($options[self::WRITER_OPTION_X])) {
- $x = $options[self::WRITER_OPTION_X];
- }
- $y = 0;
- if (isset($options[self::WRITER_OPTION_Y])) {
- $y = $options[self::WRITER_OPTION_Y];
- }
-
- $fpdf->SetFillColor($backgroundColor->getRed(), $backgroundColor->getGreen(), $backgroundColor->getBlue());
- $fpdf->Rect($x, $y, $matrix->getOuterSize(), $matrix->getOuterSize(), 'F');
- $fpdf->SetFillColor($foregroundColor->getRed(), $foregroundColor->getGreen(), $foregroundColor->getBlue());
-
- for ($rowIndex = 0; $rowIndex < $matrix->getBlockCount(); ++$rowIndex) {
- for ($columnIndex = 0; $columnIndex < $matrix->getBlockCount(); ++$columnIndex) {
- if (1 === $matrix->getBlockValue($rowIndex, $columnIndex)) {
- $fpdf->Rect(
- $x + $matrix->getMarginLeft() + ($columnIndex * $matrix->getBlockSize()),
- $y + $matrix->getMarginLeft() + ($rowIndex * $matrix->getBlockSize()),
- $matrix->getBlockSize(),
- $matrix->getBlockSize(),
- 'F'
- );
- }
- }
- }
-
- if ($logo instanceof LogoInterface) {
- $this->addLogo($logo, $fpdf, $x, $y, $matrix->getOuterSize());
- }
-
- if ($label instanceof LabelInterface) {
- $fpdf->SetXY($x, $y + $matrix->getOuterSize() + $labelSpace - 25);
- $fpdf->SetFont('Helvetica', '', $label->getFont()->getSize());
- $fpdf->Cell($matrix->getOuterSize(), 0, $label->getText(), 0, 0, 'C');
- }
-
- return new PdfResult($matrix, $fpdf);
- }
-
- private function addLogo(LogoInterface $logo, \FPDF $fpdf, float $x, float $y, float $size): void
- {
- $logoPath = $logo->getPath();
- $logoHeight = $logo->getResizeToHeight();
- $logoWidth = $logo->getResizeToWidth();
-
- if (null === $logoHeight || null === $logoWidth) {
- $imageSize = \getimagesize($logoPath);
- if (!$imageSize) {
- throw new \Exception(sprintf('Unable to read image size for logo "%s"', $logoPath));
- }
- [$logoSourceWidth, $logoSourceHeight] = $imageSize;
-
- if (null === $logoWidth) {
- $logoWidth = (int) $logoSourceWidth;
- }
-
- if (null === $logoHeight) {
- $aspectRatio = $logoWidth / $logoSourceWidth;
- $logoHeight = (int) ($logoSourceHeight * $aspectRatio);
- }
- }
-
- $logoX = $x + $size / 2 - $logoWidth / 2;
- $logoY = $y + $size / 2 - $logoHeight / 2;
-
- $fpdf->Image($logoPath, $logoX, $logoY, $logoWidth, $logoHeight);
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/PngWriter.php b/vendor/endroid/qr-code/src/Writer/PngWriter.php
deleted file mode 100644
index 717ab9a..0000000
--- a/vendor/endroid/qr-code/src/Writer/PngWriter.php
+++ /dev/null
@@ -1,217 +0,0 @@
-create($qrCode);
-
- $baseBlockSize = $qrCode->getRoundBlockSizeMode() instanceof RoundBlockSizeModeNone ? 10 : intval($matrix->getBlockSize());
- $baseImage = imagecreatetruecolor($matrix->getBlockCount() * $baseBlockSize, $matrix->getBlockCount() * $baseBlockSize);
-
- if (!$baseImage) {
- throw new \Exception('Unable to generate image: please check if the GD extension is enabled and configured correctly');
- }
-
- /** @var int $foregroundColor */
- $foregroundColor = imagecolorallocatealpha(
- $baseImage,
- $qrCode->getForegroundColor()->getRed(),
- $qrCode->getForegroundColor()->getGreen(),
- $qrCode->getForegroundColor()->getBlue(),
- $qrCode->getForegroundColor()->getAlpha()
- );
-
- /** @var int $transparentColor */
- $transparentColor = imagecolorallocatealpha($baseImage, 255, 255, 255, 127);
-
- imagefill($baseImage, 0, 0, $transparentColor);
-
- for ($rowIndex = 0; $rowIndex < $matrix->getBlockCount(); ++$rowIndex) {
- for ($columnIndex = 0; $columnIndex < $matrix->getBlockCount(); ++$columnIndex) {
- if (1 === $matrix->getBlockValue($rowIndex, $columnIndex)) {
- imagefilledrectangle(
- $baseImage,
- $columnIndex * $baseBlockSize,
- $rowIndex * $baseBlockSize,
- ($columnIndex + 1) * $baseBlockSize - 1,
- ($rowIndex + 1) * $baseBlockSize - 1,
- $foregroundColor
- );
- }
- }
- }
-
- $targetWidth = $matrix->getOuterSize();
- $targetHeight = $matrix->getOuterSize();
-
- if ($label instanceof LabelInterface) {
- $labelImageData = LabelImageData::createForLabel($label);
- $targetHeight += $labelImageData->getHeight() + $label->getMargin()->getTop() + $label->getMargin()->getBottom();
- }
-
- $targetImage = imagecreatetruecolor($targetWidth, $targetHeight);
-
- if (!$targetImage) {
- throw new \Exception('Unable to generate image: please check if the GD extension is enabled and configured correctly');
- }
-
- /** @var int $backgroundColor */
- $backgroundColor = imagecolorallocatealpha(
- $targetImage,
- $qrCode->getBackgroundColor()->getRed(),
- $qrCode->getBackgroundColor()->getGreen(),
- $qrCode->getBackgroundColor()->getBlue(),
- $qrCode->getBackgroundColor()->getAlpha()
- );
-
- imagefill($targetImage, 0, 0, $backgroundColor);
-
- imagecopyresampled(
- $targetImage,
- $baseImage,
- $matrix->getMarginLeft(),
- $matrix->getMarginLeft(),
- 0,
- 0,
- $matrix->getInnerSize(),
- $matrix->getInnerSize(),
- imagesx($baseImage),
- imagesy($baseImage)
- );
-
- if (PHP_VERSION_ID < 80000) {
- imagedestroy($baseImage);
- }
-
- if ($qrCode->getBackgroundColor()->getAlpha() > 0) {
- imagesavealpha($targetImage, true);
- }
-
- $result = new PngResult($matrix, $targetImage);
-
- if ($logo instanceof LogoInterface) {
- $result = $this->addLogo($logo, $result);
- }
-
- if ($label instanceof LabelInterface) {
- $result = $this->addLabel($label, $result);
- }
-
- return $result;
- }
-
- private function addLogo(LogoInterface $logo, PngResult $result): PngResult
- {
- $logoImageData = LogoImageData::createForLogo($logo);
-
- if ('image/svg+xml' === $logoImageData->getMimeType()) {
- throw new \Exception('PNG Writer does not support SVG logo');
- }
-
- $targetImage = $result->getImage();
- $matrix = $result->getMatrix();
-
- if ($logoImageData->getPunchoutBackground()) {
- /** @var int $transparent */
- $transparent = imagecolorallocatealpha($targetImage, 255, 255, 255, 127);
- imagealphablending($targetImage, false);
- $xOffsetStart = intval($matrix->getOuterSize() / 2 - $logoImageData->getWidth() / 2);
- $yOffsetStart = intval($matrix->getOuterSize() / 2 - $logoImageData->getHeight() / 2);
- for ($xOffset = $xOffsetStart; $xOffset < $xOffsetStart + $logoImageData->getWidth(); ++$xOffset) {
- for ($yOffset = $yOffsetStart; $yOffset < $yOffsetStart + $logoImageData->getHeight(); ++$yOffset) {
- imagesetpixel($targetImage, $xOffset, $yOffset, $transparent);
- }
- }
- }
-
- imagecopyresampled(
- $targetImage,
- $logoImageData->getImage(),
- intval($matrix->getOuterSize() / 2 - $logoImageData->getWidth() / 2),
- intval($matrix->getOuterSize() / 2 - $logoImageData->getHeight() / 2),
- 0,
- 0,
- $logoImageData->getWidth(),
- $logoImageData->getHeight(),
- imagesx($logoImageData->getImage()),
- imagesy($logoImageData->getImage())
- );
-
- if (PHP_VERSION_ID < 80000) {
- imagedestroy($logoImageData->getImage());
- }
-
- return new PngResult($matrix, $targetImage);
- }
-
- private function addLabel(LabelInterface $label, PngResult $result): PngResult
- {
- $targetImage = $result->getImage();
-
- $labelImageData = LabelImageData::createForLabel($label);
-
- /** @var int $textColor */
- $textColor = imagecolorallocatealpha(
- $targetImage,
- $label->getTextColor()->getRed(),
- $label->getTextColor()->getGreen(),
- $label->getTextColor()->getBlue(),
- $label->getTextColor()->getAlpha()
- );
-
- $x = intval(imagesx($targetImage) / 2 - $labelImageData->getWidth() / 2);
- $y = imagesy($targetImage) - $label->getMargin()->getBottom();
-
- if ($label->getAlignment() instanceof LabelAlignmentLeft) {
- $x = $label->getMargin()->getLeft();
- } elseif ($label->getAlignment() instanceof LabelAlignmentRight) {
- $x = imagesx($targetImage) - $labelImageData->getWidth() - $label->getMargin()->getRight();
- }
-
- imagettftext($targetImage, $label->getFont()->getSize(), 0, $x, $y, $textColor, $label->getFont()->getPath(), $label->getText());
-
- return new PngResult($result->getMatrix(), $targetImage);
- }
-
- public function validateResult(ResultInterface $result, string $expectedData): void
- {
- $string = $result->getString();
-
- if (!class_exists(QrReader::class)) {
- throw ValidationException::createForMissingPackage('khanamiryan/qrcode-detector-decoder');
- }
-
- if (PHP_VERSION_ID >= 80000) {
- throw ValidationException::createForIncompatiblePhpVersion();
- }
-
- $reader = new QrReader($string, QrReader::SOURCE_TYPE_BLOB);
- if ($reader->text() !== $expectedData) {
- throw ValidationException::createForInvalidData($expectedData, strval($reader->text()));
- }
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/Result/AbstractResult.php b/vendor/endroid/qr-code/src/Writer/Result/AbstractResult.php
deleted file mode 100644
index acc1e5c..0000000
--- a/vendor/endroid/qr-code/src/Writer/Result/AbstractResult.php
+++ /dev/null
@@ -1,33 +0,0 @@
-matrix = $matrix;
- }
-
- public function getMatrix(): MatrixInterface
- {
- return $this->matrix;
- }
-
- public function getDataUri(): string
- {
- return 'data:'.$this->getMimeType().';base64,'.base64_encode($this->getString());
- }
-
- public function saveToFile(string $path): void
- {
- $string = $this->getString();
- file_put_contents($path, $string);
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/Result/BinaryResult.php b/vendor/endroid/qr-code/src/Writer/Result/BinaryResult.php
deleted file mode 100644
index 386fb6a..0000000
--- a/vendor/endroid/qr-code/src/Writer/Result/BinaryResult.php
+++ /dev/null
@@ -1,35 +0,0 @@
-getMatrix();
-
- $binaryString = '';
- for ($rowIndex = 0; $rowIndex < $matrix->getBlockCount(); ++$rowIndex) {
- for ($columnIndex = 0; $columnIndex < $matrix->getBlockCount(); ++$columnIndex) {
- $binaryString .= $matrix->getBlockValue($rowIndex, $columnIndex);
- }
- $binaryString .= "\n";
- }
-
- return $binaryString;
- }
-
- public function getMimeType(): string
- {
- return 'text/plain';
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/Result/ConsoleResult.php b/vendor/endroid/qr-code/src/Writer/Result/ConsoleResult.php
deleted file mode 100644
index 1da8984..0000000
--- a/vendor/endroid/qr-code/src/Writer/Result/ConsoleResult.php
+++ /dev/null
@@ -1,69 +0,0 @@
- ' ',
- 1 => "\xe2\x96\x80",
- 2 => "\xe2\x96\x84",
- 3 => "\xe2\x96\x88",
- ];
-
- private string $colorEscapeCode;
-
- public function __construct(
- MatrixInterface $matrix,
- ColorInterface $foreground,
- ColorInterface $background
- ) {
- parent::__construct($matrix);
-
- $this->colorEscapeCode = sprintf(
- "\e[38;2;%d;%d;%dm\e[48;2;%d;%d;%dm",
- $foreground->getRed(),
- $foreground->getGreen(),
- $foreground->getBlue(),
- $background->getRed(),
- $background->getGreen(),
- $background->getBlue()
- );
- }
-
- public function getMimeType(): string
- {
- return 'text/plain';
- }
-
- public function getString(): string
- {
- $matrix = $this->getMatrix();
-
- $side = $matrix->getBlockCount();
- $marginLeft = $this->colorEscapeCode.self::TWO_BLOCKS[0].self::TWO_BLOCKS[0];
- $marginRight = self::TWO_BLOCKS[0].self::TWO_BLOCKS[0]."\e[0m".PHP_EOL;
- $marginVertical = $marginLeft.str_repeat(self::TWO_BLOCKS[0], $side).$marginRight;
-
- $qrCodeString = $marginVertical;
- for ($rowIndex = 0; $rowIndex < $side; $rowIndex += 2) {
- $qrCodeString .= $marginLeft;
- for ($columnIndex = 0; $columnIndex < $side; ++$columnIndex) {
- $combined = $matrix->getBlockValue($rowIndex, $columnIndex);
- if ($rowIndex + 1 < $side) {
- $combined |= $matrix->getBlockValue($rowIndex + 1, $columnIndex) << 1;
- }
- $qrCodeString .= self::TWO_BLOCKS[$combined];
- }
- $qrCodeString .= $marginRight;
- }
- $qrCodeString .= $marginVertical;
-
- return $qrCodeString;
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/Result/DebugResult.php b/vendor/endroid/qr-code/src/Writer/Result/DebugResult.php
deleted file mode 100644
index 4c4fad2..0000000
--- a/vendor/endroid/qr-code/src/Writer/Result/DebugResult.php
+++ /dev/null
@@ -1,85 +0,0 @@
- */
- private array $options;
-
- private bool $validateResult = false;
-
- /** @param array $options */
- public function __construct(
- MatrixInterface $matrix,
- QrCodeInterface $qrCode,
- LogoInterface $logo = null,
- LabelInterface $label = null,
- array $options = []
- ) {
- parent::__construct($matrix);
-
- $this->qrCode = $qrCode;
- $this->logo = $logo;
- $this->label = $label;
- $this->options = $options;
- }
-
- public function setValidateResult(bool $validateResult): void
- {
- $this->validateResult = $validateResult;
- }
-
- public function getString(): string
- {
- $debugLines = [];
-
- $debugLines[] = 'Data: '.$this->qrCode->getData();
- $debugLines[] = 'Encoding: '.$this->qrCode->getEncoding();
- $debugLines[] = 'Error Correction Level: '.get_class($this->qrCode->getErrorCorrectionLevel());
- $debugLines[] = 'Size: '.$this->qrCode->getSize();
- $debugLines[] = 'Margin: '.$this->qrCode->getMargin();
- $debugLines[] = 'Round block size mode: '.get_class($this->qrCode->getRoundBlockSizeMode());
- $debugLines[] = 'Foreground color: ['.implode(', ', $this->qrCode->getForegroundColor()->toArray()).']';
- $debugLines[] = 'Background color: ['.implode(', ', $this->qrCode->getBackgroundColor()->toArray()).']';
-
- foreach ($this->options as $key => $value) {
- $debugLines[] = 'Writer option: '.$key.': '.$value;
- }
-
- if (isset($this->logo)) {
- $debugLines[] = 'Logo path: '.$this->logo->getPath();
- $debugLines[] = 'Logo resize to width: '.$this->logo->getResizeToWidth();
- $debugLines[] = 'Logo resize to height: '.$this->logo->getResizeToHeight();
- }
-
- if (isset($this->label)) {
- $debugLines[] = 'Label text: '.$this->label->getText();
- $debugLines[] = 'Label font path: '.$this->label->getFont()->getPath();
- $debugLines[] = 'Label font size: '.$this->label->getFont()->getSize();
- $debugLines[] = 'Label alignment: '.get_class($this->label->getAlignment());
- $debugLines[] = 'Label margin: ['.implode(', ', $this->label->getMargin()->toArray()).']';
- $debugLines[] = 'Label text color: ['.implode(', ', $this->label->getTextColor()->toArray()).']';
- }
-
- $debugLines[] = 'Validate result: '.($this->validateResult ? 'true' : 'false');
-
- return implode("\n", $debugLines);
- }
-
- public function getMimeType(): string
- {
- return 'text/plain';
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/Result/EpsResult.php b/vendor/endroid/qr-code/src/Writer/Result/EpsResult.php
deleted file mode 100644
index cda126a..0000000
--- a/vendor/endroid/qr-code/src/Writer/Result/EpsResult.php
+++ /dev/null
@@ -1,31 +0,0 @@
- */
- private array $lines;
-
- /** @param array $lines */
- public function __construct(MatrixInterface $matrix, array $lines)
- {
- parent::__construct($matrix);
-
- $this->lines = $lines;
- }
-
- public function getString(): string
- {
- return implode("\n", $this->lines);
- }
-
- public function getMimeType(): string
- {
- return 'image/eps';
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/Result/PdfResult.php b/vendor/endroid/qr-code/src/Writer/Result/PdfResult.php
deleted file mode 100644
index 28445fc..0000000
--- a/vendor/endroid/qr-code/src/Writer/Result/PdfResult.php
+++ /dev/null
@@ -1,34 +0,0 @@
-fpdf = $fpdf;
- }
-
- public function getPdf(): \FPDF
- {
- return $this->fpdf;
- }
-
- public function getString(): string
- {
- return $this->fpdf->Output('S');
- }
-
- public function getMimeType(): string
- {
- return 'application/pdf';
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/Result/PngResult.php b/vendor/endroid/qr-code/src/Writer/Result/PngResult.php
deleted file mode 100644
index bbf795d..0000000
--- a/vendor/endroid/qr-code/src/Writer/Result/PngResult.php
+++ /dev/null
@@ -1,40 +0,0 @@
-image = $image;
- }
-
- /** @return mixed */
- public function getImage()
- {
- return $this->image;
- }
-
- public function getString(): string
- {
- ob_start();
- imagepng($this->image);
-
- return strval(ob_get_clean());
- }
-
- public function getMimeType(): string
- {
- return 'image/png';
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/Result/ResultInterface.php b/vendor/endroid/qr-code/src/Writer/Result/ResultInterface.php
deleted file mode 100644
index 2cd387e..0000000
--- a/vendor/endroid/qr-code/src/Writer/Result/ResultInterface.php
+++ /dev/null
@@ -1,20 +0,0 @@
-xml = $xml;
- $this->excludeXmlDeclaration = $excludeXmlDeclaration;
- }
-
- public function getXml(): \SimpleXMLElement
- {
- return $this->xml;
- }
-
- public function getString(): string
- {
- $string = $this->xml->asXML();
-
- if (!is_string($string)) {
- throw new \Exception('Could not save SVG XML to string');
- }
-
- if ($this->excludeXmlDeclaration) {
- $string = str_replace("\n", '', $string);
- }
-
- return $string;
- }
-
- public function getMimeType(): string
- {
- return 'image/svg+xml';
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/SvgWriter.php b/vendor/endroid/qr-code/src/Writer/SvgWriter.php
deleted file mode 100644
index f0857c4..0000000
--- a/vendor/endroid/qr-code/src/Writer/SvgWriter.php
+++ /dev/null
@@ -1,114 +0,0 @@
-create($qrCode);
-
- $xml = new \SimpleXMLElement(' ');
- $xml->addAttribute('version', '1.1');
- if (!$options[self::WRITER_OPTION_EXCLUDE_SVG_WIDTH_AND_HEIGHT]) {
- $xml->addAttribute('width', $matrix->getOuterSize().'px');
- $xml->addAttribute('height', $matrix->getOuterSize().'px');
- }
- $xml->addAttribute('viewBox', '0 0 '.$matrix->getOuterSize().' '.$matrix->getOuterSize());
- $xml->addChild('defs');
-
- $blockDefinition = $xml->defs->addChild('rect');
- $blockDefinition->addAttribute('id', strval($options[self::WRITER_OPTION_BLOCK_ID]));
- $blockDefinition->addAttribute('width', number_format($matrix->getBlockSize(), self::DECIMAL_PRECISION, '.', ''));
- $blockDefinition->addAttribute('height', number_format($matrix->getBlockSize(), self::DECIMAL_PRECISION, '.', ''));
- $blockDefinition->addAttribute('fill', '#'.sprintf('%02x%02x%02x', $qrCode->getForegroundColor()->getRed(), $qrCode->getForegroundColor()->getGreen(), $qrCode->getForegroundColor()->getBlue()));
- $blockDefinition->addAttribute('fill-opacity', strval($qrCode->getForegroundColor()->getOpacity()));
-
- $background = $xml->addChild('rect');
- $background->addAttribute('x', '0');
- $background->addAttribute('y', '0');
- $background->addAttribute('width', strval($matrix->getOuterSize()));
- $background->addAttribute('height', strval($matrix->getOuterSize()));
- $background->addAttribute('fill', '#'.sprintf('%02x%02x%02x', $qrCode->getBackgroundColor()->getRed(), $qrCode->getBackgroundColor()->getGreen(), $qrCode->getBackgroundColor()->getBlue()));
- $background->addAttribute('fill-opacity', strval($qrCode->getBackgroundColor()->getOpacity()));
-
- for ($rowIndex = 0; $rowIndex < $matrix->getBlockCount(); ++$rowIndex) {
- for ($columnIndex = 0; $columnIndex < $matrix->getBlockCount(); ++$columnIndex) {
- if (1 === $matrix->getBlockValue($rowIndex, $columnIndex)) {
- $block = $xml->addChild('use');
- $block->addAttribute('x', number_format($matrix->getMarginLeft() + $matrix->getBlockSize() * $columnIndex, self::DECIMAL_PRECISION, '.', ''));
- $block->addAttribute('y', number_format($matrix->getMarginLeft() + $matrix->getBlockSize() * $rowIndex, self::DECIMAL_PRECISION, '.', ''));
- $block->addAttribute('xlink:href', '#'.$options[self::WRITER_OPTION_BLOCK_ID], 'http://www.w3.org/1999/xlink');
- }
- }
- }
-
- $result = new SvgResult($matrix, $xml, boolval($options[self::WRITER_OPTION_EXCLUDE_XML_DECLARATION]));
-
- if ($logo instanceof LogoInterface) {
- $this->addLogo($logo, $result, $options);
- }
-
- return $result;
- }
-
- /** @param array $options */
- private function addLogo(LogoInterface $logo, SvgResult $result, array $options): void
- {
- $logoImageData = LogoImageData::createForLogo($logo);
-
- if (!isset($options[self::WRITER_OPTION_FORCE_XLINK_HREF])) {
- $options[self::WRITER_OPTION_FORCE_XLINK_HREF] = false;
- }
-
- $xml = $result->getXml();
-
- /** @var \SimpleXMLElement $xmlAttributes */
- $xmlAttributes = $xml->attributes();
-
- $x = intval($xmlAttributes->width) / 2 - $logoImageData->getWidth() / 2;
- $y = intval($xmlAttributes->height) / 2 - $logoImageData->getHeight() / 2;
-
- $imageDefinition = $xml->addChild('image');
- $imageDefinition->addAttribute('x', strval($x));
- $imageDefinition->addAttribute('y', strval($y));
- $imageDefinition->addAttribute('width', strval($logoImageData->getWidth()));
- $imageDefinition->addAttribute('height', strval($logoImageData->getHeight()));
- $imageDefinition->addAttribute('preserveAspectRatio', 'none');
-
- if ($options[self::WRITER_OPTION_FORCE_XLINK_HREF]) {
- $imageDefinition->addAttribute('xlink:href', $logoImageData->createDataUri(), 'http://www.w3.org/1999/xlink');
- } else {
- $imageDefinition->addAttribute('href', $logoImageData->createDataUri());
- }
- }
-}
diff --git a/vendor/endroid/qr-code/src/Writer/ValidatingWriterInterface.php b/vendor/endroid/qr-code/src/Writer/ValidatingWriterInterface.php
deleted file mode 100644
index 4f40048..0000000
--- a/vendor/endroid/qr-code/src/Writer/ValidatingWriterInterface.php
+++ /dev/null
@@ -1,12 +0,0 @@
- $options */
- public function write(QrCodeInterface $qrCode, LogoInterface $logo = null, LabelInterface $label = null, array $options = []): ResultInterface;
-}
diff --git a/vendor/firebase/php-jwt/LICENSE b/vendor/firebase/php-jwt/LICENSE
deleted file mode 100644
index 11c0146..0000000
--- a/vendor/firebase/php-jwt/LICENSE
+++ /dev/null
@@ -1,30 +0,0 @@
-Copyright (c) 2011, Neuman Vong
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
- * Neither the name of the copyright holder nor the names of other
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/firebase/php-jwt/README.md b/vendor/firebase/php-jwt/README.md
deleted file mode 100644
index 1d392cd..0000000
--- a/vendor/firebase/php-jwt/README.md
+++ /dev/null
@@ -1,289 +0,0 @@
-[](https://travis-ci.org/firebase/php-jwt)
-[](https://packagist.org/packages/firebase/php-jwt)
-[](https://packagist.org/packages/firebase/php-jwt)
-[](https://packagist.org/packages/firebase/php-jwt)
-
-PHP-JWT
-=======
-A simple library to encode and decode JSON Web Tokens (JWT) in PHP, conforming to [RFC 7519](https://tools.ietf.org/html/rfc7519).
-
-Installation
-------------
-
-Use composer to manage your dependencies and download PHP-JWT:
-
-```bash
-composer require firebase/php-jwt
-```
-
-Optionally, install the `paragonie/sodium_compat` package from composer if your
-php is < 7.2 or does not have libsodium installed:
-
-```bash
-composer require paragonie/sodium_compat
-```
-
-Example
--------
-```php
-use Firebase\JWT\JWT;
-use Firebase\JWT\Key;
-
-$key = "example_key";
-$payload = array(
- "iss" => "http://example.org",
- "aud" => "http://example.com",
- "iat" => 1356999524,
- "nbf" => 1357000000
-);
-
-/**
- * IMPORTANT:
- * You must specify supported algorithms for your application. See
- * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40
- * for a list of spec-compliant algorithms.
- */
-$jwt = JWT::encode($payload, $key, 'HS256');
-$decoded = JWT::decode($jwt, new Key($key, 'HS256'));
-
-print_r($decoded);
-
-/*
- NOTE: This will now be an object instead of an associative array. To get
- an associative array, you will need to cast it as such:
-*/
-
-$decoded_array = (array) $decoded;
-
-/**
- * You can add a leeway to account for when there is a clock skew times between
- * the signing and verifying servers. It is recommended that this leeway should
- * not be bigger than a few minutes.
- *
- * Source: http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#nbfDef
- */
-JWT::$leeway = 60; // $leeway in seconds
-$decoded = JWT::decode($jwt, new Key($key, 'HS256'));
-```
-Example with RS256 (openssl)
-----------------------------
-```php
-use Firebase\JWT\JWT;
-use Firebase\JWT\Key;
-
-$privateKey = << "example.org",
- "aud" => "example.com",
- "iat" => 1356999524,
- "nbf" => 1357000000
-);
-
-$jwt = JWT::encode($payload, $privateKey, 'RS256');
-echo "Encode:\n" . print_r($jwt, true) . "\n";
-
-$decoded = JWT::decode($jwt, new Key($publicKey, 'RS256'));
-
-/*
- NOTE: This will now be an object instead of an associative array. To get
- an associative array, you will need to cast it as such:
-*/
-
-$decoded_array = (array) $decoded;
-echo "Decode:\n" . print_r($decoded_array, true) . "\n";
-```
-
-Example with a passphrase
--------------------------
-
-```php
-use Firebase\JWT\JWT;
-use Firebase\JWT\Key;
-
-// Your passphrase
-$passphrase = '[YOUR_PASSPHRASE]';
-
-// Your private key file with passphrase
-// Can be generated with "ssh-keygen -t rsa -m pem"
-$privateKeyFile = '/path/to/key-with-passphrase.pem';
-
-// Create a private key of type "resource"
-$privateKey = openssl_pkey_get_private(
- file_get_contents($privateKeyFile),
- $passphrase
-);
-
-$payload = array(
- "iss" => "example.org",
- "aud" => "example.com",
- "iat" => 1356999524,
- "nbf" => 1357000000
-);
-
-$jwt = JWT::encode($payload, $privateKey, 'RS256');
-echo "Encode:\n" . print_r($jwt, true) . "\n";
-
-// Get public key from the private key, or pull from from a file.
-$publicKey = openssl_pkey_get_details($privateKey)['key'];
-
-$decoded = JWT::decode($jwt, new Key($publicKey, 'RS256'));
-echo "Decode:\n" . print_r((array) $decoded, true) . "\n";
-```
-
-Example with EdDSA (libsodium and Ed25519 signature)
-----------------------------
-```php
-use Firebase\JWT\JWT;
-use Firebase\JWT\Key;
-
-// Public and private keys are expected to be Base64 encoded. The last
-// non-empty line is used so that keys can be generated with
-// sodium_crypto_sign_keypair(). The secret keys generated by other tools may
-// need to be adjusted to match the input expected by libsodium.
-
-$keyPair = sodium_crypto_sign_keypair();
-
-$privateKey = base64_encode(sodium_crypto_sign_secretkey($keyPair));
-
-$publicKey = base64_encode(sodium_crypto_sign_publickey($keyPair));
-
-$payload = array(
- "iss" => "example.org",
- "aud" => "example.com",
- "iat" => 1356999524,
- "nbf" => 1357000000
-);
-
-$jwt = JWT::encode($payload, $privateKey, 'EdDSA');
-echo "Encode:\n" . print_r($jwt, true) . "\n";
-
-$decoded = JWT::decode($jwt, new Key($publicKey, 'EdDSA'));
-echo "Decode:\n" . print_r((array) $decoded, true) . "\n";
-````
-
-Using JWKs
-----------
-
-```php
-use Firebase\JWT\JWK;
-use Firebase\JWT\JWT;
-
-// Set of keys. The "keys" key is required. For example, the JSON response to
-// this endpoint: https://www.gstatic.com/iap/verify/public_key-jwk
-$jwks = ['keys' => []];
-
-// JWK::parseKeySet($jwks) returns an associative array of **kid** to private
-// key. Pass this as the second parameter to JWT::decode.
-// NOTE: The deprecated $supportedAlgorithm must be supplied when parsing from JWK.
-JWT::decode($payload, JWK::parseKeySet($jwks), $supportedAlgorithm);
-```
-
-Changelog
----------
-
-#### 5.0.0 / 2017-06-26
-- Support RS384 and RS512.
- See [#117](https://github.com/firebase/php-jwt/pull/117). Thanks [@joostfaassen](https://github.com/joostfaassen)!
-- Add an example for RS256 openssl.
- See [#125](https://github.com/firebase/php-jwt/pull/125). Thanks [@akeeman](https://github.com/akeeman)!
-- Detect invalid Base64 encoding in signature.
- See [#162](https://github.com/firebase/php-jwt/pull/162). Thanks [@psignoret](https://github.com/psignoret)!
-- Update `JWT::verify` to handle OpenSSL errors.
- See [#159](https://github.com/firebase/php-jwt/pull/159). Thanks [@bshaffer](https://github.com/bshaffer)!
-- Add `array` type hinting to `decode` method
- See [#101](https://github.com/firebase/php-jwt/pull/101). Thanks [@hywak](https://github.com/hywak)!
-- Add all JSON error types.
- See [#110](https://github.com/firebase/php-jwt/pull/110). Thanks [@gbalduzzi](https://github.com/gbalduzzi)!
-- Bugfix 'kid' not in given key list.
- See [#129](https://github.com/firebase/php-jwt/pull/129). Thanks [@stampycode](https://github.com/stampycode)!
-- Miscellaneous cleanup, documentation and test fixes.
- See [#107](https://github.com/firebase/php-jwt/pull/107), [#115](https://github.com/firebase/php-jwt/pull/115),
- [#160](https://github.com/firebase/php-jwt/pull/160), [#161](https://github.com/firebase/php-jwt/pull/161), and
- [#165](https://github.com/firebase/php-jwt/pull/165). Thanks [@akeeman](https://github.com/akeeman),
- [@chinedufn](https://github.com/chinedufn), and [@bshaffer](https://github.com/bshaffer)!
-
-#### 4.0.0 / 2016-07-17
-- Add support for late static binding. See [#88](https://github.com/firebase/php-jwt/pull/88) for details. Thanks to [@chappy84](https://github.com/chappy84)!
-- Use static `$timestamp` instead of `time()` to improve unit testing. See [#93](https://github.com/firebase/php-jwt/pull/93) for details. Thanks to [@josephmcdermott](https://github.com/josephmcdermott)!
-- Fixes to exceptions classes. See [#81](https://github.com/firebase/php-jwt/pull/81) for details. Thanks to [@Maks3w](https://github.com/Maks3w)!
-- Fixes to PHPDoc. See [#76](https://github.com/firebase/php-jwt/pull/76) for details. Thanks to [@akeeman](https://github.com/akeeman)!
-
-#### 3.0.0 / 2015-07-22
-- Minimum PHP version updated from `5.2.0` to `5.3.0`.
-- Add `\Firebase\JWT` namespace. See
-[#59](https://github.com/firebase/php-jwt/pull/59) for details. Thanks to
-[@Dashron](https://github.com/Dashron)!
-- Require a non-empty key to decode and verify a JWT. See
-[#60](https://github.com/firebase/php-jwt/pull/60) for details. Thanks to
-[@sjones608](https://github.com/sjones608)!
-- Cleaner documentation blocks in the code. See
-[#62](https://github.com/firebase/php-jwt/pull/62) for details. Thanks to
-[@johanderuijter](https://github.com/johanderuijter)!
-
-#### 2.2.0 / 2015-06-22
-- Add support for adding custom, optional JWT headers to `JWT::encode()`. See
-[#53](https://github.com/firebase/php-jwt/pull/53/files) for details. Thanks to
-[@mcocaro](https://github.com/mcocaro)!
-
-#### 2.1.0 / 2015-05-20
-- Add support for adding a leeway to `JWT:decode()` that accounts for clock skew
-between signing and verifying entities. Thanks to [@lcabral](https://github.com/lcabral)!
-- Add support for passing an object implementing the `ArrayAccess` interface for
-`$keys` argument in `JWT::decode()`. Thanks to [@aztech-dev](https://github.com/aztech-dev)!
-
-#### 2.0.0 / 2015-04-01
-- **Note**: It is strongly recommended that you update to > v2.0.0 to address
- known security vulnerabilities in prior versions when both symmetric and
- asymmetric keys are used together.
-- Update signature for `JWT::decode(...)` to require an array of supported
- algorithms to use when verifying token signatures.
-
-
-Tests
------
-Run the tests using phpunit:
-
-```bash
-$ pear install PHPUnit
-$ phpunit --configuration phpunit.xml.dist
-PHPUnit 3.7.10 by Sebastian Bergmann.
-.....
-Time: 0 seconds, Memory: 2.50Mb
-OK (5 tests, 5 assertions)
-```
-
-New Lines in private keys
------
-
-If your private key contains `\n` characters, be sure to wrap it in double quotes `""`
-and not single quotes `''` in order to properly interpret the escaped characters.
-
-License
--------
-[3-Clause BSD](http://opensource.org/licenses/BSD-3-Clause).
diff --git a/vendor/firebase/php-jwt/composer.json b/vendor/firebase/php-jwt/composer.json
deleted file mode 100644
index 6146e2d..0000000
--- a/vendor/firebase/php-jwt/composer.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "name": "firebase/php-jwt",
- "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
- "homepage": "https://github.com/firebase/php-jwt",
- "keywords": [
- "php",
- "jwt"
- ],
- "authors": [
- {
- "name": "Neuman Vong",
- "email": "neuman+pear@twilio.com",
- "role": "Developer"
- },
- {
- "name": "Anant Narayanan",
- "email": "anant@php.net",
- "role": "Developer"
- }
- ],
- "license": "BSD-3-Clause",
- "require": {
- "php": ">=5.3.0"
- },
- "suggest": {
- "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present"
- },
- "autoload": {
- "psr-4": {
- "Firebase\\JWT\\": "src"
- }
- },
- "require-dev": {
- "phpunit/phpunit": ">=4.8 <=9"
- }
-}
diff --git a/vendor/firebase/php-jwt/src/BeforeValidException.php b/vendor/firebase/php-jwt/src/BeforeValidException.php
deleted file mode 100644
index c147852..0000000
--- a/vendor/firebase/php-jwt/src/BeforeValidException.php
+++ /dev/null
@@ -1,7 +0,0 @@
-
- * @license http://opensource.org/licenses/BSD-3-Clause 3-clause BSD
- * @link https://github.com/firebase/php-jwt
- */
-class JWK
-{
- /**
- * Parse a set of JWK keys
- *
- * @param array $jwks The JSON Web Key Set as an associative array
- *
- * @return array An associative array that represents the set of keys
- *
- * @throws InvalidArgumentException Provided JWK Set is empty
- * @throws UnexpectedValueException Provided JWK Set was invalid
- * @throws DomainException OpenSSL failure
- *
- * @uses parseKey
- */
- public static function parseKeySet(array $jwks)
- {
- $keys = array();
-
- if (!isset($jwks['keys'])) {
- throw new UnexpectedValueException('"keys" member must exist in the JWK Set');
- }
- if (empty($jwks['keys'])) {
- throw new InvalidArgumentException('JWK Set did not contain any keys');
- }
-
- foreach ($jwks['keys'] as $k => $v) {
- $kid = isset($v['kid']) ? $v['kid'] : $k;
- if ($key = self::parseKey($v)) {
- $keys[$kid] = $key;
- }
- }
-
- if (0 === \count($keys)) {
- throw new UnexpectedValueException('No supported algorithms found in JWK Set');
- }
-
- return $keys;
- }
-
- /**
- * Parse a JWK key
- *
- * @param array $jwk An individual JWK
- *
- * @return resource|array An associative array that represents the key
- *
- * @throws InvalidArgumentException Provided JWK is empty
- * @throws UnexpectedValueException Provided JWK was invalid
- * @throws DomainException OpenSSL failure
- *
- * @uses createPemFromModulusAndExponent
- */
- public static function parseKey(array $jwk)
- {
- if (empty($jwk)) {
- throw new InvalidArgumentException('JWK must not be empty');
- }
- if (!isset($jwk['kty'])) {
- throw new UnexpectedValueException('JWK must contain a "kty" parameter');
- }
-
- switch ($jwk['kty']) {
- case 'RSA':
- if (!empty($jwk['d'])) {
- throw new UnexpectedValueException('RSA private keys are not supported');
- }
- if (!isset($jwk['n']) || !isset($jwk['e'])) {
- throw new UnexpectedValueException('RSA keys must contain values for both "n" and "e"');
- }
-
- $pem = self::createPemFromModulusAndExponent($jwk['n'], $jwk['e']);
- $publicKey = \openssl_pkey_get_public($pem);
- if (false === $publicKey) {
- throw new DomainException(
- 'OpenSSL error: ' . \openssl_error_string()
- );
- }
- return $publicKey;
- default:
- // Currently only RSA is supported
- break;
- }
- }
-
- /**
- * Create a public key represented in PEM format from RSA modulus and exponent information
- *
- * @param string $n The RSA modulus encoded in Base64
- * @param string $e The RSA exponent encoded in Base64
- *
- * @return string The RSA public key represented in PEM format
- *
- * @uses encodeLength
- */
- private static function createPemFromModulusAndExponent($n, $e)
- {
- $modulus = JWT::urlsafeB64Decode($n);
- $publicExponent = JWT::urlsafeB64Decode($e);
-
- $components = array(
- 'modulus' => \pack('Ca*a*', 2, self::encodeLength(\strlen($modulus)), $modulus),
- 'publicExponent' => \pack('Ca*a*', 2, self::encodeLength(\strlen($publicExponent)), $publicExponent)
- );
-
- $rsaPublicKey = \pack(
- 'Ca*a*a*',
- 48,
- self::encodeLength(\strlen($components['modulus']) + \strlen($components['publicExponent'])),
- $components['modulus'],
- $components['publicExponent']
- );
-
- // sequence(oid(1.2.840.113549.1.1.1), null)) = rsaEncryption.
- $rsaOID = \pack('H*', '300d06092a864886f70d0101010500'); // hex version of MA0GCSqGSIb3DQEBAQUA
- $rsaPublicKey = \chr(0) . $rsaPublicKey;
- $rsaPublicKey = \chr(3) . self::encodeLength(\strlen($rsaPublicKey)) . $rsaPublicKey;
-
- $rsaPublicKey = \pack(
- 'Ca*a*',
- 48,
- self::encodeLength(\strlen($rsaOID . $rsaPublicKey)),
- $rsaOID . $rsaPublicKey
- );
-
- $rsaPublicKey = "-----BEGIN PUBLIC KEY-----\r\n" .
- \chunk_split(\base64_encode($rsaPublicKey), 64) .
- '-----END PUBLIC KEY-----';
-
- return $rsaPublicKey;
- }
-
- /**
- * DER-encode the length
- *
- * DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See
- * {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information.
- *
- * @param int $length
- * @return string
- */
- private static function encodeLength($length)
- {
- if ($length <= 0x7F) {
- return \chr($length);
- }
-
- $temp = \ltrim(\pack('N', $length), \chr(0));
-
- return \pack('Ca*', 0x80 | \strlen($temp), $temp);
- }
-}
diff --git a/vendor/firebase/php-jwt/src/JWT.php b/vendor/firebase/php-jwt/src/JWT.php
deleted file mode 100644
index ec1641b..0000000
--- a/vendor/firebase/php-jwt/src/JWT.php
+++ /dev/null
@@ -1,611 +0,0 @@
-
- * @author Anant Narayanan
- * @license http://opensource.org/licenses/BSD-3-Clause 3-clause BSD
- * @link https://github.com/firebase/php-jwt
- */
-class JWT
-{
- const ASN1_INTEGER = 0x02;
- const ASN1_SEQUENCE = 0x10;
- const ASN1_BIT_STRING = 0x03;
-
- /**
- * When checking nbf, iat or expiration times,
- * we want to provide some extra leeway time to
- * account for clock skew.
- */
- public static $leeway = 0;
-
- /**
- * Allow the current timestamp to be specified.
- * Useful for fixing a value within unit testing.
- *
- * Will default to PHP time() value if null.
- */
- public static $timestamp = null;
-
- public static $supported_algs = array(
- 'ES384' => array('openssl', 'SHA384'),
- 'ES256' => array('openssl', 'SHA256'),
- 'HS256' => array('hash_hmac', 'SHA256'),
- 'HS384' => array('hash_hmac', 'SHA384'),
- 'HS512' => array('hash_hmac', 'SHA512'),
- 'RS256' => array('openssl', 'SHA256'),
- 'RS384' => array('openssl', 'SHA384'),
- 'RS512' => array('openssl', 'SHA512'),
- 'EdDSA' => array('sodium_crypto', 'EdDSA'),
- );
-
- /**
- * Decodes a JWT string into a PHP object.
- *
- * @param string $jwt The JWT
- * @param Key|array|mixed $keyOrKeyArray The Key or array of Key objects.
- * If the algorithm used is asymmetric, this is the public key
- * Each Key object contains an algorithm and matching key.
- * Supported algorithms are 'ES384','ES256', 'HS256', 'HS384',
- * 'HS512', 'RS256', 'RS384', and 'RS512'
- * @param array $allowed_algs [DEPRECATED] List of supported verification algorithms. Only
- * should be used for backwards compatibility.
- *
- * @return object The JWT's payload as a PHP object
- *
- * @throws InvalidArgumentException Provided JWT was empty
- * @throws UnexpectedValueException Provided JWT was invalid
- * @throws SignatureInvalidException Provided JWT was invalid because the signature verification failed
- * @throws BeforeValidException Provided JWT is trying to be used before it's eligible as defined by 'nbf'
- * @throws BeforeValidException Provided JWT is trying to be used before it's been created as defined by 'iat'
- * @throws ExpiredException Provided JWT has since expired, as defined by the 'exp' claim
- *
- * @uses jsonDecode
- * @uses urlsafeB64Decode
- */
- public static function decode($jwt, $keyOrKeyArray, array $allowed_algs = array())
- {
- $timestamp = \is_null(static::$timestamp) ? \time() : static::$timestamp;
-
- if (empty($keyOrKeyArray)) {
- throw new InvalidArgumentException('Key may not be empty');
- }
- $tks = \explode('.', $jwt);
- if (\count($tks) != 3) {
- throw new UnexpectedValueException('Wrong number of segments');
- }
- list($headb64, $bodyb64, $cryptob64) = $tks;
- if (null === ($header = static::jsonDecode(static::urlsafeB64Decode($headb64)))) {
- throw new UnexpectedValueException('Invalid header encoding');
- }
- if (null === $payload = static::jsonDecode(static::urlsafeB64Decode($bodyb64))) {
- throw new UnexpectedValueException('Invalid claims encoding');
- }
- if (false === ($sig = static::urlsafeB64Decode($cryptob64))) {
- throw new UnexpectedValueException('Invalid signature encoding');
- }
- if (empty($header->alg)) {
- throw new UnexpectedValueException('Empty algorithm');
- }
- if (empty(static::$supported_algs[$header->alg])) {
- throw new UnexpectedValueException('Algorithm not supported');
- }
-
- list($keyMaterial, $algorithm) = self::getKeyMaterialAndAlgorithm(
- $keyOrKeyArray,
- empty($header->kid) ? null : $header->kid
- );
-
- if (empty($algorithm)) {
- // Use deprecated "allowed_algs" to determine if the algorithm is supported.
- // This opens up the possibility of an attack in some implementations.
- // @see https://github.com/firebase/php-jwt/issues/351
- if (!\in_array($header->alg, $allowed_algs)) {
- throw new UnexpectedValueException('Algorithm not allowed');
- }
- } else {
- // Check the algorithm
- if (!self::constantTimeEquals($algorithm, $header->alg)) {
- // See issue #351
- throw new UnexpectedValueException('Incorrect key for this algorithm');
- }
- }
- if ($header->alg === 'ES256' || $header->alg === 'ES384') {
- // OpenSSL expects an ASN.1 DER sequence for ES256/ES384 signatures
- $sig = self::signatureToDER($sig);
- }
-
- if (!static::verify("$headb64.$bodyb64", $sig, $keyMaterial, $header->alg)) {
- throw new SignatureInvalidException('Signature verification failed');
- }
-
- // Check the nbf if it is defined. This is the time that the
- // token can actually be used. If it's not yet that time, abort.
- if (isset($payload->nbf) && $payload->nbf > ($timestamp + static::$leeway)) {
- throw new BeforeValidException(
- 'Cannot handle token prior to ' . \date(DateTime::ISO8601, $payload->nbf)
- );
- }
-
- // Check that this token has been created before 'now'. This prevents
- // using tokens that have been created for later use (and haven't
- // correctly used the nbf claim).
- if (isset($payload->iat) && $payload->iat > ($timestamp + static::$leeway)) {
- throw new BeforeValidException(
- 'Cannot handle token prior to ' . \date(DateTime::ISO8601, $payload->iat)
- );
- }
-
- // Check if this token has expired.
- if (isset($payload->exp) && ($timestamp - static::$leeway) >= $payload->exp) {
- throw new ExpiredException('Expired token');
- }
-
- return $payload;
- }
-
- /**
- * Converts and signs a PHP object or array into a JWT string.
- *
- * @param object|array $payload PHP object or array
- * @param string|resource $key The secret key.
- * If the algorithm used is asymmetric, this is the private key
- * @param string $alg The signing algorithm.
- * Supported algorithms are 'ES384','ES256', 'HS256', 'HS384',
- * 'HS512', 'RS256', 'RS384', and 'RS512'
- * @param mixed $keyId
- * @param array $head An array with header elements to attach
- *
- * @return string A signed JWT
- *
- * @uses jsonEncode
- * @uses urlsafeB64Encode
- */
- public static function encode($payload, $key, $alg = 'HS256', $keyId = null, $head = null)
- {
- $header = array('typ' => 'JWT', 'alg' => $alg);
- if ($keyId !== null) {
- $header['kid'] = $keyId;
- }
- if (isset($head) && \is_array($head)) {
- $header = \array_merge($head, $header);
- }
- $segments = array();
- $segments[] = static::urlsafeB64Encode(static::jsonEncode($header));
- $segments[] = static::urlsafeB64Encode(static::jsonEncode($payload));
- $signing_input = \implode('.', $segments);
-
- $signature = static::sign($signing_input, $key, $alg);
- $segments[] = static::urlsafeB64Encode($signature);
-
- return \implode('.', $segments);
- }
-
- /**
- * Sign a string with a given key and algorithm.
- *
- * @param string $msg The message to sign
- * @param string|resource $key The secret key
- * @param string $alg The signing algorithm.
- * Supported algorithms are 'ES384','ES256', 'HS256', 'HS384',
- * 'HS512', 'RS256', 'RS384', and 'RS512'
- *
- * @return string An encrypted message
- *
- * @throws DomainException Unsupported algorithm or bad key was specified
- */
- public static function sign($msg, $key, $alg = 'HS256')
- {
- if (empty(static::$supported_algs[$alg])) {
- throw new DomainException('Algorithm not supported');
- }
- list($function, $algorithm) = static::$supported_algs[$alg];
- switch ($function) {
- case 'hash_hmac':
- return \hash_hmac($algorithm, $msg, $key, true);
- case 'openssl':
- $signature = '';
- $success = \openssl_sign($msg, $signature, $key, $algorithm);
- if (!$success) {
- throw new DomainException("OpenSSL unable to sign data");
- }
- if ($alg === 'ES256') {
- $signature = self::signatureFromDER($signature, 256);
- } elseif ($alg === 'ES384') {
- $signature = self::signatureFromDER($signature, 384);
- }
- return $signature;
- case 'sodium_crypto':
- if (!function_exists('sodium_crypto_sign_detached')) {
- throw new DomainException('libsodium is not available');
- }
- try {
- // The last non-empty line is used as the key.
- $lines = array_filter(explode("\n", $key));
- $key = base64_decode(end($lines));
- return sodium_crypto_sign_detached($msg, $key);
- } catch (Exception $e) {
- throw new DomainException($e->getMessage(), 0, $e);
- }
- }
- }
-
- /**
- * Verify a signature with the message, key and method. Not all methods
- * are symmetric, so we must have a separate verify and sign method.
- *
- * @param string $msg The original message (header and body)
- * @param string $signature The original signature
- * @param string|resource $key For HS*, a string key works. for RS*, must be a resource of an openssl public key
- * @param string $alg The algorithm
- *
- * @return bool
- *
- * @throws DomainException Invalid Algorithm, bad key, or OpenSSL failure
- */
- private static function verify($msg, $signature, $key, $alg)
- {
- if (empty(static::$supported_algs[$alg])) {
- throw new DomainException('Algorithm not supported');
- }
-
- list($function, $algorithm) = static::$supported_algs[$alg];
- switch ($function) {
- case 'openssl':
- $success = \openssl_verify($msg, $signature, $key, $algorithm);
- if ($success === 1) {
- return true;
- } elseif ($success === 0) {
- return false;
- }
- // returns 1 on success, 0 on failure, -1 on error.
- throw new DomainException(
- 'OpenSSL error: ' . \openssl_error_string()
- );
- case 'sodium_crypto':
- if (!function_exists('sodium_crypto_sign_verify_detached')) {
- throw new DomainException('libsodium is not available');
- }
- try {
- // The last non-empty line is used as the key.
- $lines = array_filter(explode("\n", $key));
- $key = base64_decode(end($lines));
- return sodium_crypto_sign_verify_detached($signature, $msg, $key);
- } catch (Exception $e) {
- throw new DomainException($e->getMessage(), 0, $e);
- }
- case 'hash_hmac':
- default:
- $hash = \hash_hmac($algorithm, $msg, $key, true);
- return self::constantTimeEquals($signature, $hash);
- }
- }
-
- /**
- * Decode a JSON string into a PHP object.
- *
- * @param string $input JSON string
- *
- * @return object Object representation of JSON string
- *
- * @throws DomainException Provided string was invalid JSON
- */
- public static function jsonDecode($input)
- {
- if (\version_compare(PHP_VERSION, '5.4.0', '>=') && !(\defined('JSON_C_VERSION') && PHP_INT_SIZE > 4)) {
- /** In PHP >=5.4.0, json_decode() accepts an options parameter, that allows you
- * to specify that large ints (like Steam Transaction IDs) should be treated as
- * strings, rather than the PHP default behaviour of converting them to floats.
- */
- $obj = \json_decode($input, false, 512, JSON_BIGINT_AS_STRING);
- } else {
- /** Not all servers will support that, however, so for older versions we must
- * manually detect large ints in the JSON string and quote them (thus converting
- *them to strings) before decoding, hence the preg_replace() call.
- */
- $max_int_length = \strlen((string) PHP_INT_MAX) - 1;
- $json_without_bigints = \preg_replace('/:\s*(-?\d{'.$max_int_length.',})/', ': "$1"', $input);
- $obj = \json_decode($json_without_bigints);
- }
-
- if ($errno = \json_last_error()) {
- static::handleJsonError($errno);
- } elseif ($obj === null && $input !== 'null') {
- throw new DomainException('Null result with non-null input');
- }
- return $obj;
- }
-
- /**
- * Encode a PHP object into a JSON string.
- *
- * @param object|array $input A PHP object or array
- *
- * @return string JSON representation of the PHP object or array
- *
- * @throws DomainException Provided object could not be encoded to valid JSON
- */
- public static function jsonEncode($input)
- {
- $json = \json_encode($input);
- if ($errno = \json_last_error()) {
- static::handleJsonError($errno);
- } elseif ($json === 'null' && $input !== null) {
- throw new DomainException('Null result with non-null input');
- }
- return $json;
- }
-
- /**
- * Decode a string with URL-safe Base64.
- *
- * @param string $input A Base64 encoded string
- *
- * @return string A decoded string
- */
- public static function urlsafeB64Decode($input)
- {
- $remainder = \strlen($input) % 4;
- if ($remainder) {
- $padlen = 4 - $remainder;
- $input .= \str_repeat('=', $padlen);
- }
- return \base64_decode(\strtr($input, '-_', '+/'));
- }
-
- /**
- * Encode a string with URL-safe Base64.
- *
- * @param string $input The string you want encoded
- *
- * @return string The base64 encode of what you passed in
- */
- public static function urlsafeB64Encode($input)
- {
- return \str_replace('=', '', \strtr(\base64_encode($input), '+/', '-_'));
- }
-
-
- /**
- * Determine if an algorithm has been provided for each Key
- *
- * @param Key|array|mixed $keyOrKeyArray
- * @param string|null $kid
- *
- * @throws UnexpectedValueException
- *
- * @return array containing the keyMaterial and algorithm
- */
- private static function getKeyMaterialAndAlgorithm($keyOrKeyArray, $kid = null)
- {
- if (
- is_string($keyOrKeyArray)
- || is_resource($keyOrKeyArray)
- || $keyOrKeyArray instanceof OpenSSLAsymmetricKey
- ) {
- return array($keyOrKeyArray, null);
- }
-
- if ($keyOrKeyArray instanceof Key) {
- return array($keyOrKeyArray->getKeyMaterial(), $keyOrKeyArray->getAlgorithm());
- }
-
- if (is_array($keyOrKeyArray) || $keyOrKeyArray instanceof ArrayAccess) {
- if (!isset($kid)) {
- throw new UnexpectedValueException('"kid" empty, unable to lookup correct key');
- }
- if (!isset($keyOrKeyArray[$kid])) {
- throw new UnexpectedValueException('"kid" invalid, unable to lookup correct key');
- }
-
- $key = $keyOrKeyArray[$kid];
-
- if ($key instanceof Key) {
- return array($key->getKeyMaterial(), $key->getAlgorithm());
- }
-
- return array($key, null);
- }
-
- throw new UnexpectedValueException(
- '$keyOrKeyArray must be a string|resource key, an array of string|resource keys, '
- . 'an instance of Firebase\JWT\Key key or an array of Firebase\JWT\Key keys'
- );
- }
-
- /**
- * @param string $left
- * @param string $right
- * @return bool
- */
- public static function constantTimeEquals($left, $right)
- {
- if (\function_exists('hash_equals')) {
- return \hash_equals($left, $right);
- }
- $len = \min(static::safeStrlen($left), static::safeStrlen($right));
-
- $status = 0;
- for ($i = 0; $i < $len; $i++) {
- $status |= (\ord($left[$i]) ^ \ord($right[$i]));
- }
- $status |= (static::safeStrlen($left) ^ static::safeStrlen($right));
-
- return ($status === 0);
- }
-
- /**
- * Helper method to create a JSON error.
- *
- * @param int $errno An error number from json_last_error()
- *
- * @return void
- */
- private static function handleJsonError($errno)
- {
- $messages = array(
- JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
- JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON',
- JSON_ERROR_CTRL_CHAR => 'Unexpected control character found',
- JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON',
- JSON_ERROR_UTF8 => 'Malformed UTF-8 characters' //PHP >= 5.3.3
- );
- throw new DomainException(
- isset($messages[$errno])
- ? $messages[$errno]
- : 'Unknown JSON error: ' . $errno
- );
- }
-
- /**
- * Get the number of bytes in cryptographic strings.
- *
- * @param string $str
- *
- * @return int
- */
- private static function safeStrlen($str)
- {
- if (\function_exists('mb_strlen')) {
- return \mb_strlen($str, '8bit');
- }
- return \strlen($str);
- }
-
- /**
- * Convert an ECDSA signature to an ASN.1 DER sequence
- *
- * @param string $sig The ECDSA signature to convert
- * @return string The encoded DER object
- */
- private static function signatureToDER($sig)
- {
- // Separate the signature into r-value and s-value
- list($r, $s) = \str_split($sig, (int) (\strlen($sig) / 2));
-
- // Trim leading zeros
- $r = \ltrim($r, "\x00");
- $s = \ltrim($s, "\x00");
-
- // Convert r-value and s-value from unsigned big-endian integers to
- // signed two's complement
- if (\ord($r[0]) > 0x7f) {
- $r = "\x00" . $r;
- }
- if (\ord($s[0]) > 0x7f) {
- $s = "\x00" . $s;
- }
-
- return self::encodeDER(
- self::ASN1_SEQUENCE,
- self::encodeDER(self::ASN1_INTEGER, $r) .
- self::encodeDER(self::ASN1_INTEGER, $s)
- );
- }
-
- /**
- * Encodes a value into a DER object.
- *
- * @param int $type DER tag
- * @param string $value the value to encode
- * @return string the encoded object
- */
- private static function encodeDER($type, $value)
- {
- $tag_header = 0;
- if ($type === self::ASN1_SEQUENCE) {
- $tag_header |= 0x20;
- }
-
- // Type
- $der = \chr($tag_header | $type);
-
- // Length
- $der .= \chr(\strlen($value));
-
- return $der . $value;
- }
-
- /**
- * Encodes signature from a DER object.
- *
- * @param string $der binary signature in DER format
- * @param int $keySize the number of bits in the key
- * @return string the signature
- */
- private static function signatureFromDER($der, $keySize)
- {
- // OpenSSL returns the ECDSA signatures as a binary ASN.1 DER SEQUENCE
- list($offset, $_) = self::readDER($der);
- list($offset, $r) = self::readDER($der, $offset);
- list($offset, $s) = self::readDER($der, $offset);
-
- // Convert r-value and s-value from signed two's compliment to unsigned
- // big-endian integers
- $r = \ltrim($r, "\x00");
- $s = \ltrim($s, "\x00");
-
- // Pad out r and s so that they are $keySize bits long
- $r = \str_pad($r, $keySize / 8, "\x00", STR_PAD_LEFT);
- $s = \str_pad($s, $keySize / 8, "\x00", STR_PAD_LEFT);
-
- return $r . $s;
- }
-
- /**
- * Reads binary DER-encoded data and decodes into a single object
- *
- * @param string $der the binary data in DER format
- * @param int $offset the offset of the data stream containing the object
- * to decode
- * @return array [$offset, $data] the new offset and the decoded object
- */
- private static function readDER($der, $offset = 0)
- {
- $pos = $offset;
- $size = \strlen($der);
- $constructed = (\ord($der[$pos]) >> 5) & 0x01;
- $type = \ord($der[$pos++]) & 0x1f;
-
- // Length
- $len = \ord($der[$pos++]);
- if ($len & 0x80) {
- $n = $len & 0x1f;
- $len = 0;
- while ($n-- && $pos < $size) {
- $len = ($len << 8) | \ord($der[$pos++]);
- }
- }
-
- // Value
- if ($type == self::ASN1_BIT_STRING) {
- $pos++; // Skip the first contents octet (padding indicator)
- $data = \substr($der, $pos, $len - 1);
- $pos += $len - 1;
- } elseif (!$constructed) {
- $data = \substr($der, $pos, $len);
- $pos += $len;
- } else {
- $data = null;
- }
-
- return array($pos, $data);
- }
-}
diff --git a/vendor/firebase/php-jwt/src/Key.php b/vendor/firebase/php-jwt/src/Key.php
deleted file mode 100644
index f1ede6f..0000000
--- a/vendor/firebase/php-jwt/src/Key.php
+++ /dev/null
@@ -1,59 +0,0 @@
-keyMaterial = $keyMaterial;
- $this->algorithm = $algorithm;
- }
-
- /**
- * Return the algorithm valid for this key
- *
- * @return string
- */
- public function getAlgorithm()
- {
- return $this->algorithm;
- }
-
- /**
- * @return string|resource|OpenSSLAsymmetricKey
- */
- public function getKeyMaterial()
- {
- return $this->keyMaterial;
- }
-}
diff --git a/vendor/firebase/php-jwt/src/SignatureInvalidException.php b/vendor/firebase/php-jwt/src/SignatureInvalidException.php
deleted file mode 100644
index d35dee9..0000000
--- a/vendor/firebase/php-jwt/src/SignatureInvalidException.php
+++ /dev/null
@@ -1,7 +0,0 @@
-= 5.5
@@ -352,6 +561,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* `GuzzleHttp\QueryParser` has been replaced with the
`GuzzleHttp\Psr7\parse_query`.
+
## 5.2.0 - 2015-01-27
* Added `AppliesHeadersInterface` to make applying headers to a request based
@@ -362,6 +572,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
RingBridge.
* Added a guard in the Pool class to not use recursion for request retries.
+
## 5.1.0 - 2014-12-19
* Pool class no longer uses recursion when a request is intercepted.
@@ -382,6 +593,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle
specific exceptions if necessary.
+
## 5.0.3 - 2014-11-03
This change updates query strings so that they are treated as un-encoded values
@@ -396,6 +608,7 @@ string that should not be parsed or encoded (unless a call to getQuery() is
subsequently made, forcing the query-string to be converted into a Query
object).
+
## 5.0.2 - 2014-10-30
* Added a trailing `\r\n` to multipart/form-data payloads. See
@@ -417,6 +630,7 @@ object).
string on a URL: Now allowing many more characters to be present in the
query string without being percent encoded. See https://tools.ietf.org/html/rfc3986#appendix-A
+
## 5.0.1 - 2014-10-16
Bugfix release.
@@ -428,6 +642,7 @@ Bugfix release.
* Fixed an issue where transfer statistics were not being populated in the
RingBridge. https://github.com/guzzle/guzzle/issues/866
+
## 5.0.0 - 2014-10-12
Adding support for non-blocking responses and some minor API cleanup.
@@ -509,6 +724,7 @@ interfaces.
argument. They now accept an associative array of options, including the
"size" key and "metadata" key which can be used to provide custom metadata.
+
## 4.2.2 - 2014-09-08
* Fixed a memory leak in the CurlAdapter when reusing cURL handles.
diff --git a/vendor/guzzlehttp/guzzle/LICENSE b/vendor/guzzlehttp/guzzle/LICENSE
index d51aa69..fd2375d 100644
--- a/vendor/guzzlehttp/guzzle/LICENSE
+++ b/vendor/guzzlehttp/guzzle/LICENSE
@@ -1,4 +1,12 @@
-Copyright (c) 2011 Michael Dowling, https://github.com/mtdowling
+The MIT License (MIT)
+
+Copyright (c) 2011 Michael Dowling
+Copyright (c) 2012 Jeremy Lindblom
+Copyright (c) 2014 Graham Campbell
+Copyright (c) 2015 Márk Sági-Kazár
+Copyright (c) 2015 Tobias Schultze
+Copyright (c) 2016 Tobias Nyholm
+Copyright (c) 2016 George Mponos
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/vendor/guzzlehttp/guzzle/README.md b/vendor/guzzlehttp/guzzle/README.md
index 7237170..0786462 100644
--- a/vendor/guzzlehttp/guzzle/README.md
+++ b/vendor/guzzlehttp/guzzle/README.md
@@ -42,9 +42,9 @@ $promise->wait();
We use GitHub issues only to discuss bugs and new features. For support please refer to:
-- [Documentation](http://guzzlephp.org/)
-- [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle)
-- [#guzzle](https://app.slack.com/client/T0D2S9JCT/CE6UAAKL4) channel on [PHP-HTTP Slack](http://slack.httplug.io/)
+- [Documentation](https://docs.guzzlephp.org)
+- [Stack Overflow](https://stackoverflow.com/questions/tagged/guzzle)
+- [#guzzle](https://app.slack.com/client/T0D2S9JCT/CE6UAAKL4) channel on [PHP-HTTP Slack](https://slack.httplug.io/)
- [Gitter](https://gitter.im/guzzle/guzzle)
@@ -60,20 +60,35 @@ composer require guzzlehttp/guzzle
## Version Guidance
-| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version |
-|---------|------------|---------------------|--------------|---------------------|---------------------|-------|-------------|
-| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >= 5.3.3 |
-| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >= 5.4 |
-| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 |
-| 6.x | Bugfixes | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 |
-| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >= 7.2 |
+| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version |
+|---------|---------------------|---------------------|--------------|---------------------|---------------------|-------|--------------|
+| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >=5.3.3,<7.0 |
+| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >=5.4,<7.0 |
+| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >=5.4,<7.4 |
+| 6.x | Security fixes only | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >=5.5,<8.0 |
+| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.3 |
[guzzle-3-repo]: https://github.com/guzzle/guzzle3
[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x
[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3
[guzzle-6-repo]: https://github.com/guzzle/guzzle/tree/6.5
[guzzle-7-repo]: https://github.com/guzzle/guzzle
-[guzzle-3-docs]: http://guzzle3.readthedocs.org
-[guzzle-5-docs]: http://docs.guzzlephp.org/en/5.3/
-[guzzle-6-docs]: http://docs.guzzlephp.org/en/6.5/
-[guzzle-7-docs]: http://docs.guzzlephp.org/en/latest/
+[guzzle-3-docs]: https://guzzle3.readthedocs.io/
+[guzzle-5-docs]: https://docs.guzzlephp.org/en/5.3/
+[guzzle-6-docs]: https://docs.guzzlephp.org/en/6.5/
+[guzzle-7-docs]: https://docs.guzzlephp.org/en/latest/
+
+
+## Security
+
+If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/guzzle/security/policy) for more information.
+
+## License
+
+Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
+
+## For Enterprise
+
+Available as part of the Tidelift Subscription
+
+The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-guzzle?utm_source=packagist-guzzlehttp-guzzle&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
diff --git a/vendor/guzzlehttp/guzzle/composer.json b/vendor/guzzlehttp/guzzle/composer.json
index 5cf87fd..3207f8c 100644
--- a/vendor/guzzlehttp/guzzle/composer.json
+++ b/vendor/guzzlehttp/guzzle/composer.json
@@ -1,6 +1,5 @@
{
"name": "guzzlehttp/guzzle",
- "type": "library",
"description": "Guzzle is a PHP HTTP client library",
"keywords": [
"framework",
@@ -13,36 +12,62 @@
"PSR-7",
"PSR-18"
],
- "homepage": "http://guzzlephp.org/",
"license": "MIT",
"authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
+ {
+ "name": "Jeremy Lindblom",
+ "email": "jeremeamia@gmail.com",
+ "homepage": "https://github.com/jeremeamia"
+ },
+ {
+ "name": "George Mponos",
+ "email": "gmponos@gmail.com",
+ "homepage": "https://github.com/gmponos"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ },
{
"name": "Márk Sági-Kazár",
"email": "mark.sagikazar@gmail.com",
- "homepage": "https://sagikazarmark.hu"
+ "homepage": "https://github.com/sagikazarmark"
+ },
+ {
+ "name": "Tobias Schultze",
+ "email": "webmaster@tubo-world.de",
+ "homepage": "https://github.com/Tobion"
}
],
"require": {
- "php": "^7.2.5",
+ "php": "^7.2.5 || ^8.0",
"ext-json": "*",
- "guzzlehttp/promises": "^1.0",
- "guzzlehttp/psr7": "^1.6.1",
- "psr/http-client": "^1.0"
+ "guzzlehttp/promises": "^1.5.3 || ^2.0",
+ "guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
+ "psr/http-client": "^1.0",
+ "symfony/deprecation-contracts": "^2.2 || ^3.0"
},
"provide": {
"psr/http-client-implementation": "1.0"
},
"require-dev": {
"ext-curl": "*",
- "ergebnis/composer-normalize": "^2.0",
- "php-http/client-integration-tests": "dev-phpunit8",
- "phpunit/phpunit": "^8.5.5",
- "psr/log": "^1.1"
+ "bamarni/composer-bin-plugin": "^1.8.1",
+ "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999",
+ "php-http/message-factory": "^1.1",
+ "phpunit/phpunit": "^8.5.29 || ^9.5.23",
+ "psr/log": "^1.1 || ^2.0 || ^3.0"
},
"suggest": {
"ext-curl": "Required for CURL handler support",
@@ -50,11 +75,16 @@
"psr/log": "Required for using the Log middleware"
},
"config": {
+ "allow-plugins": {
+ "bamarni/composer-bin-plugin": true
+ },
+ "preferred-install": "dist",
"sort-packages": true
},
"extra": {
- "branch-alias": {
- "dev-master": "7.0-dev"
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
}
},
"autoload": {
diff --git a/vendor/guzzlehttp/guzzle/src/BodySummarizer.php b/vendor/guzzlehttp/guzzle/src/BodySummarizer.php
new file mode 100644
index 0000000..6eca94e
--- /dev/null
+++ b/vendor/guzzlehttp/guzzle/src/BodySummarizer.php
@@ -0,0 +1,28 @@
+truncateAt = $truncateAt;
+ }
+
+ /**
+ * Returns a summarized message body.
+ */
+ public function summarize(MessageInterface $message): ?string
+ {
+ return $this->truncateAt === null
+ ? \GuzzleHttp\Psr7\Message::bodySummary($message)
+ : \GuzzleHttp\Psr7\Message::bodySummary($message, $this->truncateAt);
+ }
+}
diff --git a/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php b/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php
new file mode 100644
index 0000000..3e02e03
--- /dev/null
+++ b/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php
@@ -0,0 +1,13 @@
+configureDefaults($config);
@@ -71,6 +75,8 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
* @param array $args
*
* @return PromiseInterface|ResponseInterface
+ *
+ * @deprecated Client::__call will be removed in guzzlehttp/guzzle:8.0.
*/
public function __call($method, $args)
{
@@ -114,13 +120,14 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
public function send(RequestInterface $request, array $options = []): ResponseInterface
{
$options[RequestOptions::SYNCHRONOUS] = true;
+
return $this->sendAsync($request, $options)->wait();
}
/**
* The HttpClient PSR (PSR-18) specify this method.
*
- * @inheritDoc
+ * {@inheritDoc}
*/
public function sendRequest(RequestInterface $request): ResponseInterface
{
@@ -151,7 +158,7 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
$body = $options['body'] ?? null;
$version = $options['version'] ?? '1.1';
// Merge the URI into the base URI.
- $uri = $this->buildUri(Psr7\uri_for($uri), $options);
+ $uri = $this->buildUri(Psr7\Utils::uriFor($uri), $options);
if (\is_array($body)) {
throw $this->invalidBody();
}
@@ -178,6 +185,7 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
public function request(string $method, $uri = '', array $options = []): ResponseInterface
{
$options[RequestOptions::SYNCHRONOUS] = true;
+
return $this->requestAsync($method, $uri, $options)->wait();
}
@@ -191,18 +199,20 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
* @param string|null $option The config option to retrieve.
*
* @return mixed
+ *
+ * @deprecated Client::getConfig will be removed in guzzlehttp/guzzle:8.0.
*/
public function getConfig(?string $option = null)
{
return $option === null
? $this->config
- : (isset($this->config[$option]) ? $this->config[$option] : null);
+ : ($this->config[$option] ?? null);
}
private function buildUri(UriInterface $uri, array $config): UriInterface
{
if (isset($config['base_uri'])) {
- $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri);
+ $uri = Psr7\UriResolver::resolve(Psr7\Utils::uriFor($config['base_uri']), $uri);
}
if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) {
@@ -220,11 +230,11 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
{
$defaults = [
'allow_redirects' => RedirectMiddleware::$defaultSettings,
- 'http_errors' => true,
- 'decode_content' => true,
- 'verify' => true,
- 'cookies' => false,
- 'idn_conversion' => false,
+ 'http_errors' => true,
+ 'decode_content' => true,
+ 'verify' => true,
+ 'cookies' => false,
+ 'idn_conversion' => false,
];
// Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set.
@@ -320,9 +330,9 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
$handler = $options['handler'];
try {
- return Promise\promise_for($handler($request, $options));
+ return P\Create::promiseFor($handler($request, $options));
} catch (\Exception $e) {
- return Promise\rejection_for($e);
+ return P\Create::rejectionFor($e);
}
}
@@ -336,6 +346,9 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
];
if (isset($options['headers'])) {
+ if (array_keys($options['headers']) === range(0, count($options['headers']) - 1)) {
+ throw new InvalidArgumentException('The headers array must have header name as keys.');
+ }
$modify['set_headers'] = $options['headers'];
unset($options['headers']);
}
@@ -343,15 +356,15 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
if (isset($options['form_params'])) {
if (isset($options['multipart'])) {
throw new InvalidArgumentException('You cannot use '
- . 'form_params and multipart at the same time. Use the '
- . 'form_params option if you want to send application/'
- . 'x-www-form-urlencoded requests, and the multipart '
- . 'option to send multipart/form-data requests.');
+ .'form_params and multipart at the same time. Use the '
+ .'form_params option if you want to send application/'
+ .'x-www-form-urlencoded requests, and the multipart '
+ .'option to send multipart/form-data requests.');
}
$options['body'] = \http_build_query($options['form_params'], '', '&');
unset($options['form_params']);
// Ensure that we don't have the header in different case and set the new value.
- $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
+ $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
$options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded';
}
@@ -364,7 +377,7 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
$options['body'] = Utils::jsonEncode($options['json']);
unset($options['json']);
// Ensure that we don't have the header in different case and set the new value.
- $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
+ $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
$options['_conditional']['Content-Type'] = 'application/json';
}
@@ -372,7 +385,7 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
&& $options['decode_content'] !== true
) {
// Ensure that we don't have the header in different case and set the new value.
- $options['_conditional'] = Psr7\_caseless_remove(['Accept-Encoding'], $options['_conditional']);
+ $options['_conditional'] = Psr7\Utils::caselessRemove(['Accept-Encoding'], $options['_conditional']);
$modify['set_headers']['Accept-Encoding'] = $options['decode_content'];
}
@@ -380,7 +393,7 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
if (\is_array($options['body'])) {
throw $this->invalidBody();
}
- $modify['body'] = Psr7\stream_for($options['body']);
+ $modify['body'] = Psr7\Utils::streamFor($options['body']);
unset($options['body']);
}
@@ -390,9 +403,9 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
switch ($type) {
case 'basic':
// Ensure that we don't have the header in different case and set the new value.
- $modify['set_headers'] = Psr7\_caseless_remove(['Authorization'], $modify['set_headers']);
+ $modify['set_headers'] = Psr7\Utils::caselessRemove(['Authorization'], $modify['set_headers']);
$modify['set_headers']['Authorization'] = 'Basic '
- . \base64_encode("$value[0]:$value[1]");
+ .\base64_encode("$value[0]:$value[1]");
break;
case 'digest':
// @todo: Do not rely on curl
@@ -426,13 +439,17 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
}
}
- $request = Psr7\modify_request($request, $modify);
+ if (isset($options['version'])) {
+ $modify['version'] = $options['version'];
+ }
+
+ $request = Psr7\Utils::modifyRequest($request, $modify);
if ($request->getBody() instanceof Psr7\MultipartStream) {
// Use a multipart/form-data POST if a Content-Type is not set.
// Ensure that we don't have the header in different case and set the new value.
- $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
+ $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
$options['_conditional']['Content-Type'] = 'multipart/form-data; boundary='
- . $request->getBody()->getBoundary();
+ .$request->getBody()->getBoundary();
}
// Merge in conditional headers if they are not present.
@@ -444,7 +461,7 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
$modify['set_headers'][$k] = $v;
}
}
- $request = Psr7\modify_request($request, $modify);
+ $request = Psr7\Utils::modifyRequest($request, $modify);
// Don't pass this internal value along to middleware/handlers.
unset($options['_conditional']);
}
@@ -458,9 +475,9 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
private function invalidBody(): InvalidArgumentException
{
return new InvalidArgumentException('Passing in the "body" request '
- . 'option as an array to send a request is not supported. '
- . 'Please use the "form_params" request option to send a '
- . 'application/x-www-form-urlencoded request, or the "multipart" '
- . 'request option to send a multipart/form-data request.');
+ .'option as an array to send a request is not supported. '
+ .'Please use the "form_params" request option to send a '
+ .'application/x-www-form-urlencoded request, or the "multipart" '
+ .'request option to send a multipart/form-data request.');
}
}
diff --git a/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/vendor/guzzlehttp/guzzle/src/ClientInterface.php
index bc0fe73..6aaee61 100644
--- a/vendor/guzzlehttp/guzzle/src/ClientInterface.php
+++ b/vendor/guzzlehttp/guzzle/src/ClientInterface.php
@@ -16,7 +16,7 @@ interface ClientInterface
/**
* The Guzzle major version.
*/
- const MAJOR_VERSION = 7;
+ public const MAJOR_VERSION = 7;
/**
* Send an HTTP request.
@@ -77,6 +77,8 @@ interface ClientInterface
* @param string|null $option The config option to retrieve.
*
* @return mixed
+ *
+ * @deprecated ClientInterface::getConfig will be removed in guzzlehttp/guzzle:8.0.
*/
public function getConfig(?string $option = null);
}
diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
index d6757c6..b4ced5a 100644
--- a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
+++ b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
@@ -50,10 +50,10 @@ class CookieJar implements CookieJarInterface
$cookieJar = new self();
foreach ($cookies as $name => $value) {
$cookieJar->setCookie(new SetCookie([
- 'Domain' => $domain,
- 'Name' => $name,
- 'Value' => $value,
- 'Discard' => true
+ 'Domain' => $domain,
+ 'Name' => $name,
+ 'Value' => $value,
+ 'Discard' => true,
]));
}
@@ -97,7 +97,7 @@ class CookieJar implements CookieJarInterface
}
/**
- * @inheritDoc
+ * {@inheritDoc}
*/
public function toArray(): array
{
@@ -107,12 +107,13 @@ class CookieJar implements CookieJarInterface
}
/**
- * @inheritDoc
+ * {@inheritDoc}
*/
public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void
{
if (!$domain) {
$this->cookies = [];
+
return;
} elseif (!$path) {
$this->cookies = \array_filter(
@@ -142,7 +143,7 @@ class CookieJar implements CookieJarInterface
}
/**
- * @inheritDoc
+ * {@inheritDoc}
*/
public function clearSessionCookies(): void
{
@@ -155,7 +156,7 @@ class CookieJar implements CookieJarInterface
}
/**
- * @inheritDoc
+ * {@inheritDoc}
*/
public function setCookie(SetCookie $cookie): bool
{
@@ -170,15 +171,15 @@ class CookieJar implements CookieJarInterface
$result = $cookie->validate();
if ($result !== true) {
if ($this->strictMode) {
- throw new \RuntimeException('Invalid cookie: ' . $result);
+ throw new \RuntimeException('Invalid cookie: '.$result);
}
$this->removeCookieIfEmpty($cookie);
+
return false;
}
// Resolve conflicts with previously set cookies
foreach ($this->cookies as $i => $c) {
-
// Two cookies are identical, when their path, and domain are
// identical.
if ($c->getPath() != $cookie->getPath() ||
@@ -241,6 +242,11 @@ class CookieJar implements CookieJarInterface
if (0 !== \strpos($sc->getPath(), '/')) {
$sc->setPath($this->getCookiePathFromRequest($request));
}
+ if (!$sc->matchesDomain($request->getUri()->getHost())) {
+ continue;
+ }
+ // Note: At this point `$sc->getDomain()` being a public suffix should
+ // be rejected, but we don't want to pull in the full PSL dependency.
$this->setCookie($sc);
}
}
@@ -249,7 +255,7 @@ class CookieJar implements CookieJarInterface
/**
* Computes cookie path following RFC 6265 section 5.1.4
*
- * @link https://tools.ietf.org/html/rfc6265#section-5.1.4
+ * @see https://tools.ietf.org/html/rfc6265#section-5.1.4
*/
private function getCookiePathFromRequest(RequestInterface $request): string
{
@@ -285,8 +291,8 @@ class CookieJar implements CookieJarInterface
!$cookie->isExpired() &&
(!$cookie->getSecure() || $scheme === 'https')
) {
- $values[] = $cookie->getName() . '='
- . $cookie->getValue();
+ $values[] = $cookie->getName().'='
+ .$cookie->getValue();
}
}
diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
index fa6d660..50bc363 100644
--- a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
+++ b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
@@ -13,7 +13,7 @@ use Psr\Http\Message\ResponseInterface;
* necessary. Subclasses are also responsible for storing and retrieving
* cookies from a file, database, etc.
*
- * @link https://docs.python.org/2/library/cookielib.html Inspiration
+ * @see https://docs.python.org/2/library/cookielib.html Inspiration
* @extends \IteratorAggregate
*/
interface CookieJarInterface extends \Countable, \IteratorAggregate
@@ -36,10 +36,7 @@ interface CookieJarInterface extends \Countable, \IteratorAggregate
* @param RequestInterface $request Request that was sent
* @param ResponseInterface $response Response that was received
*/
- public function extractCookies(
- RequestInterface $request,
- ResponseInterface $response
- ): void;
+ public function extractCookies(RequestInterface $request, ResponseInterface $response): void;
/**
* Sets a cookie in the cookie jar.
diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
index 5d51ca9..cb3e67c 100644
--- a/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
+++ b/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
@@ -71,7 +71,7 @@ class SessionCookieJar extends CookieJar
$this->setCookie(new SetCookie($cookie));
}
} elseif (\strlen($data)) {
- throw new \RuntimeException("Invalid cookie data");
+ throw new \RuntimeException('Invalid cookie data');
}
}
}
diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php
index cf278cb..d74915b 100644
--- a/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php
+++ b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php
@@ -11,15 +11,15 @@ class SetCookie
* @var array
*/
private static $defaults = [
- 'Name' => null,
- 'Value' => null,
- 'Domain' => null,
- 'Path' => '/',
- 'Max-Age' => null,
- 'Expires' => null,
- 'Secure' => false,
- 'Discard' => false,
- 'HttpOnly' => false
+ 'Name' => null,
+ 'Value' => null,
+ 'Domain' => null,
+ 'Path' => '/',
+ 'Max-Age' => null,
+ 'Expires' => null,
+ 'Secure' => false,
+ 'Discard' => false,
+ 'HttpOnly' => false,
];
/**
@@ -28,7 +28,7 @@ class SetCookie
private $data;
/**
- * Create a new SetCookie object from a string
+ * Create a new SetCookie object from a string.
*
* @param string $cookie Set-Cookie header string
*/
@@ -39,7 +39,7 @@ class SetCookie
// Explode the cookie string using a series of semicolons
$pieces = \array_filter(\array_map('trim', \explode(';', $cookie)));
// The name of the cookie (first kvp) must exist and include an equal sign.
- if (empty($pieces[0]) || !\strpos($pieces[0], '=')) {
+ if (!isset($pieces[0]) || \strpos($pieces[0], '=') === false) {
return new self($data);
}
@@ -52,13 +52,19 @@ class SetCookie
: true;
// Only check for non-cookies when cookies have been found
- if (empty($data['Name'])) {
+ if (!isset($data['Name'])) {
$data['Name'] = $key;
$data['Value'] = $value;
} else {
foreach (\array_keys(self::$defaults) as $search) {
if (!\strcasecmp($search, $key)) {
- $data[$search] = $value;
+ if ($search === 'Max-Age') {
+ if (is_numeric($value)) {
+ $data[$search] = (int) $value;
+ }
+ } else {
+ $data[$search] = $value;
+ }
continue 2;
}
}
@@ -74,13 +80,49 @@ class SetCookie
*/
public function __construct(array $data = [])
{
- /** @var array|null $replaced will be null in case of replace error */
- $replaced = \array_replace(self::$defaults, $data);
- if ($replaced === null) {
- throw new \InvalidArgumentException('Unable to replace the default values for the Cookie.');
+ $this->data = self::$defaults;
+
+ if (isset($data['Name'])) {
+ $this->setName($data['Name']);
+ }
+
+ if (isset($data['Value'])) {
+ $this->setValue($data['Value']);
+ }
+
+ if (isset($data['Domain'])) {
+ $this->setDomain($data['Domain']);
+ }
+
+ if (isset($data['Path'])) {
+ $this->setPath($data['Path']);
+ }
+
+ if (isset($data['Max-Age'])) {
+ $this->setMaxAge($data['Max-Age']);
+ }
+
+ if (isset($data['Expires'])) {
+ $this->setExpires($data['Expires']);
+ }
+
+ if (isset($data['Secure'])) {
+ $this->setSecure($data['Secure']);
+ }
+
+ if (isset($data['Discard'])) {
+ $this->setDiscard($data['Discard']);
+ }
+
+ if (isset($data['HttpOnly'])) {
+ $this->setHttpOnly($data['HttpOnly']);
+ }
+
+ // Set the remaining values that don't have extra validation logic
+ foreach (array_diff(array_keys($data), array_keys(self::$defaults)) as $key) {
+ $this->data[$key] = $data[$key];
}
- $this->data = $replaced;
// Extract the Expires value and turn it into a UNIX timestamp if needed
if (!$this->getExpires() && $this->getMaxAge()) {
// Calculate the Expires date
@@ -92,13 +134,13 @@ class SetCookie
public function __toString()
{
- $str = $this->data['Name'] . '=' . $this->data['Value'] . '; ';
+ $str = $this->data['Name'].'='.($this->data['Value'] ?? '').'; ';
foreach ($this->data as $k => $v) {
if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) {
if ($k === 'Expires') {
- $str .= 'Expires=' . \gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
+ $str .= 'Expires='.\gmdate('D, d M Y H:i:s \G\M\T', $v).'; ';
} else {
- $str .= ($v === true ? $k : "{$k}={$v}") . '; ';
+ $str .= ($v === true ? $k : "{$k}={$v}").'; ';
}
}
}
@@ -112,7 +154,7 @@ class SetCookie
}
/**
- * Get the cookie name
+ * Get the cookie name.
*
* @return string
*/
@@ -122,17 +164,21 @@ class SetCookie
}
/**
- * Set the cookie name
+ * Set the cookie name.
*
* @param string $name Cookie name
*/
public function setName($name): void
{
- $this->data['Name'] = $name;
+ if (!is_string($name)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Name'] = (string) $name;
}
/**
- * Get the cookie value
+ * Get the cookie value.
*
* @return string|null
*/
@@ -142,17 +188,21 @@ class SetCookie
}
/**
- * Set the cookie value
+ * Set the cookie value.
*
* @param string $value Cookie value
*/
public function setValue($value): void
{
- $this->data['Value'] = $value;
+ if (!is_string($value)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Value'] = (string) $value;
}
/**
- * Get the domain
+ * Get the domain.
*
* @return string|null
*/
@@ -162,17 +212,21 @@ class SetCookie
}
/**
- * Set the domain of the cookie
+ * Set the domain of the cookie.
*
- * @param string $domain
+ * @param string|null $domain
*/
public function setDomain($domain): void
{
- $this->data['Domain'] = $domain;
+ if (!is_string($domain) && null !== $domain) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Domain'] = null === $domain ? null : (string) $domain;
}
/**
- * Get the path
+ * Get the path.
*
* @return string
*/
@@ -182,37 +236,45 @@ class SetCookie
}
/**
- * Set the path of the cookie
+ * Set the path of the cookie.
*
* @param string $path Path of the cookie
*/
public function setPath($path): void
{
- $this->data['Path'] = $path;
+ if (!is_string($path)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Path'] = (string) $path;
}
/**
- * Maximum lifetime of the cookie in seconds
+ * Maximum lifetime of the cookie in seconds.
*
* @return int|null
*/
public function getMaxAge()
{
- return $this->data['Max-Age'];
+ return null === $this->data['Max-Age'] ? null : (int) $this->data['Max-Age'];
}
/**
- * Set the max-age of the cookie
+ * Set the max-age of the cookie.
*
- * @param int $maxAge Max age of the cookie in seconds
+ * @param int|null $maxAge Max age of the cookie in seconds
*/
public function setMaxAge($maxAge): void
{
- $this->data['Max-Age'] = $maxAge;
+ if (!is_int($maxAge) && null !== $maxAge) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Max-Age'] = $maxAge === null ? null : (int) $maxAge;
}
/**
- * The UNIX timestamp when the cookie Expires
+ * The UNIX timestamp when the cookie Expires.
*
* @return string|int|null
*/
@@ -222,21 +284,23 @@ class SetCookie
}
/**
- * Set the unix timestamp for which the cookie will expire
+ * Set the unix timestamp for which the cookie will expire.
*
- * @param int|string $timestamp Unix timestamp or any English textual datetime description.
+ * @param int|string|null $timestamp Unix timestamp or any English textual datetime description.
*/
public function setExpires($timestamp): void
{
- $this->data['Expires'] = \is_numeric($timestamp)
- ? (int) $timestamp
- : \strtotime($timestamp);
+ if (!is_int($timestamp) && !is_string($timestamp) && null !== $timestamp) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int, string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Expires'] = null === $timestamp ? null : (\is_numeric($timestamp) ? (int) $timestamp : \strtotime((string) $timestamp));
}
/**
- * Get whether or not this is a secure cookie
+ * Get whether or not this is a secure cookie.
*
- * @return bool|null
+ * @return bool
*/
public function getSecure()
{
@@ -244,17 +308,21 @@ class SetCookie
}
/**
- * Set whether or not the cookie is secure
+ * Set whether or not the cookie is secure.
*
* @param bool $secure Set to true or false if secure
*/
public function setSecure($secure): void
{
- $this->data['Secure'] = $secure;
+ if (!is_bool($secure)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Secure'] = (bool) $secure;
}
/**
- * Get whether or not this is a session cookie
+ * Get whether or not this is a session cookie.
*
* @return bool|null
*/
@@ -264,17 +332,21 @@ class SetCookie
}
/**
- * Set whether or not this is a session cookie
+ * Set whether or not this is a session cookie.
*
* @param bool $discard Set to true or false if this is a session cookie
*/
public function setDiscard($discard): void
{
- $this->data['Discard'] = $discard;
+ if (!is_bool($discard)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Discard'] = (bool) $discard;
}
/**
- * Get whether or not this is an HTTP only cookie
+ * Get whether or not this is an HTTP only cookie.
*
* @return bool
*/
@@ -284,13 +356,17 @@ class SetCookie
}
/**
- * Set whether or not this is an HTTP only cookie
+ * Set whether or not this is an HTTP only cookie.
*
* @param bool $httpOnly Set to true or false if this is HTTP only
*/
public function setHttpOnly($httpOnly): void
{
- $this->data['HttpOnly'] = $httpOnly;
+ if (!is_bool($httpOnly)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['HttpOnly'] = (bool) $httpOnly;
}
/**
@@ -332,7 +408,7 @@ class SetCookie
}
/**
- * Check if the cookie matches a domain value
+ * Check if the cookie matches a domain value.
*
* @param string $domain Domain to check against
*/
@@ -345,10 +421,12 @@ class SetCookie
// Remove the leading '.' as per spec in RFC 6265.
// https://tools.ietf.org/html/rfc6265#section-5.2.3
- $cookieDomain = \ltrim($cookieDomain, '.');
+ $cookieDomain = \ltrim(\strtolower($cookieDomain), '.');
+
+ $domain = \strtolower($domain);
// Domain not set or exact match.
- if (!$cookieDomain || !\strcasecmp($domain, $cookieDomain)) {
+ if ('' === $cookieDomain || $domain === $cookieDomain) {
return true;
}
@@ -358,11 +436,11 @@ class SetCookie
return false;
}
- return (bool) \preg_match('/\.' . \preg_quote($cookieDomain, '/') . '$/', $domain);
+ return (bool) \preg_match('/\.'.\preg_quote($cookieDomain, '/').'$/', $domain);
}
/**
- * Check if the cookie is expired
+ * Check if the cookie is expired.
*/
public function isExpired(): bool
{
@@ -370,15 +448,14 @@ class SetCookie
}
/**
- * Check if the cookie is valid according to RFC 6265
+ * Check if the cookie is valid according to RFC 6265.
*
* @return bool|string Returns true if valid or an error message if invalid
*/
public function validate()
{
- // Names must not be empty, but can be 0
$name = $this->getName();
- if (empty($name) && !\is_numeric($name)) {
+ if ($name === '') {
return 'The cookie name must not be empty';
}
@@ -388,21 +465,21 @@ class SetCookie
$name
)) {
return 'Cookie name must not contain invalid characters: ASCII '
- . 'Control characters (0-31;127), space, tab and the '
- . 'following characters: ()<>@,;:\"/?={}';
+ .'Control characters (0-31;127), space, tab and the '
+ .'following characters: ()<>@,;:\"/?={}';
}
- // Value must not be empty, but can be 0
+ // Value must not be null. 0 and empty string are valid. Empty strings
+ // are technically against RFC 6265, but known to happen in the wild.
$value = $this->getValue();
- if (empty($value) && !\is_numeric($value)) {
+ if ($value === null) {
return 'The cookie value must not be empty';
}
- // Domains must not be empty, but can be 0
- // A "0" is not a valid internet domain, but may be used as server name
- // in a private network.
+ // Domains must not be empty, but can be 0. "0" is not a valid internet
+ // domain, but may be used as server name in a private network.
$domain = $this->getDomain();
- if (empty($domain) && !\is_numeric($domain)) {
+ if ($domain === null || $domain === '') {
return 'The cookie domain must not be empty';
}
diff --git a/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php b/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
index 315fa37..c2d0a9c 100644
--- a/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
+++ b/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
@@ -2,6 +2,8 @@
namespace GuzzleHttp\Exception;
+use GuzzleHttp\BodySummarizer;
+use GuzzleHttp\BodySummarizerInterface;
use Psr\Http\Client\RequestExceptionInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
@@ -47,24 +49,24 @@ class RequestException extends TransferException implements RequestExceptionInte
*/
public static function wrapException(RequestInterface $request, \Throwable $e): RequestException
{
- return $e instanceof RequestException
- ? $e
- : new RequestException($e->getMessage(), $request, null, $e);
+ return $e instanceof RequestException ? $e : new RequestException($e->getMessage(), $request, null, $e);
}
/**
* Factory method to create a new exception with a normalized error message
*
- * @param RequestInterface $request Request
- * @param ResponseInterface $response Response received
- * @param \Throwable $previous Previous exception
- * @param array $ctx Optional handler context.
+ * @param RequestInterface $request Request sent
+ * @param ResponseInterface $response Response received
+ * @param \Throwable|null $previous Previous exception
+ * @param array $handlerContext Optional handler context
+ * @param BodySummarizerInterface|null $bodySummarizer Optional body summarizer
*/
public static function create(
RequestInterface $request,
ResponseInterface $response = null,
\Throwable $previous = null,
- array $ctx = []
+ array $handlerContext = [],
+ BodySummarizerInterface $bodySummarizer = null
): self {
if (!$response) {
return new self(
@@ -72,7 +74,7 @@ class RequestException extends TransferException implements RequestExceptionInte
$request,
null,
$previous,
- $ctx
+ $handlerContext
);
}
@@ -97,18 +99,18 @@ class RequestException extends TransferException implements RequestExceptionInte
'%s: `%s %s` resulted in a `%s %s` response',
$label,
$request->getMethod(),
- $uri,
+ $uri->__toString(),
$response->getStatusCode(),
$response->getReasonPhrase()
);
- $summary = \GuzzleHttp\Psr7\get_message_body_summary($response);
+ $summary = ($bodySummarizer ?? new BodySummarizer())->summarize($response);
if ($summary !== null) {
$message .= ":\n{$summary}\n";
}
- return new $className($message, $request, $response, $previous, $ctx);
+ return new $className($message, $request, $response, $previous, $handlerContext);
}
/**
diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
index d236865..3a6a8db 100644
--- a/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
+++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
@@ -4,9 +4,9 @@ namespace GuzzleHttp\Handler;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Promise as P;
use GuzzleHttp\Promise\FulfilledPromise;
use GuzzleHttp\Promise\PromiseInterface;
-use GuzzleHttp\Psr7;
use GuzzleHttp\Psr7\LazyOpenStream;
use GuzzleHttp\TransferStats;
use GuzzleHttp\Utils;
@@ -14,14 +14,20 @@ use Psr\Http\Message\RequestInterface;
/**
* Creates curl resources from a request
+ *
+ * @final
*/
class CurlFactory implements CurlFactoryInterface
{
public const CURL_VERSION_STR = 'curl_version';
+
+ /**
+ * @deprecated
+ */
public const LOW_CURL_VERSION_NUMBER = '7.21.2';
/**
- * @var resource[]
+ * @var resource[]|\CurlHandle[]
*/
private $handles = [];
@@ -45,7 +51,7 @@ class CurlFactory implements CurlFactoryInterface
unset($options['curl']['body_as_string']);
}
- $easy = new EasyHandle;
+ $easy = new EasyHandle();
$easy->request = $request;
$easy->options = $options;
$conf = $this->getDefaultConf($easy);
@@ -60,9 +66,7 @@ class CurlFactory implements CurlFactoryInterface
}
$conf[\CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy);
- $easy->handle = $this->handles
- ? \array_pop($this->handles)
- : \curl_init();
+ $easy->handle = $this->handles ? \array_pop($this->handles) : \curl_init();
curl_setopt_array($easy->handle, $conf);
return $easy;
@@ -96,11 +100,8 @@ class CurlFactory implements CurlFactoryInterface
* @param callable(RequestInterface, array): PromiseInterface $handler
* @param CurlFactoryInterface $factory Dictates how the handle is released
*/
- public static function finish(
- callable $handler,
- EasyHandle $easy,
- CurlFactoryInterface $factory
- ): PromiseInterface {
+ public static function finish(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface
+ {
if (isset($easy->options['on_stats'])) {
self::invokeStats($easy);
}
@@ -132,17 +133,14 @@ class CurlFactory implements CurlFactoryInterface
$easy->errno,
$curlStats
);
- \call_user_func($easy->options['on_stats'], $stats);
+ ($easy->options['on_stats'])($stats);
}
/**
* @param callable(RequestInterface, array): PromiseInterface $handler
*/
- private static function finishError(
- callable $handler,
- EasyHandle $easy,
- CurlFactoryInterface $factory
- ): PromiseInterface {
+ private static function finishError(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface
+ {
// Get error information and release the handle to the factory.
$ctx = [
'errno' => $easy->errno,
@@ -153,9 +151,7 @@ class CurlFactory implements CurlFactoryInterface
$factory->release($easy);
// Retry when nothing is present or when curl failed to rewind.
- if (empty($easy->options['_err_message'])
- && (!$easy->errno || $easy->errno == 65)
- ) {
+ if (empty($easy->options['_err_message']) && (!$easy->errno || $easy->errno == 65)) {
return self::retryFailedRewind($handler, $easy, $ctx);
}
@@ -165,17 +161,29 @@ class CurlFactory implements CurlFactoryInterface
private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface
{
static $connectionErrors = [
- \CURLE_OPERATION_TIMEOUTED => true,
+ \CURLE_OPERATION_TIMEOUTED => true,
\CURLE_COULDNT_RESOLVE_HOST => true,
- \CURLE_COULDNT_CONNECT => true,
- \CURLE_SSL_CONNECT_ERROR => true,
- \CURLE_GOT_NOTHING => true,
+ \CURLE_COULDNT_CONNECT => true,
+ \CURLE_SSL_CONNECT_ERROR => true,
+ \CURLE_GOT_NOTHING => true,
];
+ if ($easy->createResponseException) {
+ return P\Create::rejectionFor(
+ new RequestException(
+ 'An error was encountered while creating the response',
+ $easy->request,
+ $easy->response,
+ $easy->createResponseException,
+ $ctx
+ )
+ );
+ }
+
// If an exception was encountered during the onHeaders event, then
// return a rejected promise that wraps that exception.
if ($easy->onHeadersException) {
- return \GuzzleHttp\Promise\rejection_for(
+ return P\Create::rejectionFor(
new RequestException(
'An error was encountered during the on_headers event',
$easy->request,
@@ -185,21 +193,16 @@ class CurlFactory implements CurlFactoryInterface
)
);
}
- if (\version_compare($ctx[self::CURL_VERSION_STR], self::LOW_CURL_VERSION_NUMBER)) {
- $message = \sprintf(
- 'cURL error %s: %s (%s)',
- $ctx['errno'],
- $ctx['error'],
- 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html'
- );
- } else {
- $message = \sprintf(
- 'cURL error %s: %s (%s) for %s',
- $ctx['errno'],
- $ctx['error'],
- 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html',
- $easy->request->getUri()
- );
+
+ $message = \sprintf(
+ 'cURL error %s: %s (%s)',
+ $ctx['errno'],
+ $ctx['error'],
+ 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html'
+ );
+ $uriString = (string) $easy->request->getUri();
+ if ($uriString !== '' && false === \strpos($ctx['error'], $uriString)) {
+ $message .= \sprintf(' for %s', $uriString);
}
// Create a connection exception if it was a specific error code.
@@ -207,7 +210,7 @@ class CurlFactory implements CurlFactoryInterface
? new ConnectException($message, $easy->request, null, $ctx)
: new RequestException($message, $easy->request, $easy->response, null, $ctx);
- return \GuzzleHttp\Promise\rejection_for($error);
+ return P\Create::rejectionFor($error);
}
/**
@@ -216,12 +219,12 @@ class CurlFactory implements CurlFactoryInterface
private function getDefaultConf(EasyHandle $easy): array
{
$conf = [
- '_headers' => $easy->request->getHeaders(),
- \CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(),
- \CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
+ '_headers' => $easy->request->getHeaders(),
+ \CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(),
+ \CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
\CURLOPT_RETURNTRANSFER => false,
- \CURLOPT_HEADER => false,
- \CURLOPT_CONNECTTIMEOUT => 150,
+ \CURLOPT_HEADER => false,
+ \CURLOPT_CONNECTTIMEOUT => 300,
];
if (\defined('CURLOPT_PROTOCOLS')) {
@@ -247,6 +250,7 @@ class CurlFactory implements CurlFactoryInterface
if ($size === null || $size > 0) {
$this->applyBody($easy->request, $easy->options, $conf);
+
return;
}
@@ -275,9 +279,7 @@ class CurlFactory implements CurlFactoryInterface
// Send the body as a string if the size is less than 1MB OR if the
// [curl][body_as_string] request value is set.
- if (($size !== null && $size < 1000000) ||
- !empty($options['_body_as_string'])
- ) {
+ if (($size !== null && $size < 1000000) || !empty($options['_body_as_string'])) {
$conf[\CURLOPT_POSTFIELDS] = (string) $request->getBody();
// Don't duplicate the Content-Length header
$this->removeHeader('Content-Length', $conf);
@@ -340,6 +342,7 @@ class CurlFactory implements CurlFactoryInterface
foreach (\array_keys($options['_headers']) as $key) {
if (!\strcasecmp($key, $name)) {
unset($options['_headers'][$key]);
+
return;
}
}
@@ -359,9 +362,7 @@ class CurlFactory implements CurlFactoryInterface
if (\is_string($options['verify'])) {
// Throw an error if the file/folder/link path is not valid or doesn't exist.
if (!\file_exists($options['verify'])) {
- throw new \InvalidArgumentException(
- "SSL CA bundle not found: {$options['verify']}"
- );
+ throw new \InvalidArgumentException("SSL CA bundle not found: {$options['verify']}");
}
// If it's a directory or a link to a directory use CURLOPT_CAPATH.
// If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO.
@@ -381,40 +382,38 @@ class CurlFactory implements CurlFactoryInterface
}
}
- if (!empty($options['decode_content'])) {
+ if (!isset($options['curl'][\CURLOPT_ENCODING]) && !empty($options['decode_content'])) {
$accept = $easy->request->getHeaderLine('Accept-Encoding');
if ($accept) {
$conf[\CURLOPT_ENCODING] = $accept;
} else {
+ // The empty string enables all available decoders and implicitly
+ // sets a matching 'Accept-Encoding' header.
$conf[\CURLOPT_ENCODING] = '';
- // Don't let curl send the header over the wire
+ // But as the user did not specify any acceptable encodings we need
+ // to overwrite this implicit header with an empty one.
$conf[\CURLOPT_HTTPHEADER][] = 'Accept-Encoding:';
}
}
- if (isset($options['sink'])) {
- $sink = $options['sink'];
- if (!\is_string($sink)) {
- $sink = \GuzzleHttp\Psr7\stream_for($sink);
- } elseif (!\is_dir(\dirname($sink))) {
- // Ensure that the directory exists before failing in curl.
- throw new \RuntimeException(\sprintf(
- 'Directory %s does not exist for sink value of %s',
- \dirname($sink),
- $sink
- ));
- } else {
- $sink = new LazyOpenStream($sink, 'w+');
- }
- $easy->sink = $sink;
- $conf[\CURLOPT_WRITEFUNCTION] = static function ($ch, $write) use ($sink): int {
- return $sink->write($write);
- };
- } else {
+ if (!isset($options['sink'])) {
// Use a default temp stream if no sink was set.
- $conf[\CURLOPT_FILE] = \fopen('php://temp', 'w+');
- $easy->sink = Psr7\stream_for($conf[\CURLOPT_FILE]);
+ $options['sink'] = \GuzzleHttp\Psr7\Utils::tryFopen('php://temp', 'w+');
}
+ $sink = $options['sink'];
+ if (!\is_string($sink)) {
+ $sink = \GuzzleHttp\Psr7\Utils::streamFor($sink);
+ } elseif (!\is_dir(\dirname($sink))) {
+ // Ensure that the directory exists before failing in curl.
+ throw new \RuntimeException(\sprintf('Directory %s does not exist for sink value of %s', \dirname($sink), $sink));
+ } else {
+ $sink = new LazyOpenStream($sink, 'w+');
+ }
+ $easy->sink = $sink;
+ $conf[\CURLOPT_WRITEFUNCTION] = static function ($ch, $write) use ($sink): int {
+ return $sink->write($write);
+ };
+
$timeoutRequiresNoSignal = false;
if (isset($options['timeout'])) {
$timeoutRequiresNoSignal |= $options['timeout'] < 1;
@@ -446,15 +445,41 @@ class CurlFactory implements CurlFactoryInterface
$scheme = $easy->request->getUri()->getScheme();
if (isset($options['proxy'][$scheme])) {
$host = $easy->request->getUri()->getHost();
- if (!isset($options['proxy']['no']) ||
- !Utils::isHostInNoProxy($host, $options['proxy']['no'])
- ) {
+ if (isset($options['proxy']['no']) && Utils::isHostInNoProxy($host, $options['proxy']['no'])) {
+ unset($conf[\CURLOPT_PROXY]);
+ } else {
$conf[\CURLOPT_PROXY] = $options['proxy'][$scheme];
}
}
}
}
+ if (isset($options['crypto_method'])) {
+ if (\STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method']) {
+ if (!defined('CURL_SSLVERSION_TLSv1_0')) {
+ throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.0 not supported by your version of cURL');
+ }
+ $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_0;
+ } elseif (\STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT === $options['crypto_method']) {
+ if (!defined('CURL_SSLVERSION_TLSv1_1')) {
+ throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.1 not supported by your version of cURL');
+ }
+ $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_1;
+ } elseif (\STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT === $options['crypto_method']) {
+ if (!defined('CURL_SSLVERSION_TLSv1_2')) {
+ throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.2 not supported by your version of cURL');
+ }
+ $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_2;
+ } elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT === $options['crypto_method']) {
+ if (!defined('CURL_SSLVERSION_TLSv1_3')) {
+ throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.3 not supported by your version of cURL');
+ }
+ $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_3;
+ } else {
+ throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided');
+ }
+ }
+
if (isset($options['cert'])) {
$cert = $options['cert'];
if (\is_array($cert)) {
@@ -462,9 +487,13 @@ class CurlFactory implements CurlFactoryInterface
$cert = $cert[0];
}
if (!\file_exists($cert)) {
- throw new \InvalidArgumentException(
- "SSL certificate not found: {$cert}"
- );
+ throw new \InvalidArgumentException("SSL certificate not found: {$cert}");
+ }
+ // OpenSSL (versions 0.9.3 and later) also support "P12" for PKCS#12-encoded files.
+ // see https://curl.se/libcurl/c/CURLOPT_SSLCERTTYPE.html
+ $ext = pathinfo($cert, \PATHINFO_EXTENSION);
+ if (preg_match('#^(der|p12)$#i', $ext)) {
+ $conf[\CURLOPT_SSLCERTTYPE] = strtoupper($ext);
}
$conf[\CURLOPT_SSLCERT] = $cert;
}
@@ -481,9 +510,7 @@ class CurlFactory implements CurlFactoryInterface
$sslKey = $sslKey ?? $options['ssl_key'];
if (!\file_exists($sslKey)) {
- throw new \InvalidArgumentException(
- "SSL private key not found: {$sslKey}"
- );
+ throw new \InvalidArgumentException("SSL private key not found: {$sslKey}");
}
$conf[\CURLOPT_SSLKEY] = $sslKey;
}
@@ -491,18 +518,11 @@ class CurlFactory implements CurlFactoryInterface
if (isset($options['progress'])) {
$progress = $options['progress'];
if (!\is_callable($progress)) {
- throw new \InvalidArgumentException(
- 'progress client option must be callable'
- );
+ throw new \InvalidArgumentException('progress client option must be callable');
}
$conf[\CURLOPT_NOPROGRESS] = false;
- $conf[\CURLOPT_PROGRESSFUNCTION] = static function () use ($progress) {
- $args = \func_get_args();
- // PHP 5.5 pushed the handle onto the start of the args
- if (\is_resource($args[0])) {
- \array_shift($args);
- }
- \call_user_func_array($progress, $args);
+ $conf[\CURLOPT_PROGRESSFUNCTION] = static function ($resource, int $downloadSize, int $downloaded, int $uploadSize, int $uploaded) use ($progress) {
+ $progress($downloadSize, $downloaded, $uploadSize, $uploaded);
};
}
@@ -523,11 +543,8 @@ class CurlFactory implements CurlFactoryInterface
*
* @param callable(RequestInterface, array): PromiseInterface $handler
*/
- private static function retryFailedRewind(
- callable $handler,
- EasyHandle $easy,
- array $ctx
- ): PromiseInterface {
+ private static function retryFailedRewind(callable $handler, EasyHandle $easy, array $ctx): PromiseInterface
+ {
try {
// Only rewind if the body has been read from.
$body = $easy->request->getBody();
@@ -536,9 +553,10 @@ class CurlFactory implements CurlFactoryInterface
}
} catch (\RuntimeException $e) {
$ctx['error'] = 'The connection unexpectedly failed without '
- . 'providing an error. The request would have been retried, '
- . 'but attempting to rewind the request body failed. '
- . 'Exception: ' . $e;
+ .'providing an error. The request would have been retried, '
+ .'but attempting to rewind the request body failed. '
+ .'Exception: '.$e;
+
return self::createRejection($easy, $ctx);
}
@@ -547,14 +565,15 @@ class CurlFactory implements CurlFactoryInterface
$easy->options['_curl_retries'] = 1;
} elseif ($easy->options['_curl_retries'] == 2) {
$ctx['error'] = 'The cURL request was retried 3 times '
- . 'and did not succeed. The most likely reason for the failure '
- . 'is that cURL was unable to rewind the body of the request '
- . 'and subsequent retries resulted in the same error. Turn on '
- . 'the debug option to see what went wrong. See '
- . 'https://bugs.php.net/bug.php?id=47204 for more information.';
+ .'and did not succeed. The most likely reason for the failure '
+ .'is that cURL was unable to rewind the body of the request '
+ .'and subsequent retries resulted in the same error. Turn on '
+ .'the debug option to see what went wrong. See '
+ .'https://bugs.php.net/bug.php?id=47204 for more information.';
+
return self::createRejection($easy, $ctx);
} else {
- $easy->options['_curl_retries']++;
+ ++$easy->options['_curl_retries'];
}
return $handler($easy->request, $easy->options);
@@ -580,7 +599,13 @@ class CurlFactory implements CurlFactoryInterface
$value = \trim($h);
if ($value === '') {
$startingResponse = true;
- $easy->createResponse();
+ try {
+ $easy->createResponse();
+ } catch (\Exception $e) {
+ $easy->createResponseException = $e;
+
+ return -1;
+ }
if ($onHeaders !== null) {
try {
$onHeaders($easy->response);
@@ -588,6 +613,7 @@ class CurlFactory implements CurlFactoryInterface
// Associate the exception with the handle and trigger
// a curl header write error by returning 0.
$easy->onHeadersException = $e;
+
return -1;
}
}
@@ -597,6 +623,7 @@ class CurlFactory implements CurlFactoryInterface
} else {
$easy->headers[] = $value;
}
+
return \strlen($h);
};
}
diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php
index 55bba70..9ad10a9 100644
--- a/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php
+++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php
@@ -11,6 +11,8 @@ use Psr\Http\Message\RequestInterface;
* When using the CurlHandler, custom curl options can be specified as an
* associative array of curl option constants mapping to values in the
* **curl** key of the "client" key of the request.
+ *
+ * @final
*/
class CurlHandler
{
@@ -22,9 +24,9 @@ class CurlHandler
/**
* Accepts an associative array of options:
*
- * - factory: Optional curl factory used to create cURL handles.
+ * - handle_factory: Optional curl factory used to create cURL handles.
*
- * @param array $options Array of options to use with the handler
+ * @param array{handle_factory?: ?CurlFactoryInterface} $options Array of options to use with the handler
*/
public function __construct(array $options = [])
{
diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
index a996d70..f0acde1 100644
--- a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
+++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
@@ -15,8 +15,11 @@ use Psr\Http\Message\RequestInterface;
* associative array of curl option constants mapping to values in the
* **curl** key of the provided request options.
*
- * @property resource $_mh Internal use only. Lazy loaded multi-handle.
+ * @property resource|\CurlMultiHandle $_mh Internal use only. Lazy loaded multi-handle.
+ *
+ * @final
*/
+#[\AllowDynamicProperties]
class CurlMultiHandler
{
/**
@@ -30,9 +33,9 @@ class CurlMultiHandler
private $selectTimeout;
/**
- * @var resource|null the currently executing resource in `curl_multi_exec`.
+ * @var int Will be higher than 0 when `curl_multi_exec` is still running.
*/
- private $active;
+ private $active = 0;
/**
* @var array Request entry handles, indexed by handle id in `addRequest`.
@@ -69,6 +72,7 @@ class CurlMultiHandler
if (isset($options['select_timeout'])) {
$this->selectTimeout = $options['select_timeout'];
} elseif ($selectTimeout = Utils::getenv('GUZZLE_CURL_SELECT_TIMEOUT')) {
+ @trigger_error('Since guzzlehttp/guzzle 7.2.0: Using environment variable GUZZLE_CURL_SELECT_TIMEOUT is deprecated. Use option "select_timeout" instead.', \E_USER_DEPRECATED);
$this->selectTimeout = (int) $selectTimeout;
} else {
$this->selectTimeout = 1;
@@ -80,7 +84,7 @@ class CurlMultiHandler
/**
* @param string $name
*
- * @return resource
+ * @return resource|\CurlMultiHandle
*
* @throws \BadMethodCallException when another field as `_mh` will be gotten
* @throws \RuntimeException when curl can not initialize a multi handle
@@ -152,17 +156,16 @@ class CurlMultiHandler
}
// Step through the task queue which may add additional requests.
- P\queue()->run();
+ P\Utils::queue()->run();
- if ($this->active &&
- \curl_multi_select($this->_mh, $this->selectTimeout) === -1
- ) {
+ if ($this->active && \curl_multi_select($this->_mh, $this->selectTimeout) === -1) {
// Perform a usleep if a select returns -1.
// See: https://bugs.php.net/bug.php?id=61141
\usleep(250);
}
- while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM);
+ while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM) {
+ }
$this->processMessages();
}
@@ -172,7 +175,7 @@ class CurlMultiHandler
*/
public function execute(): void
{
- $queue = P\queue();
+ $queue = P\Utils::queue();
while ($this->handles || !$queue->isEmpty()) {
// If there are no transfers, then sleep for the next delay
@@ -204,6 +207,10 @@ class CurlMultiHandler
*/
private function cancel($id): bool
{
+ if (!is_int($id)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an integer to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
// Cannot cancel if it has been processed.
if (!isset($this->handles[$id])) {
return false;
@@ -220,6 +227,10 @@ class CurlMultiHandler
private function processMessages(): void
{
while ($done = \curl_multi_info_read($this->_mh)) {
+ if ($done['msg'] !== \CURLMSG_DONE) {
+ // if it's not done, then it would be premature to remove the handle. ref https://github.com/guzzle/guzzle/pull/2892#issuecomment-945150216
+ continue;
+ }
$id = (int) $done['handle'];
\curl_multi_remove_handle($this->_mh, $done['handle']);
@@ -232,11 +243,7 @@ class CurlMultiHandler
unset($this->handles[$id], $this->delays[$id]);
$entry['easy']->errno = $done['result'];
$entry['deferred']->resolve(
- CurlFactory::finish(
- $this,
- $entry['easy'],
- $this->factory
- )
+ CurlFactory::finish($this, $entry['easy'], $this->factory)
);
}
}
diff --git a/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php
index 183476e..1bc39f4 100644
--- a/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php
+++ b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php
@@ -16,7 +16,7 @@ use Psr\Http\Message\StreamInterface;
final class EasyHandle
{
/**
- * @var resource cURL resource
+ * @var resource|\CurlHandle cURL resource
*/
public $handle;
@@ -55,31 +55,28 @@ final class EasyHandle
*/
public $onHeadersException;
+ /**
+ * @var \Exception|null Exception during createResponse (if any)
+ */
+ public $createResponseException;
+
/**
* Attach a response to the easy handle based on the received headers.
*
- * @throws \RuntimeException if no headers have been received.
+ * @throws \RuntimeException if no headers have been received or the first
+ * header line is invalid.
*/
public function createResponse(): void
{
- if (empty($this->headers)) {
- throw new \RuntimeException('No headers have been received');
- }
+ [$ver, $status, $reason, $headers] = HeaderProcessor::parseHeaders($this->headers);
- // HTTP-version SP status-code SP reason-phrase
- $startLine = \explode(' ', \array_shift($this->headers), 3);
- $headers = Utils::headersFromLines($this->headers);
$normalizedKeys = Utils::normalizeHeaderKeys($headers);
- if (!empty($this->options['decode_content'])
- && isset($normalizedKeys['content-encoding'])
- ) {
- $headers['x-encoded-content-encoding']
- = $headers[$normalizedKeys['content-encoding']];
+ if (!empty($this->options['decode_content']) && isset($normalizedKeys['content-encoding'])) {
+ $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']];
unset($headers[$normalizedKeys['content-encoding']]);
if (isset($normalizedKeys['content-length'])) {
- $headers['x-encoded-content-length']
- = $headers[$normalizedKeys['content-length']];
+ $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']];
$bodyLength = (int) $this->sink->getSize();
if ($bodyLength) {
@@ -90,15 +87,13 @@ final class EasyHandle
}
}
- $statusCode = (int) $startLine[1];
-
// Attach a response to the easy handle with the parsed headers.
$this->response = new Response(
- $statusCode,
+ $status,
$headers,
$this->sink,
- \substr($startLine[0], 5),
- isset($startLine[2]) ? (string) $startLine[2] : null
+ $ver,
+ $reason
);
}
@@ -111,9 +106,7 @@ final class EasyHandle
*/
public function __get($name)
{
- $msg = $name === 'handle'
- ? 'The EasyHandle has been released'
- : 'Invalid property: ' . $name;
+ $msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: '.$name;
throw new \BadMethodCallException($msg);
}
}
diff --git a/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php b/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php
new file mode 100644
index 0000000..5554b8f
--- /dev/null
+++ b/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php
@@ -0,0 +1,42 @@
+onFulfilled = $onFulfilled;
$this->onRejected = $onRejected;
if ($queue) {
- \call_user_func_array([$this, 'append'], $queue);
+ // array_values included for BC
+ $this->append(...array_values($queue));
}
}
@@ -86,7 +84,7 @@ class MockHandler implements \Countable
}
if (isset($options['delay']) && \is_numeric($options['delay'])) {
- \usleep($options['delay'] * 1000);
+ \usleep((int) $options['delay'] * 1000);
}
$this->lastRequest = $request;
@@ -106,18 +104,18 @@ class MockHandler implements \Countable
}
if (\is_callable($response)) {
- $response = \call_user_func($response, $request, $options);
+ $response = $response($request, $options);
}
$response = $response instanceof \Throwable
- ? \GuzzleHttp\Promise\rejection_for($response)
- : \GuzzleHttp\Promise\promise_for($response);
+ ? P\Create::rejectionFor($response)
+ : P\Create::promiseFor($response);
return $response->then(
function (?ResponseInterface $value) use ($request, $options) {
$this->invokeStats($request, $options, $value);
if ($this->onFulfilled) {
- \call_user_func($this->onFulfilled, $value);
+ ($this->onFulfilled)($value);
}
if ($value !== null && isset($options['sink'])) {
@@ -138,9 +136,10 @@ class MockHandler implements \Countable
function ($reason) use ($request, $options) {
$this->invokeStats($request, $options, null, $reason);
if ($this->onRejected) {
- \call_user_func($this->onRejected, $reason);
+ ($this->onRejected)($reason);
}
- return \GuzzleHttp\Promise\rejection_for($reason);
+
+ return P\Create::rejectionFor($reason);
}
);
}
@@ -161,7 +160,7 @@ class MockHandler implements \Countable
) {
$this->queue[] = $value;
} else {
- throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found ' . Utils::describeType($value));
+ throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found '.Utils::describeType($value));
}
}
}
@@ -207,7 +206,7 @@ class MockHandler implements \Countable
if (isset($options['on_stats'])) {
$transferTime = $options['transfer_time'] ?? 0;
$stats = new TransferStats($request, $response, $transferTime, $reason);
- \call_user_func($options['on_stats'], $stats);
+ ($options['on_stats'])($stats);
}
}
}
diff --git a/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
index c027b7f..f045b52 100644
--- a/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
+++ b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
@@ -8,6 +8,8 @@ use Psr\Http\Message\RequestInterface;
/**
* Provides basic proxies for handlers.
+ *
+ * @final
*/
class Proxy
{
@@ -20,14 +22,10 @@ class Proxy
*
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the composed handler.
*/
- public static function wrapSync(
- callable $default,
- callable $sync
- ): callable {
+ public static function wrapSync(callable $default, callable $sync): callable
+ {
return static function (RequestInterface $request, array $options) use ($default, $sync): PromiseInterface {
- return empty($options[RequestOptions::SYNCHRONOUS])
- ? $default($request, $options)
- : $sync($request, $options);
+ return empty($options[RequestOptions::SYNCHRONOUS]) ? $default($request, $options) : $sync($request, $options);
};
}
@@ -44,14 +42,10 @@ class Proxy
*
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the composed handler.
*/
- public static function wrapStreaming(
- callable $default,
- callable $streaming
- ): callable {
+ public static function wrapStreaming(callable $default, callable $streaming): callable
+ {
return static function (RequestInterface $request, array $options) use ($default, $streaming): PromiseInterface {
- return empty($options['stream'])
- ? $default($request, $options)
- : $streaming($request, $options);
+ return empty($options['stream']) ? $default($request, $options) : $streaming($request, $options);
};
}
}
diff --git a/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
index 9d45b62..61632f5 100644
--- a/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
+++ b/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
@@ -4,6 +4,7 @@ namespace GuzzleHttp\Handler;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Promise as P;
use GuzzleHttp\Promise\FulfilledPromise;
use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\Psr7;
@@ -16,6 +17,8 @@ use Psr\Http\Message\UriInterface;
/**
* HTTP handler that uses PHP's HTTP stream wrapper.
+ *
+ * @final
*/
class StreamHandler
{
@@ -64,7 +67,7 @@ class StreamHandler
if (false !== \strpos($message, 'getaddrinfo') // DNS lookup failed
|| false !== \strpos($message, 'Connection refused')
|| false !== \strpos($message, "couldn't connect to host") // error on HHVM
- || false !== \strpos($message, "connection attempt failed")
+ || false !== \strpos($message, 'connection attempt failed')
) {
$e = new ConnectException($e->getMessage(), $request, $e);
} else {
@@ -72,7 +75,7 @@ class StreamHandler
}
$this->invokeStats($options, $request, $startTime, null, $e);
- return \GuzzleHttp\Promise\rejection_for($e);
+ return P\Create::rejectionFor($e);
}
}
@@ -84,61 +87,57 @@ class StreamHandler
\Throwable $error = null
): void {
if (isset($options['on_stats'])) {
- $stats = new TransferStats(
- $request,
- $response,
- Utils::currentTime() - $startTime,
- $error,
- []
- );
- \call_user_func($options['on_stats'], $stats);
+ $stats = new TransferStats($request, $response, Utils::currentTime() - $startTime, $error, []);
+ ($options['on_stats'])($stats);
}
}
/**
* @param resource $stream
*/
- private function createResponse(
- RequestInterface $request,
- array $options,
- $stream,
- ?float $startTime
- ): PromiseInterface {
+ private function createResponse(RequestInterface $request, array $options, $stream, ?float $startTime): PromiseInterface
+ {
$hdrs = $this->lastHeaders;
$this->lastHeaders = [];
- $parts = \explode(' ', \array_shift($hdrs), 3);
- $ver = \explode('/', $parts[0])[1];
- $status = (int) $parts[1];
- $reason = $parts[2] ?? null;
- $headers = Utils::headersFromLines($hdrs);
+
+ try {
+ [$ver, $status, $reason, $headers] = HeaderProcessor::parseHeaders($hdrs);
+ } catch (\Exception $e) {
+ return P\Create::rejectionFor(
+ new RequestException('An error was encountered while creating the response', $request, null, $e)
+ );
+ }
+
[$stream, $headers] = $this->checkDecode($options, $headers, $stream);
- $stream = Psr7\stream_for($stream);
+ $stream = Psr7\Utils::streamFor($stream);
$sink = $stream;
if (\strcasecmp('HEAD', $request->getMethod())) {
$sink = $this->createSink($stream, $options);
}
- $response = new Psr7\Response($status, $headers, $sink, $ver, $reason);
+ try {
+ $response = new Psr7\Response($status, $headers, $sink, $ver, $reason);
+ } catch (\Exception $e) {
+ return P\Create::rejectionFor(
+ new RequestException('An error was encountered while creating the response', $request, null, $e)
+ );
+ }
if (isset($options['on_headers'])) {
try {
$options['on_headers']($response);
} catch (\Exception $e) {
- $msg = 'An error was encountered during the on_headers event';
- $ex = new RequestException($msg, $request, $response, $e);
- return \GuzzleHttp\Promise\rejection_for($ex);
+ return P\Create::rejectionFor(
+ new RequestException('An error was encountered during the on_headers event', $request, $response, $e)
+ );
}
}
// Do not drain when the request is a HEAD request because they have
// no body.
if ($sink !== $stream) {
- $this->drain(
- $stream,
- $sink,
- $response->getHeaderLine('Content-Length')
- );
+ $this->drain($stream, $sink, $response->getHeaderLine('Content-Length'));
}
$this->invokeStats($options, $request, $startTime, $response, null);
@@ -152,12 +151,9 @@ class StreamHandler
return $stream;
}
- $sink = $options['sink']
- ?? \fopen('php://temp', 'r+');
+ $sink = $options['sink'] ?? Psr7\Utils::tryFopen('php://temp', 'r+');
- return \is_string($sink)
- ? new Psr7\LazyOpenStream($sink, 'w+')
- : Psr7\stream_for($sink);
+ return \is_string($sink) ? new Psr7\LazyOpenStream($sink, 'w+') : Psr7\Utils::streamFor($sink);
}
/**
@@ -171,18 +167,15 @@ class StreamHandler
if (isset($normalizedKeys['content-encoding'])) {
$encoding = $headers[$normalizedKeys['content-encoding']];
if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') {
- $stream = new Psr7\InflateStream(
- Psr7\stream_for($stream)
- );
- $headers['x-encoded-content-encoding']
- = $headers[$normalizedKeys['content-encoding']];
+ $stream = new Psr7\InflateStream(Psr7\Utils::streamFor($stream));
+ $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']];
+
// Remove content-encoding header
unset($headers[$normalizedKeys['content-encoding']]);
+
// Fix content-length header
if (isset($normalizedKeys['content-length'])) {
- $headers['x-encoded-content-length']
- = $headers[$normalizedKeys['content-length']];
-
+ $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']];
$length = (int) $stream->getSize();
if ($length === 0) {
unset($headers[$normalizedKeys['content-length']]);
@@ -205,16 +198,13 @@ class StreamHandler
*
* @throws \RuntimeException when the sink option is invalid.
*/
- private function drain(
- StreamInterface $source,
- StreamInterface $sink,
- string $contentLength
- ): StreamInterface {
+ private function drain(StreamInterface $source, StreamInterface $sink, string $contentLength): StreamInterface
+ {
// If a content-length header is provided, then stop reading once
// that number of bytes has been read. This can prevent infinitely
// reading from a stream when dealing with servers that do not honor
// Connection: Close headers.
- Psr7\copy_to_stream(
+ Psr7\Utils::copyToStream(
$source,
$sink,
(\strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1
@@ -241,20 +231,24 @@ class StreamHandler
\set_error_handler(static function ($_, $msg, $file, $line) use (&$errors): bool {
$errors[] = [
'message' => $msg,
- 'file' => $file,
- 'line' => $line
+ 'file' => $file,
+ 'line' => $line,
];
+
return true;
});
- $resource = $callback();
- \restore_error_handler();
+ try {
+ $resource = $callback();
+ } finally {
+ \restore_error_handler();
+ }
if (!$resource) {
$message = 'Error creating resource: ';
foreach ($errors as $err) {
foreach ($err as $key => $value) {
- $message .= "[$key] $value" . \PHP_EOL;
+ $message .= "[$key] $value".\PHP_EOL;
}
}
throw new \RuntimeException(\trim($message));
@@ -273,6 +267,10 @@ class StreamHandler
$methods = \array_flip(\get_class_methods(__CLASS__));
}
+ if (!\in_array($request->getUri()->getScheme(), ['http', 'https'])) {
+ throw new RequestException(\sprintf("The scheme '%s' is not supported.", $request->getUri()->getScheme()), $request);
+ }
+
// HTTP/1.1 streams using the PHP stream wrapper require a
// Connection: close header
if ($request->getProtocolVersion() == '1.1'
@@ -306,10 +304,7 @@ class StreamHandler
if (!\is_array($options['stream_context'])) {
throw new \InvalidArgumentException('stream_context must be an array');
}
- $context = \array_replace_recursive(
- $context,
- $options['stream_context']
- );
+ $context = \array_replace_recursive($context, $options['stream_context']);
}
// Microsoft NTLM authentication only supported with curl handler
@@ -327,16 +322,11 @@ class StreamHandler
return $this->createResource(
function () use ($uri, &$http_response_header, $contextResource, $context, $options, $request) {
- $resource = \fopen((string) $uri, 'r', false, $contextResource);
- $this->lastHeaders = $http_response_header;
+ $resource = @\fopen((string) $uri, 'r', false, $contextResource);
+ $this->lastHeaders = $http_response_header ?? [];
if (false === $resource) {
- throw new ConnectException(
- sprintf('Connection refused for URI %s', $uri),
- $request,
- null,
- $context
- );
+ throw new ConnectException(sprintf('Connection refused for URI %s', $uri), $request, null, $context);
}
if (isset($options['read_timeout'])) {
@@ -359,28 +349,18 @@ class StreamHandler
if ('v4' === $options['force_ip_resolve']) {
$records = \dns_get_record($uri->getHost(), \DNS_A);
if (false === $records || !isset($records[0]['ip'])) {
- throw new ConnectException(
- \sprintf(
- "Could not resolve IPv4 address for host '%s'",
- $uri->getHost()
- ),
- $request
- );
+ throw new ConnectException(\sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request);
}
+
return $uri->withHost($records[0]['ip']);
}
if ('v6' === $options['force_ip_resolve']) {
$records = \dns_get_record($uri->getHost(), \DNS_AAAA);
if (false === $records || !isset($records[0]['ipv6'])) {
- throw new ConnectException(
- \sprintf(
- "Could not resolve IPv6 address for host '%s'",
- $uri->getHost()
- ),
- $request
- );
+ throw new ConnectException(\sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request);
}
- return $uri->withHost('[' . $records[0]['ipv6'] . ']');
+
+ return $uri->withHost('['.$records[0]['ipv6'].']');
}
}
@@ -398,17 +378,20 @@ class StreamHandler
$context = [
'http' => [
- 'method' => $request->getMethod(),
- 'header' => $headers,
+ 'method' => $request->getMethod(),
+ 'header' => $headers,
'protocol_version' => $request->getProtocolVersion(),
- 'ignore_errors' => true,
- 'follow_location' => 0,
+ 'ignore_errors' => true,
+ 'follow_location' => 0,
+ ],
+ 'ssl' => [
+ 'peer_name' => $request->getUri()->getHost(),
],
];
$body = (string) $request->getBody();
- if (!empty($body)) {
+ if ('' !== $body) {
$context['http']['content'] = $body;
// Prevent the HTTP handler from adding a Content-Type header.
if (!$request->hasHeader('Content-Type')) {
@@ -426,21 +409,60 @@ class StreamHandler
*/
private function add_proxy(RequestInterface $request, array &$options, $value, array &$params): void
{
+ $uri = null;
+
if (!\is_array($value)) {
- $options['http']['proxy'] = $value;
+ $uri = $value;
} else {
$scheme = $request->getUri()->getScheme();
if (isset($value[$scheme])) {
- if (!isset($value['no'])
- || !Utils::isHostInNoProxy(
- $request->getUri()->getHost(),
- $value['no']
- )
- ) {
- $options['http']['proxy'] = $value[$scheme];
+ if (!isset($value['no']) || !Utils::isHostInNoProxy($request->getUri()->getHost(), $value['no'])) {
+ $uri = $value[$scheme];
}
}
}
+
+ if (!$uri) {
+ return;
+ }
+
+ $parsed = $this->parse_proxy($uri);
+ $options['http']['proxy'] = $parsed['proxy'];
+
+ if ($parsed['auth']) {
+ if (!isset($options['http']['header'])) {
+ $options['http']['header'] = [];
+ }
+ $options['http']['header'] .= "\r\nProxy-Authorization: {$parsed['auth']}";
+ }
+ }
+
+ /**
+ * Parses the given proxy URL to make it compatible with the format PHP's stream context expects.
+ */
+ private function parse_proxy(string $url): array
+ {
+ $parsed = \parse_url($url);
+
+ if ($parsed !== false && isset($parsed['scheme']) && $parsed['scheme'] === 'http') {
+ if (isset($parsed['host']) && isset($parsed['port'])) {
+ $auth = null;
+ if (isset($parsed['user']) && isset($parsed['pass'])) {
+ $auth = \base64_encode("{$parsed['user']}:{$parsed['pass']}");
+ }
+
+ return [
+ 'proxy' => "tcp://{$parsed['host']}:{$parsed['port']}",
+ 'auth' => $auth ? "Basic {$auth}" : null,
+ ];
+ }
+ }
+
+ // Return proxy as-is.
+ return [
+ 'proxy' => $url,
+ 'auth' => null,
+ ];
}
/**
@@ -453,6 +475,25 @@ class StreamHandler
}
}
+ /**
+ * @param mixed $value as passed via Request transfer options.
+ */
+ private function add_crypto_method(RequestInterface $request, array &$options, $value, array &$params): void
+ {
+ if (
+ $value === \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT
+ || $value === \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT
+ || $value === \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
+ || (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && $value === \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT)
+ ) {
+ $options['http']['crypto_method'] = $value;
+
+ return;
+ }
+
+ throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided');
+ }
+
/**
* @param mixed $value as passed via Request transfer options.
*/
@@ -501,11 +542,13 @@ class StreamHandler
*/
private function add_progress(RequestInterface $request, array &$options, $value, array &$params): void
{
- $this->addNotification(
+ self::addNotification(
$params,
static function ($code, $a, $b, $c, $transferred, $total) use ($value) {
if ($code == \STREAM_NOTIFY_PROGRESS) {
- $value($total, $transferred, null, null);
+ // The upload progress cannot be determined. Use 0 for cURL compatibility:
+ // https://curl.se/libcurl/c/CURLOPT_PROGRESSFUNCTION.html
+ $value($total, $transferred, 0, 0);
}
}
);
@@ -521,55 +564,51 @@ class StreamHandler
}
static $map = [
- \STREAM_NOTIFY_CONNECT => 'CONNECT',
+ \STREAM_NOTIFY_CONNECT => 'CONNECT',
\STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED',
- \STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT',
- \STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS',
- \STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS',
- \STREAM_NOTIFY_REDIRECTED => 'REDIRECTED',
- \STREAM_NOTIFY_PROGRESS => 'PROGRESS',
- \STREAM_NOTIFY_FAILURE => 'FAILURE',
- \STREAM_NOTIFY_COMPLETED => 'COMPLETED',
- \STREAM_NOTIFY_RESOLVE => 'RESOLVE',
+ \STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT',
+ \STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS',
+ \STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS',
+ \STREAM_NOTIFY_REDIRECTED => 'REDIRECTED',
+ \STREAM_NOTIFY_PROGRESS => 'PROGRESS',
+ \STREAM_NOTIFY_FAILURE => 'FAILURE',
+ \STREAM_NOTIFY_COMPLETED => 'COMPLETED',
+ \STREAM_NOTIFY_RESOLVE => 'RESOLVE',
];
- static $args = ['severity', 'message', 'message_code',
- 'bytes_transferred', 'bytes_max'];
+ static $args = ['severity', 'message', 'message_code', 'bytes_transferred', 'bytes_max'];
$value = Utils::debugResource($value);
- $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment('');
- $this->addNotification(
+ $ident = $request->getMethod().' '.$request->getUri()->withFragment('');
+ self::addNotification(
$params,
- static function () use ($ident, $value, $map, $args): void {
- $passed = \func_get_args();
- $code = \array_shift($passed);
+ static function (int $code, ...$passed) use ($ident, $value, $map, $args): void {
\fprintf($value, '<%s> [%s] ', $ident, $map[$code]);
foreach (\array_filter($passed) as $i => $v) {
- \fwrite($value, $args[$i] . ': "' . $v . '" ');
+ \fwrite($value, $args[$i].': "'.$v.'" ');
}
\fwrite($value, "\n");
}
);
}
- private function addNotification(array &$params, callable $notify): void
+ private static function addNotification(array &$params, callable $notify): void
{
// Wrap the existing function if needed.
if (!isset($params['notification'])) {
$params['notification'] = $notify;
} else {
- $params['notification'] = $this->callArray([
+ $params['notification'] = self::callArray([
$params['notification'],
- $notify
+ $notify,
]);
}
}
- private function callArray(array $functions): callable
+ private static function callArray(array $functions): callable
{
- return static function () use ($functions) {
- $args = \func_get_args();
+ return static function (...$args) use ($functions) {
foreach ($functions as $fn) {
- \call_user_func_array($fn, $args);
+ $fn(...$args);
}
};
}
diff --git a/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/vendor/guzzlehttp/guzzle/src/HandlerStack.php
index 13a3fa0..1ce9c4b 100644
--- a/vendor/guzzlehttp/guzzle/src/HandlerStack.php
+++ b/vendor/guzzlehttp/guzzle/src/HandlerStack.php
@@ -9,11 +9,13 @@ use Psr\Http\Message\ResponseInterface;
/**
* Creates a composed Guzzle handler function by stacking middlewares on top of
* an HTTP handler function.
+ *
+ * @final
*/
class HandlerStack
{
/**
- * @var null|callable(RequestInterface, array): PromiseInterface
+ * @var (callable(RequestInterface, array): PromiseInterface)|null
*/
private $handler;
@@ -23,7 +25,7 @@ class HandlerStack
private $stack = [];
/**
- * @var null|callable(RequestInterface, array): PromiseInterface
+ * @var (callable(RequestInterface, array): PromiseInterface)|null
*/
private $cached;
@@ -38,9 +40,9 @@ class HandlerStack
* The returned handler stack can be passed to a client in the "handler"
* option.
*
- * @param null|callable(RequestInterface, array): PromiseInterface $handler HTTP handler function to use with the stack. If no
- * handler is provided, the best handler for your
- * system will be utilized.
+ * @param (callable(RequestInterface, array): PromiseInterface)|null $handler HTTP handler function to use with the stack. If no
+ * handler is provided, the best handler for your
+ * system will be utilized.
*/
public static function create(?callable $handler = null): self
{
@@ -54,7 +56,7 @@ class HandlerStack
}
/**
- * @param null|callable(RequestInterface, array): PromiseInterface $handler Underlying HTTP handler.
+ * @param (callable(RequestInterface, array): PromiseInterface)|null $handler Underlying HTTP handler.
*/
public function __construct(callable $handler = null)
{
@@ -84,14 +86,14 @@ class HandlerStack
$stack = [];
if ($this->handler !== null) {
- $stack[] = "0) Handler: " . $this->debugCallable($this->handler);
+ $stack[] = '0) Handler: '.$this->debugCallable($this->handler);
}
$result = '';
foreach (\array_reverse($this->stack) as $tuple) {
- $depth++;
+ ++$depth;
$str = "{$depth}) Name: '{$tuple[1]}', ";
- $str .= "Function: " . $this->debugCallable($tuple[0]);
+ $str .= 'Function: '.$this->debugCallable($tuple[0]);
$result = "> {$str}\n{$result}";
$stack[] = $str;
}
@@ -120,7 +122,7 @@ class HandlerStack
*/
public function hasHandler(): bool
{
- return $this->handler !== null ;
+ return $this->handler !== null;
}
/**
@@ -178,6 +180,10 @@ class HandlerStack
*/
public function remove($remove): void
{
+ if (!is_string($remove) && !is_callable($remove)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a callable or string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
$this->cached = null;
$idx = \is_callable($remove) ? 0 : 1;
$this->stack = \array_values(\array_filter(
@@ -249,7 +255,7 @@ class HandlerStack
/**
* Provides a debug string for a given callable.
*
- * @param callable $fn Function to write as a string.
+ * @param callable|string $fn Function to write as a string.
*/
private function debugCallable($fn): string
{
@@ -260,10 +266,10 @@ class HandlerStack
if (\is_array($fn)) {
return \is_string($fn[0])
? "callable({$fn[0]}::{$fn[1]})"
- : "callable(['" . \get_class($fn[0]) . "', '{$fn[1]}'])";
+ : "callable(['".\get_class($fn[0])."', '{$fn[1]}'])";
}
/** @var object $fn */
- return 'callable(' . \spl_object_hash($fn) . ')';
+ return 'callable('.\spl_object_hash($fn).')';
}
}
diff --git a/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php
index 36e3a9c..9b77eee 100644
--- a/vendor/guzzlehttp/guzzle/src/MessageFormatter.php
+++ b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php
@@ -32,17 +32,19 @@ use Psr\Http\Message\ResponseInterface;
* - {res_headers}: Response headers
* - {req_body}: Request body
* - {res_body}: Response body
+ *
+ * @final
*/
-class MessageFormatter
+class MessageFormatter implements MessageFormatterInterface
{
/**
* Apache Common Log Format.
*
- * @link https://httpd.apache.org/docs/2.4/logs.html#common
+ * @see https://httpd.apache.org/docs/2.4/logs.html#common
*
* @var string
*/
- public const CLF = "{hostname} {req_header_User-Agent} - [{date_common_log}] \"{method} {target} HTTP/{version}\" {code} {res_header_Content-Length}";
+ public const CLF = '{hostname} {req_header_User-Agent} - [{date_common_log}] "{method} {target} HTTP/{version}" {code} {res_header_Content-Length}';
public const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}";
public const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}';
@@ -66,11 +68,8 @@ class MessageFormatter
* @param ResponseInterface|null $response Response that was received
* @param \Throwable|null $error Exception that was received
*/
- public function format(
- RequestInterface $request,
- ?ResponseInterface $response = null,
- ?\Throwable $error = null
- ): string {
+ public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string
+ {
$cache = [];
/** @var string */
@@ -84,16 +83,16 @@ class MessageFormatter
$result = '';
switch ($matches[1]) {
case 'request':
- $result = Psr7\str($request);
+ $result = Psr7\Message::toString($request);
break;
case 'response':
- $result = $response ? Psr7\str($response) : '';
+ $result = $response ? Psr7\Message::toString($response) : '';
break;
case 'req_headers':
$result = \trim($request->getMethod()
- . ' ' . $request->getRequestTarget())
- . ' HTTP/' . $request->getProtocolVersion() . "\r\n"
- . $this->headers($request);
+ .' '.$request->getRequestTarget())
+ .' HTTP/'.$request->getProtocolVersion()."\r\n"
+ .$this->headers($request);
break;
case 'res_headers':
$result = $response ?
@@ -102,14 +101,26 @@ class MessageFormatter
$response->getProtocolVersion(),
$response->getStatusCode(),
$response->getReasonPhrase()
- ) . "\r\n" . $this->headers($response)
+ )."\r\n".$this->headers($response)
: 'NULL';
break;
case 'req_body':
- $result = $request->getBody();
+ $result = $request->getBody()->__toString();
break;
case 'res_body':
- $result = $response ? $response->getBody() : 'NULL';
+ if (!$response instanceof ResponseInterface) {
+ $result = 'NULL';
+ break;
+ }
+
+ $body = $response->getBody();
+
+ if (!$body->isSeekable()) {
+ $result = 'RESPONSE_NOT_LOGGEABLE';
+ break;
+ }
+
+ $result = $response->getBody()->__toString();
break;
case 'ts':
case 'date_iso_8601':
@@ -126,7 +137,7 @@ class MessageFormatter
break;
case 'uri':
case 'url':
- $result = $request->getUri();
+ $result = $request->getUri()->__toString();
break;
case 'target':
$result = $request->getRequestTarget();
@@ -166,6 +177,7 @@ class MessageFormatter
}
$cache[$matches[1]] = $result;
+
return $result;
},
$this->template
@@ -179,7 +191,7 @@ class MessageFormatter
{
$result = '';
foreach ($message->getHeaders() as $name => $values) {
- $result .= $name . ': ' . \implode(', ', $values) . "\r\n";
+ $result .= $name.': '.\implode(', ', $values)."\r\n";
}
return \trim($result);
diff --git a/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php b/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php
new file mode 100644
index 0000000..a39ac24
--- /dev/null
+++ b/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php
@@ -0,0 +1,18 @@
+withCookieHeader($request);
+
return $handler($request, $options)
->then(
static function (ResponseInterface $response) use ($cookieJar, $request): ResponseInterface {
$cookieJar->extractCookies($request, $response);
+
return $response;
}
);
@@ -46,24 +49,27 @@ final class Middleware
/**
* Middleware that throws exceptions for 4xx or 5xx responses when the
- * "http_error" request option is set to true.
+ * "http_errors" request option is set to true.
+ *
+ * @param BodySummarizerInterface|null $bodySummarizer The body summarizer to use in exception messages.
*
* @return callable(callable): callable Returns a function that accepts the next handler.
*/
- public static function httpErrors(): callable
+ public static function httpErrors(BodySummarizerInterface $bodySummarizer = null): callable
{
- return static function (callable $handler): callable {
- return static function ($request, array $options) use ($handler) {
+ return static function (callable $handler) use ($bodySummarizer): callable {
+ return static function ($request, array $options) use ($handler, $bodySummarizer) {
if (empty($options['http_errors'])) {
return $handler($request, $options);
}
+
return $handler($request, $options)->then(
- static function (ResponseInterface $response) use ($request) {
+ static function (ResponseInterface $response) use ($request, $bodySummarizer) {
$code = $response->getStatusCode();
if ($code < 400) {
return $response;
}
- throw RequestException::create($request, $response);
+ throw RequestException::create($request, $response, null, [], $bodySummarizer);
}
);
};
@@ -90,21 +96,23 @@ final class Middleware
return $handler($request, $options)->then(
static function ($value) use ($request, &$container, $options) {
$container[] = [
- 'request' => $request,
+ 'request' => $request,
'response' => $value,
- 'error' => null,
- 'options' => $options
+ 'error' => null,
+ 'options' => $options,
];
+
return $value;
},
static function ($reason) use ($request, &$container, $options) {
$container[] = [
- 'request' => $request,
+ 'request' => $request,
'response' => null,
- 'error' => $reason,
- 'options' => $options
+ 'error' => $reason,
+ 'options' => $options,
];
- return \GuzzleHttp\Promise\rejection_for($reason);
+
+ return P\Create::rejectionFor($reason);
}
);
};
@@ -135,6 +143,7 @@ final class Middleware
if ($after) {
$after($request, $options, $response);
}
+
return $response;
};
};
@@ -180,29 +189,34 @@ final class Middleware
*
* @phpstan-param \Psr\Log\LogLevel::* $logLevel Level at which to log requests.
*
- * @param LoggerInterface $logger Logs messages.
- * @param MessageFormatter $formatter Formatter used to create message strings.
- * @param string $logLevel Level at which to log requests.
+ * @param LoggerInterface $logger Logs messages.
+ * @param MessageFormatterInterface|MessageFormatter $formatter Formatter used to create message strings.
+ * @param string $logLevel Level at which to log requests.
*
* @return callable Returns a function that accepts the next handler.
*/
- public static function log(LoggerInterface $logger, MessageFormatter $formatter, string $logLevel = 'info'): callable
+ public static function log(LoggerInterface $logger, $formatter, string $logLevel = 'info'): callable
{
+ // To be compatible with Guzzle 7.1.x we need to allow users to pass a MessageFormatter
+ if (!$formatter instanceof MessageFormatter && !$formatter instanceof MessageFormatterInterface) {
+ throw new \LogicException(sprintf('Argument 2 to %s::log() must be of type %s', self::class, MessageFormatterInterface::class));
+ }
+
return static function (callable $handler) use ($logger, $formatter, $logLevel): callable {
return static function (RequestInterface $request, array $options = []) use ($handler, $logger, $formatter, $logLevel) {
return $handler($request, $options)->then(
static function ($response) use ($logger, $request, $formatter, $logLevel): ResponseInterface {
$message = $formatter->format($request, $response);
$logger->log($logLevel, $message);
+
return $response;
},
static function ($reason) use ($logger, $request, $formatter): PromiseInterface {
- $response = $reason instanceof RequestException
- ? $reason->getResponse()
- : null;
- $message = $formatter->format($request, $response, \GuzzleHttp\Promise\exception_for($reason));
+ $response = $reason instanceof RequestException ? $reason->getResponse() : null;
+ $message = $formatter->format($request, $response, P\Create::exceptionFor($reason));
$logger->error($message);
- return \GuzzleHttp\Promise\rejection_for($reason);
+
+ return P\Create::rejectionFor($reason);
}
);
};
diff --git a/vendor/guzzlehttp/guzzle/src/Pool.php b/vendor/guzzlehttp/guzzle/src/Pool.php
index 66fe029..6277c61 100644
--- a/vendor/guzzlehttp/guzzle/src/Pool.php
+++ b/vendor/guzzlehttp/guzzle/src/Pool.php
@@ -2,6 +2,7 @@
namespace GuzzleHttp;
+use GuzzleHttp\Promise as P;
use GuzzleHttp\Promise\EachPromise;
use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\Promise\PromisorInterface;
@@ -17,6 +18,8 @@ use Psr\Http\Message\RequestInterface;
* When a function is yielded by the iterator, the function is provided the
* "request_options" array that should be merged on top of any existing
* options, and the function MUST then return a wait-able promise.
+ *
+ * @final
*/
class Pool implements PromisorInterface
{
@@ -35,11 +38,8 @@ class Pool implements PromisorInterface
* - fulfilled: (callable) Function to invoke when a request completes.
* - rejected: (callable) Function to invoke when a request is rejected.
*/
- public function __construct(
- ClientInterface $client,
- $requests,
- array $config = []
- ) {
+ public function __construct(ClientInterface $client, $requests, array $config = [])
+ {
if (!isset($config['concurrency'])) {
$config['concurrency'] = 25;
}
@@ -51,7 +51,7 @@ class Pool implements PromisorInterface
$opts = [];
}
- $iterable = \GuzzleHttp\Promise\iter_for($requests);
+ $iterable = P\Create::iterFor($requests);
$requests = static function () use ($iterable, $client, $opts) {
foreach ($iterable as $key => $rfn) {
if ($rfn instanceof RequestInterface) {
@@ -59,10 +59,7 @@ class Pool implements PromisorInterface
} elseif (\is_callable($rfn)) {
yield $key => $rfn($opts);
} else {
- throw new \InvalidArgumentException('Each value yielded by '
- . 'the iterator must be a Psr7\Http\Message\RequestInterface '
- . 'or a callable that returns a promise that fulfills '
- . 'with a Psr7\Message\Http\ResponseInterface object.');
+ throw new \InvalidArgumentException('Each value yielded by the iterator must be a Psr7\Http\Message\RequestInterface or a callable that returns a promise that fulfills with a Psr7\Message\Http\ResponseInterface object.');
}
}
};
@@ -96,11 +93,8 @@ class Pool implements PromisorInterface
*
* @throws \InvalidArgumentException if the event format is incorrect.
*/
- public static function batch(
- ClientInterface $client,
- $requests,
- array $options = []
- ): array {
+ public static function batch(ClientInterface $client, $requests, array $options = []): array
+ {
$res = [];
self::cmpCallback($options, 'fulfilled', $res);
self::cmpCallback($options, 'rejected', $res);
diff --git a/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php
index 28331a0..0a8de81 100644
--- a/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php
+++ b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php
@@ -8,6 +8,8 @@ use Psr\Http\Message\RequestInterface;
/**
* Prepares requests that contain a body, adding the Content-Length,
* Content-Type, and Expect headers.
+ *
+ * @final
*/
class PrepareBodyMiddleware
{
@@ -38,7 +40,7 @@ class PrepareBodyMiddleware
// Add a default content-type if possible.
if (!$request->hasHeader('Content-Type')) {
if ($uri = $request->getBody()->getMetadata('uri')) {
- if ($type = Psr7\mimetype_from_filename($uri)) {
+ if (is_string($uri) && $type = Psr7\MimeType::fromFilename($uri)) {
$modify['set_headers']['Content-Type'] = $type;
}
}
@@ -59,17 +61,14 @@ class PrepareBodyMiddleware
// Add the expect header if needed.
$this->addExpectHeader($request, $options, $modify);
- return $fn(Psr7\modify_request($request, $modify), $options);
+ return $fn(Psr7\Utils::modifyRequest($request, $modify), $options);
}
/**
* Add expect header
*/
- private function addExpectHeader(
- RequestInterface $request,
- array $options,
- array &$modify
- ): void {
+ private function addExpectHeader(RequestInterface $request, array $options, array &$modify): void
+ {
// Determine if the Expect header should be used
if ($request->hasHeader('Expect')) {
return;
@@ -85,6 +84,7 @@ class PrepareBodyMiddleware
// The expect header is unconditionally enabled
if ($expect === true) {
$modify['set_headers']['Expect'] = '100-Continue';
+
return;
}
diff --git a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php
index 09dc7ef..f32808a 100644
--- a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php
+++ b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php
@@ -14,6 +14,8 @@ use Psr\Http\Message\UriInterface;
*
* Apply this middleware like other middleware using
* {@see \GuzzleHttp\Middleware::redirect()}.
+ *
+ * @final
*/
class RedirectMiddleware
{
@@ -25,10 +27,10 @@ class RedirectMiddleware
* @var array
*/
public static $defaultSettings = [
- 'max' => 5,
- 'protocols' => ['http', 'https'],
- 'strict' => false,
- 'referer' => false,
+ 'max' => 5,
+ 'protocols' => ['http', 'https'],
+ 'strict' => false,
+ 'referer' => false,
'track_redirects' => false,
];
@@ -75,23 +77,27 @@ class RedirectMiddleware
/**
* @return ResponseInterface|PromiseInterface
*/
- public function checkRedirect(
- RequestInterface $request,
- array $options,
- ResponseInterface $response
- ) {
+ public function checkRedirect(RequestInterface $request, array $options, ResponseInterface $response)
+ {
if (\strpos((string) $response->getStatusCode(), '3') !== 0
|| !$response->hasHeader('Location')
) {
return $response;
}
- $this->guardMax($request, $options);
+ $this->guardMax($request, $response, $options);
$nextRequest = $this->modifyRequest($request, $options, $response);
+ // If authorization is handled by curl, unset it if URI is cross-origin.
+ if (Psr7\UriComparator::isCrossOrigin($request->getUri(), $nextRequest->getUri()) && defined('\CURLOPT_HTTPAUTH')) {
+ unset(
+ $options['curl'][\CURLOPT_HTTPAUTH],
+ $options['curl'][\CURLOPT_USERPWD]
+ );
+ }
+
if (isset($options['allow_redirects']['on_redirect'])) {
- \call_user_func(
- $options['allow_redirects']['on_redirect'],
+ ($options['allow_redirects']['on_redirect'])(
$request,
$response,
$nextRequest->getUri()
@@ -134,11 +140,11 @@ class RedirectMiddleware
}
/**
- * Check for too many redirects
+ * Check for too many redirects.
*
* @throws TooManyRedirectsException Too many redirects.
*/
- private function guardMax(RequestInterface $request, array &$options): void
+ private function guardMax(RequestInterface $request, ResponseInterface $response, array &$options): void
{
$current = $options['__redirect_count']
?? 0;
@@ -146,18 +152,12 @@ class RedirectMiddleware
$max = $options['allow_redirects']['max'];
if ($options['__redirect_count'] > $max) {
- throw new TooManyRedirectsException(
- "Will not follow more than {$max} redirects",
- $request
- );
+ throw new TooManyRedirectsException("Will not follow more than {$max} redirects", $request, $response);
}
}
- public function modifyRequest(
- RequestInterface $request,
- array $options,
- ResponseInterface $response
- ): RequestInterface {
+ public function modifyRequest(RequestInterface $request, array $options, ResponseInterface $response): RequestInterface
+ {
// Request modifications to apply.
$modify = [];
$protocols = $options['allow_redirects']['protocols'];
@@ -169,18 +169,21 @@ class RedirectMiddleware
if ($statusCode == 303 ||
($statusCode <= 302 && !$options['allow_redirects']['strict'])
) {
- $modify['method'] = 'GET';
+ $safeMethods = ['GET', 'HEAD', 'OPTIONS'];
+ $requestMethod = $request->getMethod();
+
+ $modify['method'] = in_array($requestMethod, $safeMethods) ? $requestMethod : 'GET';
$modify['body'] = '';
}
- $uri = $this->redirectUri($request, $response, $protocols);
+ $uri = self::redirectUri($request, $response, $protocols);
if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) {
$idnOptions = ($options['idn_conversion'] === true) ? \IDNA_DEFAULT : $options['idn_conversion'];
$uri = Utils::idnUriConvert($uri, $idnOptions);
}
$modify['uri'] = $uri;
- Psr7\rewind_body($request);
+ Psr7\Message::rewindBody($request);
// Add the Referer header if it is told to do so and only
// add the header if we are not redirecting from https to http.
@@ -193,18 +196,19 @@ class RedirectMiddleware
$modify['remove_headers'][] = 'Referer';
}
- // Remove Authorization header if host is different.
- if ($request->getUri()->getHost() !== $modify['uri']->getHost()) {
+ // Remove Authorization and Cookie headers if URI is cross-origin.
+ if (Psr7\UriComparator::isCrossOrigin($request->getUri(), $modify['uri'])) {
$modify['remove_headers'][] = 'Authorization';
+ $modify['remove_headers'][] = 'Cookie';
}
- return Psr7\modify_request($request, $modify);
+ return Psr7\Utils::modifyRequest($request, $modify);
}
/**
- * Set the appropriate URL on the request based on the location header
+ * Set the appropriate URL on the request based on the location header.
*/
- private function redirectUri(
+ private static function redirectUri(
RequestInterface $request,
ResponseInterface $response,
array $protocols
@@ -216,15 +220,7 @@ class RedirectMiddleware
// Ensure that the redirect URI is allowed based on the protocols.
if (!\in_array($location->getScheme(), $protocols)) {
- throw new BadResponseException(
- \sprintf(
- 'Redirect URI, %s, does not use one of the allowed redirect protocols: %s',
- $location,
- \implode(', ', $protocols)
- ),
- $request,
- $response
- );
+ throw new BadResponseException(\sprintf('Redirect URI, %s, does not use one of the allowed redirect protocols: %s', $location, \implode(', ', $protocols)), $request, $response);
}
return $location;
diff --git a/vendor/guzzlehttp/guzzle/src/RequestOptions.php b/vendor/guzzlehttp/guzzle/src/RequestOptions.php
index 20b31bc..bf3b02b 100644
--- a/vendor/guzzlehttp/guzzle/src/RequestOptions.php
+++ b/vendor/guzzlehttp/guzzle/src/RequestOptions.php
@@ -7,7 +7,7 @@ namespace GuzzleHttp;
*
* More documentation for each option can be found at http://guzzlephp.org/.
*
- * @link http://docs.guzzlephp.org/en/v6/request-options.html
+ * @see http://docs.guzzlephp.org/en/v6/request-options.html
*/
final class RequestOptions
{
@@ -70,10 +70,22 @@ final class RequestOptions
/**
* connect_timeout: (float, default=0) Float describing the number of
* seconds to wait while trying to connect to a server. Use 0 to wait
- * indefinitely (the default behavior).
+ * 300 seconds (the default behavior).
*/
public const CONNECT_TIMEOUT = 'connect_timeout';
+ /**
+ * crypto_method: (int) A value describing the minimum TLS protocol
+ * version to use.
+ *
+ * This setting must be set to one of the
+ * ``STREAM_CRYPTO_METHOD_TLS*_CLIENT`` constants. PHP 7.4 or higher is
+ * required in order to use TLS 1.3, and cURL 7.34.0 or higher is required
+ * in order to specify a crypto method, with cURL 7.52.0 or higher being
+ * required to use TLS 1.3.
+ */
+ public const CRYPTO_METHOD = 'crypto_method';
+
/**
* debug: (bool|resource) Set to true or set to a PHP stream returned by
* fopen() enable debug output with the HTTP handler used to send a
diff --git a/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php b/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php
index 187eca6..8f4d93a 100644
--- a/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php
+++ b/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php
@@ -2,6 +2,7 @@
namespace GuzzleHttp;
+use GuzzleHttp\Promise as P;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
@@ -9,6 +10,8 @@ use Psr\Http\Message\ResponseInterface;
/**
* Middleware that retries requests based on the boolean result of
* invoking the provided "decider" function.
+ *
+ * @final
*/
class RetryMiddleware
{
@@ -33,18 +36,15 @@ class RetryMiddleware
* returns true if the request is to be
* retried.
* @param callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke.
- * @param null|callable(int): int $delay Function that accepts the number of retries
+ * @param (callable(int): int)|null $delay Function that accepts the number of retries
* and returns the number of
* milliseconds to delay.
*/
- public function __construct(
- callable $decider,
- callable $nextHandler,
- callable $delay = null
- ) {
+ public function __construct(callable $decider, callable $nextHandler, callable $delay = null)
+ {
$this->decider = $decider;
$this->nextHandler = $nextHandler;
- $this->delay = $delay ?: __CLASS__ . '::exponentialDelay';
+ $this->delay = $delay ?: __CLASS__.'::exponentialDelay';
}
/**
@@ -54,7 +54,7 @@ class RetryMiddleware
*/
public static function exponentialDelay(int $retries): int
{
- return (int) \pow(2, $retries - 1) * 1000;
+ return (int) 2 ** ($retries - 1) * 1000;
}
public function __invoke(RequestInterface $request, array $options): PromiseInterface
@@ -64,6 +64,7 @@ class RetryMiddleware
}
$fn = $this->nextHandler;
+
return $fn($request, $options)
->then(
$this->onFulfilled($request, $options),
@@ -77,8 +78,7 @@ class RetryMiddleware
private function onFulfilled(RequestInterface $request, array $options): callable
{
return function ($value) use ($request, $options) {
- if (!\call_user_func(
- $this->decider,
+ if (!($this->decider)(
$options['retries'],
$request,
$value,
@@ -86,6 +86,7 @@ class RetryMiddleware
)) {
return $value;
}
+
return $this->doRetry($request, $options, $value);
};
}
@@ -96,22 +97,22 @@ class RetryMiddleware
private function onRejected(RequestInterface $req, array $options): callable
{
return function ($reason) use ($req, $options) {
- if (!\call_user_func(
- $this->decider,
+ if (!($this->decider)(
$options['retries'],
$req,
null,
$reason
)) {
- return \GuzzleHttp\Promise\rejection_for($reason);
+ return P\Create::rejectionFor($reason);
}
+
return $this->doRetry($req, $options);
};
}
private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null): PromiseInterface
{
- $options['delay'] = \call_user_func($this->delay, ++$options['retries'], $response);
+ $options['delay'] = ($this->delay)(++$options['retries'], $response, $request);
return $this($request, $options);
}
diff --git a/vendor/guzzlehttp/guzzle/src/TransferStats.php b/vendor/guzzlehttp/guzzle/src/TransferStats.php
index f15e816..93fa334 100644
--- a/vendor/guzzlehttp/guzzle/src/TransferStats.php
+++ b/vendor/guzzlehttp/guzzle/src/TransferStats.php
@@ -128,8 +128,6 @@ final class TransferStats
*/
public function getHandlerStat(string $stat)
{
- return isset($this->handlerStats[$stat])
- ? $this->handlerStats[$stat]
- : null;
+ return $this->handlerStats[$stat] ?? null;
}
}
diff --git a/vendor/guzzlehttp/guzzle/src/Utils.php b/vendor/guzzlehttp/guzzle/src/Utils.php
index 5a0f8a8..fcf571d 100644
--- a/vendor/guzzlehttp/guzzle/src/Utils.php
+++ b/vendor/guzzlehttp/guzzle/src/Utils.php
@@ -23,9 +23,9 @@ final class Utils
{
switch (\gettype($input)) {
case 'object':
- return 'object(' . \get_class($input) . ')';
+ return 'object('.\get_class($input).')';
case 'array':
- return 'array(' . \count($input) . ')';
+ return 'array('.\count($input).')';
default:
\ob_start();
\var_dump($input);
@@ -49,9 +49,7 @@ final class Utils
foreach ($lines as $line) {
$parts = \explode(':', $line, 2);
- $headers[\trim($parts[0])][] = isset($parts[1])
- ? \trim($parts[1])
- : null;
+ $headers[\trim($parts[0])][] = isset($parts[1]) ? \trim($parts[1]) : null;
}
return $headers;
@@ -73,12 +71,7 @@ final class Utils
return \STDOUT;
}
- $resource = \fopen('php://output', 'w');
- if (false === $resource) {
- throw new \RuntimeException('Can not open php output for writing to debug the resource.');
- }
-
- return $resource;
+ return \GuzzleHttp\Psr7\Utils::tryFopen('php://output', 'w');
}
/**
@@ -86,19 +79,22 @@ final class Utils
*
* The returned handler is not wrapped by any default middlewares.
*
- * @throws \RuntimeException if no viable Handler is available.
- *
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
+ *
+ * @throws \RuntimeException if no viable Handler is available.
*/
public static function chooseHandler(): callable
{
$handler = null;
- if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) {
- $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());
- } elseif (\function_exists('curl_exec')) {
- $handler = new CurlHandler();
- } elseif (\function_exists('curl_multi_exec')) {
- $handler = new CurlMultiHandler();
+
+ if (\defined('CURLOPT_CUSTOMREQUEST')) {
+ if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) {
+ $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());
+ } elseif (\function_exists('curl_exec')) {
+ $handler = new CurlHandler();
+ } elseif (\function_exists('curl_multi_exec')) {
+ $handler = new CurlMultiHandler();
+ }
}
if (\ini_get('allow_url_fopen')) {
@@ -106,8 +102,7 @@ final class Utils
? Proxy::wrapStreaming($handler, new StreamHandler())
: new StreamHandler();
} elseif (!$handler) {
- throw new \RuntimeException('GuzzleHttp requires cURL, the '
- . 'allow_url_fopen ini setting, or a custom HTTP handler.');
+ throw new \RuntimeException('GuzzleHttp requires cURL, the allow_url_fopen ini setting, or a custom HTTP handler.');
}
return $handler;
@@ -133,6 +128,8 @@ final class Utils
* Note: the result of this function is cached for subsequent calls.
*
* @throws \RuntimeException if no bundle can be found.
+ *
+ * @deprecated Utils::defaultCaBundle will be removed in guzzlehttp/guzzle:8.0. This method is not needed in PHP 5.6+.
*/
public static function defaultCaBundle(): string
{
@@ -231,27 +228,27 @@ EOT
}
// Strip port if present.
- if (\strpos($host, ':')) {
- /** @var string[] $hostParts will never be false because of the checks above */
- $hostParts = \explode($host, ':', 2);
- $host = $hostParts[0];
- }
+ [$host] = \explode(':', $host, 2);
foreach ($noProxyArray as $area) {
// Always match on wildcards.
if ($area === '*') {
return true;
- } elseif (empty($area)) {
+ }
+
+ if (empty($area)) {
// Don't match on empty values.
continue;
- } elseif ($area === $host) {
+ }
+
+ if ($area === $host) {
// Exact matches.
return true;
}
// Special match if the area when prefixed with ".". Remove any
// existing leading "." and add a new leading ".".
- $area = '.' . \ltrim($area, '.');
- if (\substr($host, -(\strlen($area))) === $area) {
+ $area = '.'.\ltrim($area, '.');
+ if (\substr($host, -\strlen($area)) === $area) {
return true;
}
}
@@ -272,15 +269,13 @@ EOT
*
* @throws InvalidArgumentException if the JSON cannot be decoded.
*
- * @link https://www.php.net/manual/en/function.json-decode.php
+ * @see https://www.php.net/manual/en/function.json-decode.php
*/
public static function jsonDecode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
{
$data = \json_decode($json, $assoc, $depth, $options);
if (\JSON_ERROR_NONE !== \json_last_error()) {
- throw new InvalidArgumentException(
- 'json_decode error: ' . \json_last_error_msg()
- );
+ throw new InvalidArgumentException('json_decode error: '.\json_last_error_msg());
}
return $data;
@@ -295,15 +290,13 @@ EOT
*
* @throws InvalidArgumentException if the JSON cannot be encoded.
*
- * @link https://www.php.net/manual/en/function.json-encode.php
+ * @see https://www.php.net/manual/en/function.json-encode.php
*/
public static function jsonEncode($value, int $options = 0, int $depth = 512): string
{
$json = \json_encode($value, $options, $depth);
if (\JSON_ERROR_NONE !== \json_last_error()) {
- throw new InvalidArgumentException(
- 'json_encode error: ' . \json_last_error_msg()
- );
+ throw new InvalidArgumentException('json_encode error: '.\json_last_error_msg());
}
/** @var string */
@@ -335,7 +328,7 @@ EOT
if ($asciiHost === false) {
$errorBitSet = $info['errors'] ?? 0;
- $errorConstants = array_filter(array_keys(get_defined_constants()), static function ($name) {
+ $errorConstants = array_filter(array_keys(get_defined_constants()), static function (string $name): bool {
return substr($name, 0, 11) === 'IDNA_ERROR_';
});
@@ -348,7 +341,7 @@ EOT
$errorMessage = 'IDN conversion failed';
if ($errors) {
- $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')';
+ $errorMessage .= ' (errors: '.implode(', ', $errors).')';
}
throw new InvalidArgumentException($errorMessage);
diff --git a/vendor/guzzlehttp/guzzle/src/functions.php b/vendor/guzzlehttp/guzzle/src/functions.php
index 74e3bd2..5edc66a 100644
--- a/vendor/guzzlehttp/guzzle/src/functions.php
+++ b/vendor/guzzlehttp/guzzle/src/functions.php
@@ -10,6 +10,8 @@ namespace GuzzleHttp;
*
* @return string Returns a string containing the type of the variable and
* if a class is provided, the class name.
+ *
+ * @deprecated describe_type will be removed in guzzlehttp/guzzle:8.0. Use Utils::describeType instead.
*/
function describe_type($input): string
{
@@ -21,6 +23,8 @@ function describe_type($input): string
*
* @param iterable $lines Header lines array of strings in the following
* format: "Name: Value"
+ *
+ * @deprecated headers_from_lines will be removed in guzzlehttp/guzzle:8.0. Use Utils::headersFromLines instead.
*/
function headers_from_lines(iterable $lines): array
{
@@ -33,6 +37,8 @@ function headers_from_lines(iterable $lines): array
* @param mixed $value Optional value
*
* @return resource
+ *
+ * @deprecated debug_resource will be removed in guzzlehttp/guzzle:8.0. Use Utils::debugResource instead.
*/
function debug_resource($value = null)
{
@@ -44,9 +50,11 @@ function debug_resource($value = null)
*
* The returned handler is not wrapped by any default middlewares.
*
+ * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
+ *
* @throws \RuntimeException if no viable Handler is available.
*
- * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
+ * @deprecated choose_handler will be removed in guzzlehttp/guzzle:8.0. Use Utils::chooseHandler instead.
*/
function choose_handler(): callable
{
@@ -55,6 +63,8 @@ function choose_handler(): callable
/**
* Get the default User-Agent string to use with Guzzle.
+ *
+ * @deprecated default_user_agent will be removed in guzzlehttp/guzzle:8.0. Use Utils::defaultUserAgent instead.
*/
function default_user_agent(): string
{
@@ -73,6 +83,8 @@ function default_user_agent(): string
* Note: the result of this function is cached for subsequent calls.
*
* @throws \RuntimeException if no bundle can be found.
+ *
+ * @deprecated default_ca_bundle will be removed in guzzlehttp/guzzle:8.0. This function is not needed in PHP 5.6+.
*/
function default_ca_bundle(): string
{
@@ -82,6 +94,8 @@ function default_ca_bundle(): string
/**
* Creates an associative array of lowercase header names to the actual
* header casing.
+ *
+ * @deprecated normalize_header_keys will be removed in guzzlehttp/guzzle:8.0. Use Utils::normalizeHeaderKeys instead.
*/
function normalize_header_keys(array $headers): array
{
@@ -106,6 +120,8 @@ function normalize_header_keys(array $headers): array
* @param string[] $noProxyArray An array of host patterns.
*
* @throws Exception\InvalidArgumentException
+ *
+ * @deprecated is_host_in_noproxy will be removed in guzzlehttp/guzzle:8.0. Use Utils::isHostInNoProxy instead.
*/
function is_host_in_noproxy(string $host, array $noProxyArray): bool
{
@@ -125,7 +141,8 @@ function is_host_in_noproxy(string $host, array $noProxyArray): bool
*
* @throws Exception\InvalidArgumentException if the JSON cannot be decoded.
*
- * @link https://www.php.net/manual/en/function.json-decode.php
+ * @see https://www.php.net/manual/en/function.json-decode.php
+ * @deprecated json_decode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonDecode instead.
*/
function json_decode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
{
@@ -141,7 +158,8 @@ function json_decode(string $json, bool $assoc = false, int $depth = 512, int $o
*
* @throws Exception\InvalidArgumentException if the JSON cannot be encoded.
*
- * @link https://www.php.net/manual/en/function.json-encode.php
+ * @see https://www.php.net/manual/en/function.json-encode.php
+ * @deprecated json_encode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonEncode instead.
*/
function json_encode($value, int $options = 0, int $depth = 512): string
{
diff --git a/vendor/guzzlehttp/guzzle/src/functions_include.php b/vendor/guzzlehttp/guzzle/src/functions_include.php
index f17a3c2..394f953 100644
--- a/vendor/guzzlehttp/guzzle/src/functions_include.php
+++ b/vendor/guzzlehttp/guzzle/src/functions_include.php
@@ -1,6 +1,6 @@
=5.5,<8.3 |
+| 2.x | Latest | >=7.2.5,<8.3 |
+
+
## Quick Start
A *promise* represents the eventual result of an asynchronous operation. The
@@ -430,8 +445,6 @@ $loop = React\EventLoop\Factory::create();
$loop->addPeriodicTimer(0, [$queue, 'run']);
```
-*TODO*: Perhaps adding a `futureTick()` on each tick would be faster?
-
## Implementation Notes
@@ -501,8 +514,8 @@ $promise->resolve('foo');
A static API was first introduced in 1.4.0, in order to mitigate problems with
functions conflicting between global and local copies of the package. The
-function API will be removed in 2.0.0. A migration table has been provided here
-for your convenience:
+function API was removed in 2.0.0. A migration table has been provided here for
+your convenience:
| Original Function | Replacement Method |
|----------------|----------------|
diff --git a/vendor/guzzlehttp/promises/composer.json b/vendor/guzzlehttp/promises/composer.json
index 966e3e3..fc1989e 100644
--- a/vendor/guzzlehttp/promises/composer.json
+++ b/vendor/guzzlehttp/promises/composer.json
@@ -26,27 +26,32 @@
}
],
"require": {
- "php": ">=5.5"
+ "php": "^7.2.5 || ^8.0"
},
"require-dev": {
- "symfony/phpunit-bridge": "^4.4 || ^5.1"
+ "bamarni/composer-bin-plugin": "^1.8.1",
+ "phpunit/phpunit": "^8.5.29 || ^9.5.23"
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Promise\\": "src/"
- },
- "files": ["src/functions_include.php"]
+ }
},
"autoload-dev": {
"psr-4": {
"GuzzleHttp\\Promise\\Tests\\": "tests/"
}
},
- "scripts": {
- "test": "vendor/bin/simple-phpunit",
- "test-ci": "vendor/bin/simple-phpunit --coverage-text"
+ "extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ }
},
"config": {
+ "allow-plugins": {
+ "bamarni/composer-bin-plugin": true
+ },
"preferred-install": "dist",
"sort-packages": true
}
diff --git a/vendor/guzzlehttp/promises/src/AggregateException.php b/vendor/guzzlehttp/promises/src/AggregateException.php
index d2b5712..40ffdbc 100644
--- a/vendor/guzzlehttp/promises/src/AggregateException.php
+++ b/vendor/guzzlehttp/promises/src/AggregateException.php
@@ -1,5 +1,7 @@
generator = $generatorFn();
- $this->result = new Promise(function () {
+ $this->result = new Promise(function (): void {
while (isset($this->currentPromise)) {
$this->currentPromise->wait();
}
});
try {
$this->nextCoroutine($this->generator->current());
- } catch (\Exception $exception) {
- $this->result->reject($exception);
} catch (Throwable $throwable) {
$this->result->reject($throwable);
}
@@ -78,10 +77,8 @@ final class Coroutine implements PromiseInterface
/**
* Create a new coroutine.
- *
- * @return self
*/
- public static function of(callable $generatorFn)
+ public static function of(callable $generatorFn): self
{
return new self($generatorFn);
}
@@ -89,42 +86,42 @@ final class Coroutine implements PromiseInterface
public function then(
callable $onFulfilled = null,
callable $onRejected = null
- ) {
+ ): PromiseInterface {
return $this->result->then($onFulfilled, $onRejected);
}
- public function otherwise(callable $onRejected)
+ public function otherwise(callable $onRejected): PromiseInterface
{
return $this->result->otherwise($onRejected);
}
- public function wait($unwrap = true)
+ public function wait(bool $unwrap = true)
{
return $this->result->wait($unwrap);
}
- public function getState()
+ public function getState(): string
{
return $this->result->getState();
}
- public function resolve($value)
+ public function resolve($value): void
{
$this->result->resolve($value);
}
- public function reject($reason)
+ public function reject($reason): void
{
$this->result->reject($reason);
}
- public function cancel()
+ public function cancel(): void
{
$this->currentPromise->cancel();
$this->result->cancel();
}
- private function nextCoroutine($yielded)
+ private function nextCoroutine($yielded): void
{
$this->currentPromise = Create::promiseFor($yielded)
->then([$this, '_handleSuccess'], [$this, '_handleFailure']);
@@ -133,7 +130,7 @@ final class Coroutine implements PromiseInterface
/**
* @internal
*/
- public function _handleSuccess($value)
+ public function _handleSuccess($value): void
{
unset($this->currentPromise);
try {
@@ -143,8 +140,6 @@ final class Coroutine implements PromiseInterface
} else {
$this->result->resolve($value);
}
- } catch (Exception $exception) {
- $this->result->reject($exception);
} catch (Throwable $throwable) {
$this->result->reject($throwable);
}
@@ -153,15 +148,13 @@ final class Coroutine implements PromiseInterface
/**
* @internal
*/
- public function _handleFailure($reason)
+ public function _handleFailure($reason): void
{
unset($this->currentPromise);
try {
$nextYield = $this->generator->throw(Create::exceptionFor($reason));
// The throw was caught, so keep iterating on the coroutine
$this->nextCoroutine($nextYield);
- } catch (Exception $exception) {
- $this->result->reject($exception);
} catch (Throwable $throwable) {
$this->result->reject($throwable);
}
diff --git a/vendor/guzzlehttp/promises/src/Create.php b/vendor/guzzlehttp/promises/src/Create.php
index 8d038e9..9d3fc4a 100644
--- a/vendor/guzzlehttp/promises/src/Create.php
+++ b/vendor/guzzlehttp/promises/src/Create.php
@@ -1,5 +1,7 @@
then([$promise, 'resolve'], [$promise, 'reject']);
+
return $promise;
}
@@ -34,10 +35,8 @@ final class Create
* If the provided reason is a promise, then it is returned as-is.
*
* @param mixed $reason Promise or reason.
- *
- * @return PromiseInterface
*/
- public static function rejectionFor($reason)
+ public static function rejectionFor($reason): PromiseInterface
{
if ($reason instanceof PromiseInterface) {
return $reason;
@@ -50,12 +49,10 @@ final class Create
* Create an exception for a rejected promise value.
*
* @param mixed $reason
- *
- * @return \Exception|\Throwable
*/
- public static function exceptionFor($reason)
+ public static function exceptionFor($reason): \Throwable
{
- if ($reason instanceof \Exception || $reason instanceof \Throwable) {
+ if ($reason instanceof \Throwable) {
return $reason;
}
@@ -66,10 +63,8 @@ final class Create
* Returns an iterator for the given value.
*
* @param mixed $value
- *
- * @return \Iterator
*/
- public static function iterFor($value)
+ public static function iterFor($value): \Iterator
{
if ($value instanceof \Iterator) {
return $value;
diff --git a/vendor/guzzlehttp/promises/src/Each.php b/vendor/guzzlehttp/promises/src/Each.php
index ff8efd7..1a7aa0f 100644
--- a/vendor/guzzlehttp/promises/src/Each.php
+++ b/vendor/guzzlehttp/promises/src/Each.php
@@ -1,5 +1,7 @@
$onFulfilled,
- 'rejected' => $onRejected
+ 'rejected' => $onRejected,
]))->promise();
}
@@ -46,19 +46,17 @@ final class Each
* @param int|callable $concurrency
* @param callable $onFulfilled
* @param callable $onRejected
- *
- * @return PromiseInterface
*/
public static function ofLimit(
$iterable,
$concurrency,
callable $onFulfilled = null,
callable $onRejected = null
- ) {
+ ): PromiseInterface {
return (new EachPromise($iterable, [
- 'fulfilled' => $onFulfilled,
- 'rejected' => $onRejected,
- 'concurrency' => $concurrency
+ 'fulfilled' => $onFulfilled,
+ 'rejected' => $onRejected,
+ 'concurrency' => $concurrency,
]))->promise();
}
@@ -70,19 +68,17 @@ final class Each
* @param mixed $iterable
* @param int|callable $concurrency
* @param callable $onFulfilled
- *
- * @return PromiseInterface
*/
public static function ofLimitAll(
$iterable,
$concurrency,
callable $onFulfilled = null
- ) {
+ ): PromiseInterface {
return self::ofLimit(
$iterable,
$concurrency,
$onFulfilled,
- function ($reason, $idx, PromiseInterface $aggregate) {
+ function ($reason, $idx, PromiseInterface $aggregate): void {
$aggregate->reject($reason);
}
);
diff --git a/vendor/guzzlehttp/promises/src/EachPromise.php b/vendor/guzzlehttp/promises/src/EachPromise.php
index 280d799..28dd979 100644
--- a/vendor/guzzlehttp/promises/src/EachPromise.php
+++ b/vendor/guzzlehttp/promises/src/EachPromise.php
@@ -1,10 +1,14 @@
aggregate) {
return $this->aggregate;
@@ -82,21 +86,18 @@ class EachPromise implements PromisorInterface
$this->refillPending();
} catch (\Throwable $e) {
$this->aggregate->reject($e);
- } catch (\Exception $e) {
- $this->aggregate->reject($e);
}
/**
* @psalm-suppress NullableReturnStatement
- * @phpstan-ignore-next-line
*/
return $this->aggregate;
}
- private function createPromise()
+ private function createPromise(): void
{
$this->mutex = false;
- $this->aggregate = new Promise(function () {
+ $this->aggregate = new Promise(function (): void {
if ($this->checkIfFinished()) {
return;
}
@@ -113,7 +114,7 @@ class EachPromise implements PromisorInterface
});
// Clear the references when the promise is resolved.
- $clearFn = function () {
+ $clearFn = function (): void {
$this->iterable = $this->concurrency = $this->pending = null;
$this->onFulfilled = $this->onRejected = null;
$this->nextPendingIndex = 0;
@@ -122,11 +123,13 @@ class EachPromise implements PromisorInterface
$this->aggregate->then($clearFn, $clearFn);
}
- private function refillPending()
+ private function refillPending(): void
{
if (!$this->concurrency) {
// Add all pending promises.
- while ($this->addPending() && $this->advanceIterator());
+ while ($this->addPending() && $this->advanceIterator()) {
+ }
+
return;
}
@@ -147,10 +150,11 @@ class EachPromise implements PromisorInterface
// next value to yield until promise callbacks are called.
while (--$concurrency
&& $this->advanceIterator()
- && $this->addPending());
+ && $this->addPending()) {
+ }
}
- private function addPending()
+ private function addPending(): bool
{
if (!$this->iterable || !$this->iterable->valid()) {
return false;
@@ -164,7 +168,7 @@ class EachPromise implements PromisorInterface
$idx = $this->nextPendingIndex++;
$this->pending[$idx] = $promise->then(
- function ($value) use ($idx, $key) {
+ function ($value) use ($idx, $key): void {
if ($this->onFulfilled) {
call_user_func(
$this->onFulfilled,
@@ -175,7 +179,7 @@ class EachPromise implements PromisorInterface
}
$this->step($idx);
},
- function ($reason) use ($idx, $key) {
+ function ($reason) use ($idx, $key): void {
if ($this->onRejected) {
call_user_func(
$this->onRejected,
@@ -191,7 +195,7 @@ class EachPromise implements PromisorInterface
return true;
}
- private function advanceIterator()
+ private function advanceIterator(): bool
{
// Place a lock on the iterator so that we ensure to not recurse,
// preventing fatal generator errors.
@@ -204,19 +208,17 @@ class EachPromise implements PromisorInterface
try {
$this->iterable->next();
$this->mutex = false;
+
return true;
} catch (\Throwable $e) {
$this->aggregate->reject($e);
$this->mutex = false;
- return false;
- } catch (\Exception $e) {
- $this->aggregate->reject($e);
- $this->mutex = false;
+
return false;
}
}
- private function step($idx)
+ private function step(int $idx): void
{
// If the promise was already resolved, then ignore this step.
if (Is::settled($this->aggregate)) {
@@ -234,11 +236,12 @@ class EachPromise implements PromisorInterface
}
}
- private function checkIfFinished()
+ private function checkIfFinished(): bool
{
if (!$this->pending && !$this->iterable->valid()) {
// Resolve the promise if there's nothing left to do.
$this->aggregate->resolve(null);
+
return true;
}
diff --git a/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/vendor/guzzlehttp/promises/src/FulfilledPromise.php
index 98f72a6..ab71296 100644
--- a/vendor/guzzlehttp/promises/src/FulfilledPromise.php
+++ b/vendor/guzzlehttp/promises/src/FulfilledPromise.php
@@ -1,5 +1,7 @@
value;
- $queue->add(static function () use ($p, $value, $onFulfilled) {
+ $queue->add(static function () use ($p, $value, $onFulfilled): void {
if (Is::pending($p)) {
try {
$p->resolve($onFulfilled($value));
} catch (\Throwable $e) {
$p->reject($e);
- } catch (\Exception $e) {
- $p->reject($e);
}
}
});
@@ -50,34 +55,34 @@ class FulfilledPromise implements PromiseInterface
return $p;
}
- public function otherwise(callable $onRejected)
+ public function otherwise(callable $onRejected): PromiseInterface
{
return $this->then(null, $onRejected);
}
- public function wait($unwrap = true, $defaultDelivery = null)
+ public function wait(bool $unwrap = true)
{
return $unwrap ? $this->value : null;
}
- public function getState()
+ public function getState(): string
{
return self::FULFILLED;
}
- public function resolve($value)
+ public function resolve($value): void
{
if ($value !== $this->value) {
- throw new \LogicException("Cannot resolve a fulfilled promise");
+ throw new \LogicException('Cannot resolve a fulfilled promise');
}
}
- public function reject($reason)
+ public function reject($reason): void
{
- throw new \LogicException("Cannot reject a fulfilled promise");
+ throw new \LogicException('Cannot reject a fulfilled promise');
}
- public function cancel()
+ public function cancel(): void
{
// pass
}
diff --git a/vendor/guzzlehttp/promises/src/Is.php b/vendor/guzzlehttp/promises/src/Is.php
index c3ed8d0..f3f0503 100644
--- a/vendor/guzzlehttp/promises/src/Is.php
+++ b/vendor/guzzlehttp/promises/src/Is.php
@@ -1,45 +1,39 @@
getState() === PromiseInterface::PENDING;
}
/**
* Returns true if a promise is fulfilled or rejected.
- *
- * @return bool
*/
- public static function settled(PromiseInterface $promise)
+ public static function settled(PromiseInterface $promise): bool
{
return $promise->getState() !== PromiseInterface::PENDING;
}
/**
* Returns true if a promise is fulfilled.
- *
- * @return bool
*/
- public static function fulfilled(PromiseInterface $promise)
+ public static function fulfilled(PromiseInterface $promise): bool
{
return $promise->getState() === PromiseInterface::FULFILLED;
}
/**
* Returns true if a promise is rejected.
- *
- * @return bool
*/
- public static function rejected(PromiseInterface $promise)
+ public static function rejected(PromiseInterface $promise): bool
{
return $promise->getState() === PromiseInterface::REJECTED;
}
diff --git a/vendor/guzzlehttp/promises/src/Promise.php b/vendor/guzzlehttp/promises/src/Promise.php
index 7593905..1b07bdc 100644
--- a/vendor/guzzlehttp/promises/src/Promise.php
+++ b/vendor/guzzlehttp/promises/src/Promise.php
@@ -1,11 +1,15 @@
state === self::PENDING) {
$p = new Promise(null, [$this, 'cancel']);
$this->handlers[] = [$p, $onFulfilled, $onRejected];
$p->waitList = $this->waitList;
$p->waitList[] = $this;
+
return $p;
}
// Return a fulfilled promise and immediately invoke any callbacks.
if ($this->state === self::FULFILLED) {
$promise = Create::promiseFor($this->result);
+
return $onFulfilled ? $promise->then($onFulfilled) : $promise;
}
// It's either cancelled or rejected, so return a rejected promise
// and immediately invoke any callbacks.
$rejection = Create::rejectionFor($this->result);
+
return $onRejected ? $rejection->then(null, $onRejected) : $rejection;
}
- public function otherwise(callable $onRejected)
+ public function otherwise(callable $onRejected): PromiseInterface
{
return $this->then(null, $onRejected);
}
- public function wait($unwrap = true)
+ public function wait(bool $unwrap = true)
{
$this->waitIfPending();
@@ -73,12 +80,12 @@ class Promise implements PromiseInterface
}
}
- public function getState()
+ public function getState(): string
{
return $this->state;
}
- public function cancel()
+ public function cancel(): void
{
if ($this->state !== self::PENDING) {
return;
@@ -93,8 +100,6 @@ class Promise implements PromiseInterface
$fn();
} catch (\Throwable $e) {
$this->reject($e);
- } catch (\Exception $e) {
- $this->reject($e);
}
}
@@ -105,17 +110,17 @@ class Promise implements PromiseInterface
}
}
- public function resolve($value)
+ public function resolve($value): void
{
$this->settle(self::FULFILLED, $value);
}
- public function reject($reason)
+ public function reject($reason): void
{
$this->settle(self::REJECTED, $reason);
}
- private function settle($state, $value)
+ private function settle(string $state, $value): void
{
if ($this->state !== self::PENDING) {
// Ignore calls with the same resolution.
@@ -148,7 +153,7 @@ class Promise implements PromiseInterface
if (!is_object($value) || !method_exists($value, 'then')) {
$id = $state === self::FULFILLED ? 1 : 2;
// It's a success, so resolve the handlers in the queue.
- Utils::queue()->add(static function () use ($id, $value, $handlers) {
+ Utils::queue()->add(static function () use ($id, $value, $handlers): void {
foreach ($handlers as $handler) {
self::callHandler($id, $value, $handler);
}
@@ -159,12 +164,12 @@ class Promise implements PromiseInterface
} else {
// Resolve the handlers when the forwarded promise is resolved.
$value->then(
- static function ($value) use ($handlers) {
+ static function ($value) use ($handlers): void {
foreach ($handlers as $handler) {
self::callHandler(1, $value, $handler);
}
},
- static function ($reason) use ($handlers) {
+ static function ($reason) use ($handlers): void {
foreach ($handlers as $handler) {
self::callHandler(2, $reason, $handler);
}
@@ -180,7 +185,7 @@ class Promise implements PromiseInterface
* @param mixed $value Value to pass to the callback.
* @param array $handler Array of handler data (promise and callbacks).
*/
- private static function callHandler($index, $value, array $handler)
+ private static function callHandler(int $index, $value, array $handler): void
{
/** @var PromiseInterface $promise */
$promise = $handler[0];
@@ -211,12 +216,10 @@ class Promise implements PromiseInterface
}
} catch (\Throwable $reason) {
$promise->reject($reason);
- } catch (\Exception $reason) {
- $promise->reject($reason);
}
}
- private function waitIfPending()
+ private function waitIfPending(): void
{
if ($this->state !== self::PENDING) {
return;
@@ -227,9 +230,9 @@ class Promise implements PromiseInterface
} else {
// If there's no wait function, then reject the promise.
$this->reject('Cannot wait on a promise that has '
- . 'no internal wait function. You must provide a wait '
- . 'function when constructing the promise to be able to '
- . 'wait on a promise.');
+ .'no internal wait function. You must provide a wait '
+ .'function when constructing the promise to be able to '
+ .'wait on a promise.');
}
Utils::queue()->run();
@@ -240,13 +243,13 @@ class Promise implements PromiseInterface
}
}
- private function invokeWaitFn()
+ private function invokeWaitFn(): void
{
try {
$wfn = $this->waitFn;
$this->waitFn = null;
$wfn(true);
- } catch (\Exception $reason) {
+ } catch (\Throwable $reason) {
if ($this->state === self::PENDING) {
// The promise has not been resolved yet, so reject the promise
// with the exception.
@@ -259,7 +262,7 @@ class Promise implements PromiseInterface
}
}
- private function invokeWaitList()
+ private function invokeWaitList(): void
{
$waitList = $this->waitList;
$this->waitList = null;
diff --git a/vendor/guzzlehttp/promises/src/PromiseInterface.php b/vendor/guzzlehttp/promises/src/PromiseInterface.php
index e598331..2824802 100644
--- a/vendor/guzzlehttp/promises/src/PromiseInterface.php
+++ b/vendor/guzzlehttp/promises/src/PromiseInterface.php
@@ -1,5 +1,7 @@
reason;
$p = new Promise([$queue, 'run']);
- $queue->add(static function () use ($p, $reason, $onRejected) {
+ $queue->add(static function () use ($p, $reason, $onRejected): void {
if (Is::pending($p)) {
try {
// Return a resolved promise if onRejected does not throw.
@@ -43,9 +50,6 @@ class RejectedPromise implements PromiseInterface
} catch (\Throwable $e) {
// onRejected threw, so return a rejected promise.
$p->reject($e);
- } catch (\Exception $e) {
- // onRejected threw, so return a rejected promise.
- $p->reject($e);
}
}
});
@@ -53,12 +57,12 @@ class RejectedPromise implements PromiseInterface
return $p;
}
- public function otherwise(callable $onRejected)
+ public function otherwise(callable $onRejected): PromiseInterface
{
return $this->then(null, $onRejected);
}
- public function wait($unwrap = true, $defaultDelivery = null)
+ public function wait(bool $unwrap = true)
{
if ($unwrap) {
throw Create::exceptionFor($this->reason);
@@ -67,24 +71,24 @@ class RejectedPromise implements PromiseInterface
return null;
}
- public function getState()
+ public function getState(): string
{
return self::REJECTED;
}
- public function resolve($value)
+ public function resolve($value): void
{
- throw new \LogicException("Cannot resolve a rejected promise");
+ throw new \LogicException('Cannot resolve a rejected promise');
}
- public function reject($reason)
+ public function reject($reason): void
{
if ($reason !== $this->reason) {
- throw new \LogicException("Cannot reject a rejected promise");
+ throw new \LogicException('Cannot reject a rejected promise');
}
}
- public function cancel()
+ public function cancel(): void
{
// pass
}
diff --git a/vendor/guzzlehttp/promises/src/RejectionException.php b/vendor/guzzlehttp/promises/src/RejectionException.php
index e2f1377..0db98ff 100644
--- a/vendor/guzzlehttp/promises/src/RejectionException.php
+++ b/vendor/guzzlehttp/promises/src/RejectionException.php
@@ -1,5 +1,7 @@
reason;
+ $message .= ' with reason: '.$this->reason;
} elseif ($reason instanceof \JsonSerializable) {
- $message .= ' with reason: '
- . json_encode($this->reason, JSON_PRETTY_PRINT);
+ $message .= ' with reason: '.json_encode($this->reason, JSON_PRETTY_PRINT);
}
parent::__construct($message);
diff --git a/vendor/guzzlehttp/promises/src/TaskQueue.php b/vendor/guzzlehttp/promises/src/TaskQueue.php
index f0fba2c..503e0b2 100644
--- a/vendor/guzzlehttp/promises/src/TaskQueue.php
+++ b/vendor/guzzlehttp/promises/src/TaskQueue.php
@@ -1,5 +1,7 @@
run();
+ *
+ * @final
*/
class TaskQueue implements TaskQueueInterface
{
private $enableShutdown = true;
private $queue = [];
- public function __construct($withShutdown = true)
+ public function __construct(bool $withShutdown = true)
{
if ($withShutdown) {
- register_shutdown_function(function () {
+ register_shutdown_function(function (): void {
if ($this->enableShutdown) {
// Only run the tasks if an E_ERROR didn't occur.
$err = error_get_last();
@@ -31,17 +35,17 @@ class TaskQueue implements TaskQueueInterface
}
}
- public function isEmpty()
+ public function isEmpty(): bool
{
return !$this->queue;
}
- public function add(callable $task)
+ public function add(callable $task): void
{
$this->queue[] = $task;
}
- public function run()
+ public function run(): void
{
while ($task = array_shift($this->queue)) {
/** @var callable $task */
@@ -60,7 +64,7 @@ class TaskQueue implements TaskQueueInterface
*
* Note: This shutdown will occur before any destructors are triggered.
*/
- public function disableShutdown()
+ public function disableShutdown(): void
{
$this->enableShutdown = false;
}
diff --git a/vendor/guzzlehttp/promises/src/TaskQueueInterface.php b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php
index 723d4d5..34c561a 100644
--- a/vendor/guzzlehttp/promises/src/TaskQueueInterface.php
+++ b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php
@@ -1,24 +1,24 @@
*
- * @param TaskQueueInterface $assign Optionally specify a new queue instance.
- *
- * @return TaskQueueInterface
+ * @param TaskQueueInterface|null $assign Optionally specify a new queue instance.
*/
- public static function queue(TaskQueueInterface $assign = null)
+ public static function queue(TaskQueueInterface $assign = null): TaskQueueInterface
{
static $queue;
@@ -39,22 +39,18 @@ final class Utils
* returns a promise that is fulfilled or rejected with the result.
*
* @param callable $task Task function to run.
- *
- * @return PromiseInterface
*/
- public static function task(callable $task)
+ public static function task(callable $task): PromiseInterface
{
$queue = self::queue();
$promise = new Promise([$queue, 'run']);
- $queue->add(function () use ($task, $promise) {
+ $queue->add(function () use ($task, $promise): void {
try {
if (Is::pending($promise)) {
$promise->resolve($task());
}
} catch (\Throwable $e) {
$promise->reject($e);
- } catch (\Exception $e) {
- $promise->reject($e);
}
});
@@ -72,22 +68,18 @@ final class Utils
* key mapping to the rejection reason of the promise.
*
* @param PromiseInterface $promise Promise or value.
- *
- * @return array
*/
- public static function inspect(PromiseInterface $promise)
+ public static function inspect(PromiseInterface $promise): array
{
try {
return [
'state' => PromiseInterface::FULFILLED,
- 'value' => $promise->wait()
+ 'value' => $promise->wait(),
];
} catch (RejectionException $e) {
return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()];
} catch (\Throwable $e) {
return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
- } catch (\Exception $e) {
- return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
}
}
@@ -100,10 +92,8 @@ final class Utils
* @see inspect for the inspection state array format.
*
* @param PromiseInterface[] $promises Traversable of promises to wait upon.
- *
- * @return array
*/
- public static function inspectAll($promises)
+ public static function inspectAll($promises): array
{
$results = [];
foreach ($promises as $key => $promise) {
@@ -122,12 +112,9 @@ final class Utils
*
* @param iterable $promises Iterable of PromiseInterface objects to wait on.
*
- * @return array
- *
- * @throws \Exception on error
- * @throws \Throwable on error in PHP >=7
+ * @throws \Throwable on error
*/
- public static function unwrap($promises)
+ public static function unwrap($promises): array
{
$results = [];
foreach ($promises as $key => $promise) {
@@ -147,22 +134,21 @@ final class Utils
*
* @param mixed $promises Promises or values.
* @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution.
- *
- * @return PromiseInterface
*/
- public static function all($promises, $recursive = false)
+ public static function all($promises, bool $recursive = false): PromiseInterface
{
$results = [];
$promise = Each::of(
$promises,
- function ($value, $idx) use (&$results) {
+ function ($value, $idx) use (&$results): void {
$results[$idx] = $value;
},
- function ($reason, $idx, Promise $aggregate) {
+ function ($reason, $idx, Promise $aggregate): void {
$aggregate->reject($reason);
}
)->then(function () use (&$results) {
ksort($results);
+
return $results;
});
@@ -173,6 +159,7 @@ final class Utils
return self::all($promises, $recursive);
}
}
+
return $results;
});
}
@@ -193,17 +180,15 @@ final class Utils
*
* @param int $count Total number of promises.
* @param mixed $promises Promises or values.
- *
- * @return PromiseInterface
*/
- public static function some($count, $promises)
+ public static function some(int $count, $promises): PromiseInterface
{
$results = [];
$rejections = [];
return Each::of(
$promises,
- function ($value, $idx, PromiseInterface $p) use (&$results, $count) {
+ function ($value, $idx, PromiseInterface $p) use (&$results, $count): void {
if (Is::settled($p)) {
return;
}
@@ -212,7 +197,7 @@ final class Utils
$p->resolve(null);
}
},
- function ($reason) use (&$rejections) {
+ function ($reason) use (&$rejections): void {
$rejections[] = $reason;
}
)->then(
@@ -224,6 +209,7 @@ final class Utils
);
}
ksort($results);
+
return array_values($results);
}
);
@@ -234,10 +220,8 @@ final class Utils
* fulfillment value is not an array of 1 but the value directly.
*
* @param mixed $promises Promises or values.
- *
- * @return PromiseInterface
*/
- public static function any($promises)
+ public static function any($promises): PromiseInterface
{
return self::some(1, $promises)->then(function ($values) {
return $values[0];
@@ -253,23 +237,22 @@ final class Utils
* @see inspect for the inspection state array format.
*
* @param mixed $promises Promises or values.
- *
- * @return PromiseInterface
*/
- public static function settle($promises)
+ public static function settle($promises): PromiseInterface
{
$results = [];
return Each::of(
$promises,
- function ($value, $idx) use (&$results) {
+ function ($value, $idx) use (&$results): void {
$results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value];
},
- function ($reason, $idx) use (&$results) {
+ function ($reason, $idx) use (&$results): void {
$results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason];
}
)->then(function () use (&$results) {
ksort($results);
+
return $results;
});
}
diff --git a/vendor/guzzlehttp/promises/src/functions.php b/vendor/guzzlehttp/promises/src/functions.php
deleted file mode 100644
index c03d39d..0000000
--- a/vendor/guzzlehttp/promises/src/functions.php
+++ /dev/null
@@ -1,363 +0,0 @@
-
- * while ($eventLoop->isRunning()) {
- * GuzzleHttp\Promise\queue()->run();
- * }
- *
- *
- * @param TaskQueueInterface $assign Optionally specify a new queue instance.
- *
- * @return TaskQueueInterface
- *
- * @deprecated queue will be removed in guzzlehttp/promises:2.0. Use Utils::queue instead.
- */
-function queue(TaskQueueInterface $assign = null)
-{
- return Utils::queue($assign);
-}
-
-/**
- * Adds a function to run in the task queue when it is next `run()` and returns
- * a promise that is fulfilled or rejected with the result.
- *
- * @param callable $task Task function to run.
- *
- * @return PromiseInterface
- *
- * @deprecated task will be removed in guzzlehttp/promises:2.0. Use Utils::task instead.
- */
-function task(callable $task)
-{
- return Utils::task($task);
-}
-
-/**
- * Creates a promise for a value if the value is not a promise.
- *
- * @param mixed $value Promise or value.
- *
- * @return PromiseInterface
- *
- * @deprecated promise_for will be removed in guzzlehttp/promises:2.0. Use Create::promiseFor instead.
- */
-function promise_for($value)
-{
- return Create::promiseFor($value);
-}
-
-/**
- * Creates a rejected promise for a reason if the reason is not a promise. If
- * the provided reason is a promise, then it is returned as-is.
- *
- * @param mixed $reason Promise or reason.
- *
- * @return PromiseInterface
- *
- * @deprecated rejection_for will be removed in guzzlehttp/promises:2.0. Use Create::rejectionFor instead.
- */
-function rejection_for($reason)
-{
- return Create::rejectionFor($reason);
-}
-
-/**
- * Create an exception for a rejected promise value.
- *
- * @param mixed $reason
- *
- * @return \Exception|\Throwable
- *
- * @deprecated exception_for will be removed in guzzlehttp/promises:2.0. Use Create::exceptionFor instead.
- */
-function exception_for($reason)
-{
- return Create::exceptionFor($reason);
-}
-
-/**
- * Returns an iterator for the given value.
- *
- * @param mixed $value
- *
- * @return \Iterator
- *
- * @deprecated iter_for will be removed in guzzlehttp/promises:2.0. Use Create::iterFor instead.
- */
-function iter_for($value)
-{
- return Create::iterFor($value);
-}
-
-/**
- * Synchronously waits on a promise to resolve and returns an inspection state
- * array.
- *
- * Returns a state associative array containing a "state" key mapping to a
- * valid promise state. If the state of the promise is "fulfilled", the array
- * will contain a "value" key mapping to the fulfilled value of the promise. If
- * the promise is rejected, the array will contain a "reason" key mapping to
- * the rejection reason of the promise.
- *
- * @param PromiseInterface $promise Promise or value.
- *
- * @return array
- *
- * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspect instead.
- */
-function inspect(PromiseInterface $promise)
-{
- return Utils::inspect($promise);
-}
-
-/**
- * Waits on all of the provided promises, but does not unwrap rejected promises
- * as thrown exception.
- *
- * Returns an array of inspection state arrays.
- *
- * @see inspect for the inspection state array format.
- *
- * @param PromiseInterface[] $promises Traversable of promises to wait upon.
- *
- * @return array
- *
- * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspectAll instead.
- */
-function inspect_all($promises)
-{
- return Utils::inspectAll($promises);
-}
-
-/**
- * Waits on all of the provided promises and returns the fulfilled values.
- *
- * Returns an array that contains the value of each promise (in the same order
- * the promises were provided). An exception is thrown if any of the promises
- * are rejected.
- *
- * @param iterable $promises Iterable of PromiseInterface objects to wait on.
- *
- * @return array
- *
- * @throws \Exception on error
- * @throws \Throwable on error in PHP >=7
- *
- * @deprecated unwrap will be removed in guzzlehttp/promises:2.0. Use Utils::unwrap instead.
- */
-function unwrap($promises)
-{
- return Utils::unwrap($promises);
-}
-
-/**
- * Given an array of promises, return a promise that is fulfilled when all the
- * items in the array are fulfilled.
- *
- * The promise's fulfillment value is an array with fulfillment values at
- * respective positions to the original array. If any promise in the array
- * rejects, the returned promise is rejected with the rejection reason.
- *
- * @param mixed $promises Promises or values.
- * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution.
- *
- * @return PromiseInterface
- *
- * @deprecated all will be removed in guzzlehttp/promises:2.0. Use Utils::all instead.
- */
-function all($promises, $recursive = false)
-{
- return Utils::all($promises, $recursive);
-}
-
-/**
- * Initiate a competitive race between multiple promises or values (values will
- * become immediately fulfilled promises).
- *
- * When count amount of promises have been fulfilled, the returned promise is
- * fulfilled with an array that contains the fulfillment values of the winners
- * in order of resolution.
- *
- * This promise is rejected with a {@see AggregateException} if the number of
- * fulfilled promises is less than the desired $count.
- *
- * @param int $count Total number of promises.
- * @param mixed $promises Promises or values.
- *
- * @return PromiseInterface
- *
- * @deprecated some will be removed in guzzlehttp/promises:2.0. Use Utils::some instead.
- */
-function some($count, $promises)
-{
- return Utils::some($count, $promises);
-}
-
-/**
- * Like some(), with 1 as count. However, if the promise fulfills, the
- * fulfillment value is not an array of 1 but the value directly.
- *
- * @param mixed $promises Promises or values.
- *
- * @return PromiseInterface
- *
- * @deprecated any will be removed in guzzlehttp/promises:2.0. Use Utils::any instead.
- */
-function any($promises)
-{
- return Utils::any($promises);
-}
-
-/**
- * Returns a promise that is fulfilled when all of the provided promises have
- * been fulfilled or rejected.
- *
- * The returned promise is fulfilled with an array of inspection state arrays.
- *
- * @see inspect for the inspection state array format.
- *
- * @param mixed $promises Promises or values.
- *
- * @return PromiseInterface
- *
- * @deprecated settle will be removed in guzzlehttp/promises:2.0. Use Utils::settle instead.
- */
-function settle($promises)
-{
- return Utils::settle($promises);
-}
-
-/**
- * Given an iterator that yields promises or values, returns a promise that is
- * fulfilled with a null value when the iterator has been consumed or the
- * aggregate promise has been fulfilled or rejected.
- *
- * $onFulfilled is a function that accepts the fulfilled value, iterator index,
- * and the aggregate promise. The callback can invoke any necessary side
- * effects and choose to resolve or reject the aggregate if needed.
- *
- * $onRejected is a function that accepts the rejection reason, iterator index,
- * and the aggregate promise. The callback can invoke any necessary side
- * effects and choose to resolve or reject the aggregate if needed.
- *
- * @param mixed $iterable Iterator or array to iterate over.
- * @param callable $onFulfilled
- * @param callable $onRejected
- *
- * @return PromiseInterface
- *
- * @deprecated each will be removed in guzzlehttp/promises:2.0. Use Each::of instead.
- */
-function each(
- $iterable,
- callable $onFulfilled = null,
- callable $onRejected = null
-) {
- return Each::of($iterable, $onFulfilled, $onRejected);
-}
-
-/**
- * Like each, but only allows a certain number of outstanding promises at any
- * given time.
- *
- * $concurrency may be an integer or a function that accepts the number of
- * pending promises and returns a numeric concurrency limit value to allow for
- * dynamic a concurrency size.
- *
- * @param mixed $iterable
- * @param int|callable $concurrency
- * @param callable $onFulfilled
- * @param callable $onRejected
- *
- * @return PromiseInterface
- *
- * @deprecated each_limit will be removed in guzzlehttp/promises:2.0. Use Each::ofLimit instead.
- */
-function each_limit(
- $iterable,
- $concurrency,
- callable $onFulfilled = null,
- callable $onRejected = null
-) {
- return Each::ofLimit($iterable, $concurrency, $onFulfilled, $onRejected);
-}
-
-/**
- * Like each_limit, but ensures that no promise in the given $iterable argument
- * is rejected. If any promise is rejected, then the aggregate promise is
- * rejected with the encountered rejection.
- *
- * @param mixed $iterable
- * @param int|callable $concurrency
- * @param callable $onFulfilled
- *
- * @return PromiseInterface
- *
- * @deprecated each_limit_all will be removed in guzzlehttp/promises:2.0. Use Each::ofLimitAll instead.
- */
-function each_limit_all(
- $iterable,
- $concurrency,
- callable $onFulfilled = null
-) {
- return Each::ofLimitAll($iterable, $concurrency, $onFulfilled);
-}
-
-/**
- * Returns true if a promise is fulfilled.
- *
- * @return bool
- *
- * @deprecated is_fulfilled will be removed in guzzlehttp/promises:2.0. Use Is::fulfilled instead.
- */
-function is_fulfilled(PromiseInterface $promise)
-{
- return Is::fulfilled($promise);
-}
-
-/**
- * Returns true if a promise is rejected.
- *
- * @return bool
- *
- * @deprecated is_rejected will be removed in guzzlehttp/promises:2.0. Use Is::rejected instead.
- */
-function is_rejected(PromiseInterface $promise)
-{
- return Is::rejected($promise);
-}
-
-/**
- * Returns true if a promise is fulfilled or rejected.
- *
- * @return bool
- *
- * @deprecated is_settled will be removed in guzzlehttp/promises:2.0. Use Is::settled instead.
- */
-function is_settled(PromiseInterface $promise)
-{
- return Is::settled($promise);
-}
-
-/**
- * Create a new coroutine.
- *
- * @see Coroutine
- *
- * @return PromiseInterface
- *
- * @deprecated coroutine will be removed in guzzlehttp/promises:2.0. Use Coroutine::of instead.
- */
-function coroutine(callable $generatorFn)
-{
- return Coroutine::of($generatorFn);
-}
diff --git a/vendor/guzzlehttp/promises/src/functions_include.php b/vendor/guzzlehttp/promises/src/functions_include.php
deleted file mode 100644
index 34cd171..0000000
--- a/vendor/guzzlehttp/promises/src/functions_include.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
- This issue has been automatically marked as stale because it has not had
- recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you
- for your contributions.
-# Comment to post when closing a stale issue. Set to `false` to disable
-closeComment: false
diff --git a/vendor/guzzlehttp/psr7/.github/workflows/ci.yml b/vendor/guzzlehttp/psr7/.github/workflows/ci.yml
deleted file mode 100644
index 0850470..0000000
--- a/vendor/guzzlehttp/psr7/.github/workflows/ci.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-name: CI
-
-on:
- pull_request:
-
-jobs:
- build:
- name: Build
- runs-on: ubuntu-22.04
- strategy:
- max-parallel: 10
- matrix:
- php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
-
- steps:
- - name: Set up PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: ${{ matrix.php }}
- coverage: 'none'
- extensions: mbstring
-
- - name: Checkout code
- uses: actions/checkout@v3
-
- - name: Install dependencies
- run: composer update --no-interaction --no-progress
-
- - name: Run tests
- run: make test
diff --git a/vendor/guzzlehttp/psr7/.github/workflows/integration.yml b/vendor/guzzlehttp/psr7/.github/workflows/integration.yml
deleted file mode 100644
index a55a256..0000000
--- a/vendor/guzzlehttp/psr7/.github/workflows/integration.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-name: Integration
-
-on:
- pull_request:
-
-jobs:
- build:
- name: Test
- runs-on: ubuntu-22.04
- strategy:
- max-parallel: 10
- matrix:
- php: ['7.2', '7.3', '7.4', '8.0', '8.1']
-
- steps:
- - name: Set up PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: ${{ matrix.php }}
- coverage: none
-
- - name: Checkout code
- uses: actions/checkout@v3
-
- - name: Download dependencies
- uses: ramsey/composer-install@v1
- with:
- composer-options: --no-interaction --optimize-autoloader
-
- - name: Start server
- run: php -S 127.0.0.1:10002 tests/Integration/server.php &
-
- - name: Run tests
- env:
- TEST_SERVER: 127.0.0.1:10002
- run: ./vendor/bin/phpunit --testsuite Integration
diff --git a/vendor/guzzlehttp/psr7/.github/workflows/static.yml b/vendor/guzzlehttp/psr7/.github/workflows/static.yml
deleted file mode 100644
index f00351b..0000000
--- a/vendor/guzzlehttp/psr7/.github/workflows/static.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-name: Static analysis
-
-on:
- pull_request:
-
-jobs:
- php-cs-fixer:
- name: PHP-CS-Fixer
- runs-on: ubuntu-22.04
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v3
-
- - name: Setup PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: '7.4'
- coverage: none
- extensions: mbstring
-
- - name: Download dependencies
- run: composer update --no-interaction --no-progress
-
- - name: Download PHP CS Fixer
- run: composer require "friendsofphp/php-cs-fixer:2.18.4"
-
- - name: Execute PHP CS Fixer
- run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run
diff --git a/vendor/guzzlehttp/psr7/.php_cs.dist b/vendor/guzzlehttp/psr7/.php_cs.dist
deleted file mode 100644
index e4f0bd5..0000000
--- a/vendor/guzzlehttp/psr7/.php_cs.dist
+++ /dev/null
@@ -1,56 +0,0 @@
-setRiskyAllowed(true)
- ->setRules([
- '@PSR2' => true,
- 'array_syntax' => ['syntax' => 'short'],
- 'concat_space' => ['spacing' => 'one'],
- 'declare_strict_types' => false,
- 'final_static_access' => true,
- 'fully_qualified_strict_types' => true,
- 'header_comment' => false,
- 'is_null' => ['use_yoda_style' => true],
- 'list_syntax' => ['syntax' => 'long'],
- 'lowercase_cast' => true,
- 'magic_method_casing' => true,
- 'modernize_types_casting' => true,
- 'multiline_comment_opening_closing' => true,
- 'no_alias_functions' => true,
- 'no_alternative_syntax' => true,
- 'no_blank_lines_after_phpdoc' => true,
- 'no_empty_comment' => true,
- 'no_empty_phpdoc' => true,
- 'no_empty_statement' => true,
- 'no_extra_blank_lines' => true,
- 'no_leading_import_slash' => true,
- 'no_trailing_comma_in_singleline_array' => true,
- 'no_unset_cast' => true,
- 'no_unused_imports' => true,
- 'no_whitespace_in_blank_line' => true,
- 'ordered_imports' => true,
- 'php_unit_ordered_covers' => true,
- 'php_unit_test_annotation' => ['style' => 'prefix'],
- 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
- 'phpdoc_align' => ['align' => 'vertical'],
- 'phpdoc_no_useless_inheritdoc' => true,
- 'phpdoc_scalar' => true,
- 'phpdoc_separation' => true,
- 'phpdoc_single_line_var_spacing' => true,
- 'phpdoc_trim' => true,
- 'phpdoc_trim_consecutive_blank_line_separation' => true,
- 'phpdoc_types' => true,
- 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
- 'phpdoc_var_without_name' => true,
- 'single_trait_insert_per_statement' => true,
- 'standardize_not_equals' => true,
- ])
- ->setFinder(
- PhpCsFixer\Finder::create()
- ->in(__DIR__.'/src')
- ->in(__DIR__.'/tests')
- ->name('*.php')
- )
-;
-
-return $config;
diff --git a/vendor/guzzlehttp/psr7/CHANGELOG.md b/vendor/guzzlehttp/psr7/CHANGELOG.md
index 9b2b65c..fa716c0 100644
--- a/vendor/guzzlehttp/psr7/CHANGELOG.md
+++ b/vendor/guzzlehttp/psr7/CHANGELOG.md
@@ -1,50 +1,142 @@
# Change Log
-
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-
## Unreleased
-## 1.9.1 - 2023-04-17
+## 2.5.0 - 2023-04-17
+
+### Changed
+
+- Adjusted `psr/http-message` version constraint to `^1.1 || ^2.0`
+
+## 2.4.5 - 2023-04-17
### Fixed
+- Prevent possible warnings on unset variables in `ServerRequest::normalizeNestedFileSpec`
+- Fixed `Message::bodySummary` when `preg_match` fails
- Fixed header validation issue
-## 1.9.0 - 2022-06-20
+## 2.4.4 - 2023-03-09
+
+### Changed
+
+- Removed the need for `AllowDynamicProperties` in `LazyOpenStream`
+
+## 2.4.3 - 2022-10-26
+
+### Changed
+
+- Replaced `sha1(uniqid())` by `bin2hex(random_bytes(20))`
+
+## 2.4.2 - 2022-10-25
+
+### Fixed
+
+- Fixed erroneous behaviour when combining host and relative path
+
+## 2.4.1 - 2022-08-28
+
+### Fixed
+
+- Rewind body before reading in `Message::bodySummary`
+
+## 2.4.0 - 2022-06-20
### Added
+- Added provisional PHP 8.2 support
- Added `UriComparator::isCrossOrigin` method
-## 1.8.5 - 2022-03-20
+## 2.3.0 - 2022-06-09
+
+### Fixed
+
+- Added `Header::splitList` method
+- Added `Utils::tryGetContents` method
+- Improved `Stream::getContents` method
+- Updated mimetype mappings
+
+## 2.2.2 - 2022-06-08
+
+### Fixed
+
+- Fix `Message::parseRequestUri` for numeric headers
+- Re-wrap exceptions thrown in `fread` into runtime exceptions
+- Throw an exception when multipart options is misformatted
+
+## 2.2.1 - 2022-03-20
### Fixed
- Correct header value validation
-## 1.8.4 - 2022-03-20
+## 2.2.0 - 2022-03-20
+
+### Added
+
+- A more compressive list of mime types
+- Add JsonSerializable to Uri
+- Missing return types
+
+### Fixed
+
+- Bug MultipartStream no `uri` metadata
+- Bug MultipartStream with filename for `data://` streams
+- Fixed new line handling in MultipartStream
+- Reduced RAM usage when copying streams
+- Updated parsing in `Header::normalize()`
+
+## 2.1.1 - 2022-03-20
### Fixed
- Validate header values properly
-## 1.8.3 - 2021-10-05
+## 2.1.0 - 2021-10-06
+
+### Changed
+
+- Attempting to create a `Uri` object from a malformed URI will no longer throw a generic
+ `InvalidArgumentException`, but rather a `MalformedUriException`, which inherits from the former
+ for backwards compatibility. Callers relying on the exception being thrown to detect invalid
+ URIs should catch the new exception.
### Fixed
- Return `null` in caching stream size if remote size is `null`
-## 1.8.2 - 2021-04-26
+## 2.0.0 - 2021-06-30
+
+Identical to the RC release.
+
+## 2.0.0@RC-1 - 2021-04-29
### Fixed
- Handle possibly unset `url` in `stream_get_meta_data`
+## 2.0.0@beta-1 - 2021-03-21
+
+### Added
+
+- PSR-17 factories
+- Made classes final
+- PHP7 type hints
+
+### Changed
+
+- When building a query string, booleans are represented as 1 and 0.
+
+### Removed
+
+- PHP < 7.2 support
+- All functions in the `GuzzleHttp\Psr7` namespace
+
## 1.8.1 - 2021-03-21
### Fixed
diff --git a/vendor/guzzlehttp/psr7/README.md b/vendor/guzzlehttp/psr7/README.md
index 64776cb..9566a7d 100644
--- a/vendor/guzzlehttp/psr7/README.md
+++ b/vendor/guzzlehttp/psr7/README.md
@@ -4,9 +4,15 @@ This repository contains a full [PSR-7](https://www.php-fig.org/psr/psr-7/)
message implementation, several stream decorators, and some helpful
functionality like query string parsing.
+
+
-[](https://travis-ci.org/guzzle/psr7)
+# Installation
+
+```shell
+composer require guzzlehttp/psr7
+```
# Stream implementation
@@ -130,10 +136,9 @@ $fnStream->rewind();
`GuzzleHttp\Psr7\InflateStream`
-Uses PHP's zlib.inflate filter to inflate deflate or gzipped content.
+Uses PHP's zlib.inflate filter to inflate zlib (HTTP deflate, RFC1950) or gzipped (RFC1952) content.
-This stream decorator skips the first 10 bytes of the given stream to remove
-the gzip header, converts the provided stream to a PHP stream resource,
+This stream decorator converts the provided stream to a PHP stream resource,
then appends the zlib.inflate filter. The stream is then converted back
to a Guzzle stream resource to be used as a Guzzle stream.
@@ -246,6 +251,8 @@ class EofCallbackStream implements StreamInterface
private $callback;
+ private $stream;
+
public function __construct(StreamInterface $stream, callable $cb)
{
$this->stream = $stream;
@@ -381,10 +388,28 @@ of the header. When a parameter does not contain a value, but just
contains a key, this function will inject a key with a '' string value.
-## `GuzzleHttp\Psr7\Header::normalize`
+## `GuzzleHttp\Psr7\Header::splitList`
+
+`public static function splitList(string|string[] $header): string[]`
+
+Splits a HTTP header defined to contain a comma-separated list into
+each individual value:
+
+```
+$knownEtags = Header::splitList($request->getHeader('if-none-match'));
+```
+
+Example headers include `accept`, `cache-control` and `if-none-match`.
+
+
+## `GuzzleHttp\Psr7\Header::normalize` (deprecated)
`public static function normalize(string|array $header): array`
+`Header::normalize()` is deprecated in favor of [`Header::splitList()`](README.md#guzzlehttppsr7headersplitlist)
+which performs the same operation with a cleaned up API and improved
+documentation.
+
Converts an array of header values that may contain comma separated
headers into an array of headers with no comma separated values.
@@ -528,6 +553,17 @@ When fopen fails, PHP normally raises a warning. This function adds an
error handler that checks for errors and throws an exception instead.
+## `GuzzleHttp\Psr7\Utils::tryGetContents`
+
+`public static function tryGetContents(resource $stream): string`
+
+Safely gets the contents of a given stream.
+
+When stream_get_contents fails, PHP normally raises a warning. This
+function adds an error handler that checks for errors and throws an
+exception instead.
+
+
## `GuzzleHttp\Psr7\Utils::uriFor`
`public static function uriFor(string|UriInterface $uri): UriInterface`
@@ -555,7 +591,7 @@ Maps a file extensions to a mimetype.
## Upgrading from Function API
-The static API was first introduced in 1.7.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API will be removed in 2.0.0. A migration table has been provided here for your convenience:
+The static API was first introduced in 1.7.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API was removed in 2.0.0. A migration table has been provided here for your convenience:
| Original Function | Replacement Method |
|----------------|----------------|
diff --git a/vendor/guzzlehttp/psr7/composer.json b/vendor/guzzlehttp/psr7/composer.json
index 2607f22..d51dd62 100644
--- a/vendor/guzzlehttp/psr7/composer.json
+++ b/vendor/guzzlehttp/psr7/composer.json
@@ -1,7 +1,16 @@
{
"name": "guzzlehttp/psr7",
"description": "PSR-7 message implementation that also provides common utility methods",
- "keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"],
+ "keywords": [
+ "request",
+ "response",
+ "message",
+ "stream",
+ "http",
+ "uri",
+ "url",
+ "psr-7"
+ ],
"license": "MIT",
"authors": [
{
@@ -33,39 +42,52 @@
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://sagikazarmark.hu"
}
],
"require": {
- "php": ">=5.4.0",
- "psr/http-message": "~1.0",
- "ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10",
- "ext-zlib": "*"
+ "php": "^7.2.5 || ^8.0",
+ "psr/http-factory": "^1.0",
+ "psr/http-message": "^1.1 || ^2.0",
+ "ralouphie/getallheaders": "^3.0"
},
"provide": {
+ "psr/http-factory-implementation": "1.0",
"psr/http-message-implementation": "1.0"
},
+ "require-dev": {
+ "bamarni/composer-bin-plugin": "^1.8.1",
+ "http-interop/http-factory-tests": "^0.9",
+ "phpunit/phpunit": "^8.5.29 || ^9.5.23"
+ },
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
- },
- "files": ["src/functions_include.php"]
+ }
},
"autoload-dev": {
"psr-4": {
"GuzzleHttp\\Tests\\Psr7\\": "tests/"
}
},
+ "extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ }
+ },
"config": {
- "preferred-install": "dist",
- "sort-packages": true,
"allow-plugins": {
"bamarni/composer-bin-plugin": true
- }
+ },
+ "preferred-install": "dist",
+ "sort-packages": true
}
}
diff --git a/vendor/guzzlehttp/psr7/src/AppendStream.php b/vendor/guzzlehttp/psr7/src/AppendStream.php
index fa9153d..cbcfaee 100644
--- a/vendor/guzzlehttp/psr7/src/AppendStream.php
+++ b/vendor/guzzlehttp/psr7/src/AppendStream.php
@@ -1,5 +1,7 @@
rewind();
return $this->getContents();
- } catch (\Exception $e) {
+ } catch (\Throwable $e) {
+ if (\PHP_VERSION_ID >= 70400) {
+ throw $e;
+ }
+ trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
return '';
}
}
@@ -48,7 +57,7 @@ class AppendStream implements StreamInterface
*
* @throws \InvalidArgumentException if the stream is not readable
*/
- public function addStream(StreamInterface $stream)
+ public function addStream(StreamInterface $stream): void
{
if (!$stream->isReadable()) {
throw new \InvalidArgumentException('Each stream must be readable');
@@ -62,17 +71,15 @@ class AppendStream implements StreamInterface
$this->streams[] = $stream;
}
- public function getContents()
+ public function getContents(): string
{
return Utils::copyToString($this);
}
/**
* Closes each attached stream.
- *
- * {@inheritdoc}
*/
- public function close()
+ public function close(): void
{
$this->pos = $this->current = 0;
$this->seekable = true;
@@ -88,8 +95,6 @@ class AppendStream implements StreamInterface
* Detaches each attached stream.
*
* Returns null as it's not clear which underlying stream resource to return.
- *
- * {@inheritdoc}
*/
public function detach()
{
@@ -105,7 +110,7 @@ class AppendStream implements StreamInterface
return null;
}
- public function tell()
+ public function tell(): int
{
return $this->pos;
}
@@ -115,10 +120,8 @@ class AppendStream implements StreamInterface
*
* If any of the streams do not return a valid number, then the size of the
* append stream cannot be determined and null is returned.
- *
- * {@inheritdoc}
*/
- public function getSize()
+ public function getSize(): ?int
{
$size = 0;
@@ -133,24 +136,22 @@ class AppendStream implements StreamInterface
return $size;
}
- public function eof()
+ public function eof(): bool
{
return !$this->streams ||
($this->current >= count($this->streams) - 1 &&
$this->streams[$this->current]->eof());
}
- public function rewind()
+ public function rewind(): void
{
$this->seek(0);
}
/**
* Attempts to seek to the given position. Only supports SEEK_SET.
- *
- * {@inheritdoc}
*/
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
if (!$this->seekable) {
throw new \RuntimeException('This AppendStream is not seekable');
@@ -181,10 +182,8 @@ class AppendStream implements StreamInterface
/**
* Reads from all of the appended streams until the length is met or EOF.
- *
- * {@inheritdoc}
*/
- public function read($length)
+ public function read($length): string
{
$buffer = '';
$total = count($this->streams) - 1;
@@ -192,7 +191,6 @@ class AppendStream implements StreamInterface
$progressToNext = false;
while ($remaining > 0) {
-
// Progress to the next stream if needed.
if ($progressToNext || $this->streams[$this->current]->eof()) {
$progressToNext = false;
@@ -204,8 +202,7 @@ class AppendStream implements StreamInterface
$result = $this->streams[$this->current]->read($remaining);
- // Using a loose comparison here to match on '', false, and null
- if ($result == null) {
+ if ($result === '') {
$progressToNext = true;
continue;
}
@@ -219,26 +216,31 @@ class AppendStream implements StreamInterface
return $buffer;
}
- public function isReadable()
+ public function isReadable(): bool
{
return true;
}
- public function isWritable()
+ public function isWritable(): bool
{
return false;
}
- public function isSeekable()
+ public function isSeekable(): bool
{
return $this->seekable;
}
- public function write($string)
+ public function write($string): int
{
throw new \RuntimeException('Cannot write to an AppendStream');
}
+ /**
+ * {@inheritdoc}
+ *
+ * @return mixed
+ */
public function getMetadata($key = null)
{
return $key ? null : [];
diff --git a/vendor/guzzlehttp/psr7/src/BufferStream.php b/vendor/guzzlehttp/psr7/src/BufferStream.php
index 783859c..21be8c0 100644
--- a/vendor/guzzlehttp/psr7/src/BufferStream.php
+++ b/vendor/guzzlehttp/psr7/src/BufferStream.php
@@ -1,5 +1,7 @@
hwm = $hwm;
}
- public function __toString()
+ public function __toString(): string
{
return $this->getContents();
}
- public function getContents()
+ public function getContents(): string
{
$buffer = $this->buffer;
$this->buffer = '';
@@ -44,7 +47,7 @@ class BufferStream implements StreamInterface
return $buffer;
}
- public function close()
+ public function close(): void
{
$this->buffer = '';
}
@@ -56,42 +59,42 @@ class BufferStream implements StreamInterface
return null;
}
- public function getSize()
+ public function getSize(): ?int
{
return strlen($this->buffer);
}
- public function isReadable()
+ public function isReadable(): bool
{
return true;
}
- public function isWritable()
+ public function isWritable(): bool
{
return true;
}
- public function isSeekable()
+ public function isSeekable(): bool
{
return false;
}
- public function rewind()
+ public function rewind(): void
{
$this->seek(0);
}
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
throw new \RuntimeException('Cannot seek a BufferStream');
}
- public function eof()
+ public function eof(): bool
{
return strlen($this->buffer) === 0;
}
- public function tell()
+ public function tell(): int
{
throw new \RuntimeException('Cannot determine the position of a BufferStream');
}
@@ -99,7 +102,7 @@ class BufferStream implements StreamInterface
/**
* Reads data from the buffer.
*/
- public function read($length)
+ public function read($length): string
{
$currentLength = strlen($this->buffer);
@@ -119,21 +122,25 @@ class BufferStream implements StreamInterface
/**
* Writes data to the buffer.
*/
- public function write($string)
+ public function write($string): int
{
$this->buffer .= $string;
- // TODO: What should happen here?
if (strlen($this->buffer) >= $this->hwm) {
- return false;
+ return 0;
}
return strlen($string);
}
+ /**
+ * {@inheritdoc}
+ *
+ * @return mixed
+ */
public function getMetadata($key = null)
{
- if ($key == 'hwm') {
+ if ($key === 'hwm') {
return $this->hwm;
}
diff --git a/vendor/guzzlehttp/psr7/src/CachingStream.php b/vendor/guzzlehttp/psr7/src/CachingStream.php
index febade9..f34722c 100644
--- a/vendor/guzzlehttp/psr7/src/CachingStream.php
+++ b/vendor/guzzlehttp/psr7/src/CachingStream.php
@@ -1,5 +1,7 @@
stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+'));
}
- public function getSize()
+ public function getSize(): ?int
{
$remoteSize = $this->remoteStream->getSize();
@@ -45,18 +50,18 @@ class CachingStream implements StreamInterface
return max($this->stream->getSize(), $remoteSize);
}
- public function rewind()
+ public function rewind(): void
{
$this->seek(0);
}
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
- if ($whence == SEEK_SET) {
+ if ($whence === SEEK_SET) {
$byte = $offset;
- } elseif ($whence == SEEK_CUR) {
+ } elseif ($whence === SEEK_CUR) {
$byte = $offset + $this->tell();
- } elseif ($whence == SEEK_END) {
+ } elseif ($whence === SEEK_END) {
$size = $this->remoteStream->getSize();
if ($size === null) {
$size = $this->cacheEntireStream();
@@ -81,7 +86,7 @@ class CachingStream implements StreamInterface
}
}
- public function read($length)
+ public function read($length): string
{
// Perform a regular read on any previously read data from the buffer
$data = $this->stream->read($length);
@@ -110,7 +115,7 @@ class CachingStream implements StreamInterface
return $data;
}
- public function write($string)
+ public function write($string): int
{
// When appending to the end of the currently read stream, you'll want
// to skip bytes from being read from the remote stream to emulate
@@ -124,7 +129,7 @@ class CachingStream implements StreamInterface
return $this->stream->write($string);
}
- public function eof()
+ public function eof(): bool
{
return $this->stream->eof() && $this->remoteStream->eof();
}
@@ -132,12 +137,13 @@ class CachingStream implements StreamInterface
/**
* Close both the remote stream and buffer stream
*/
- public function close()
+ public function close(): void
{
- $this->remoteStream->close() && $this->stream->close();
+ $this->remoteStream->close();
+ $this->stream->close();
}
- private function cacheEntireStream()
+ private function cacheEntireStream(): int
{
$target = new FnStream(['write' => 'strlen']);
Utils::copyToStream($this, $target);
diff --git a/vendor/guzzlehttp/psr7/src/DroppingStream.php b/vendor/guzzlehttp/psr7/src/DroppingStream.php
index 9f7420c..6e3d209 100644
--- a/vendor/guzzlehttp/psr7/src/DroppingStream.php
+++ b/vendor/guzzlehttp/psr7/src/DroppingStream.php
@@ -1,5 +1,7 @@
stream = $stream;
$this->maxLength = $maxLength;
}
- public function write($string)
+ public function write($string): int
{
$diff = $this->maxLength - $this->stream->getSize();
diff --git a/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php b/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php
new file mode 100644
index 0000000..3a08477
--- /dev/null
+++ b/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php
@@ -0,0 +1,14 @@
+ */
private $methods;
- /** @var array Methods that must be implemented in the given array */
- private static $slots = ['__toString', 'close', 'detach', 'rewind',
- 'getSize', 'tell', 'eof', 'isSeekable', 'seek', 'isWritable', 'write',
- 'isReadable', 'read', 'getContents', 'getMetadata'];
-
/**
- * @param array $methods Hash of method name to a callable.
+ * @param array $methods Hash of method name to a callable.
*/
public function __construct(array $methods)
{
@@ -40,7 +42,7 @@ class FnStream implements StreamInterface
*
* @throws \BadMethodCallException
*/
- public function __get($name)
+ public function __get(string $name): void
{
throw new \BadMethodCallException(str_replace('_fn_', '', $name)
. '() is not implemented in the FnStream');
@@ -61,7 +63,7 @@ class FnStream implements StreamInterface
*
* @throws \LogicException
*/
- public function __wakeup()
+ public function __wakeup(): void
{
throw new \LogicException('FnStream should never be unserialized');
}
@@ -70,8 +72,8 @@ class FnStream implements StreamInterface
* Adds custom functionality to an underlying stream by intercepting
* specific method calls.
*
- * @param StreamInterface $stream Stream to decorate
- * @param array $methods Hash of method name to a closure
+ * @param StreamInterface $stream Stream to decorate
+ * @param array $methods Hash of method name to a closure
*
* @return FnStream
*/
@@ -79,21 +81,31 @@ class FnStream implements StreamInterface
{
// If any of the required methods were not provided, then simply
// proxy to the decorated stream.
- foreach (array_diff(self::$slots, array_keys($methods)) as $diff) {
- $methods[$diff] = [$stream, $diff];
+ foreach (array_diff(self::SLOTS, array_keys($methods)) as $diff) {
+ /** @var callable $callable */
+ $callable = [$stream, $diff];
+ $methods[$diff] = $callable;
}
return new self($methods);
}
- public function __toString()
+ public function __toString(): string
{
- return call_user_func($this->_fn___toString);
+ try {
+ return call_user_func($this->_fn___toString);
+ } catch (\Throwable $e) {
+ if (\PHP_VERSION_ID >= 70400) {
+ throw $e;
+ }
+ trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
+ return '';
+ }
}
- public function close()
+ public function close(): void
{
- return call_user_func($this->_fn_close);
+ call_user_func($this->_fn_close);
}
public function detach()
@@ -101,61 +113,66 @@ class FnStream implements StreamInterface
return call_user_func($this->_fn_detach);
}
- public function getSize()
+ public function getSize(): ?int
{
return call_user_func($this->_fn_getSize);
}
- public function tell()
+ public function tell(): int
{
return call_user_func($this->_fn_tell);
}
- public function eof()
+ public function eof(): bool
{
return call_user_func($this->_fn_eof);
}
- public function isSeekable()
+ public function isSeekable(): bool
{
return call_user_func($this->_fn_isSeekable);
}
- public function rewind()
+ public function rewind(): void
{
call_user_func($this->_fn_rewind);
}
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
call_user_func($this->_fn_seek, $offset, $whence);
}
- public function isWritable()
+ public function isWritable(): bool
{
return call_user_func($this->_fn_isWritable);
}
- public function write($string)
+ public function write($string): int
{
return call_user_func($this->_fn_write, $string);
}
- public function isReadable()
+ public function isReadable(): bool
{
return call_user_func($this->_fn_isReadable);
}
- public function read($length)
+ public function read($length): string
{
return call_user_func($this->_fn_read, $length);
}
- public function getContents()
+ public function getContents(): string
{
return call_user_func($this->_fn_getContents);
}
+ /**
+ * {@inheritdoc}
+ *
+ * @return mixed
+ */
public function getMetadata($key = null)
{
return call_user_func($this->_fn_getMetadata, $key);
diff --git a/vendor/guzzlehttp/psr7/src/Header.php b/vendor/guzzlehttp/psr7/src/Header.php
index 865d742..4d7005b 100644
--- a/vendor/guzzlehttp/psr7/src/Header.php
+++ b/vendor/guzzlehttp/psr7/src/Header.php
@@ -1,5 +1,7 @@
]+>|[^=]+/', $kvp, $matches)) {
- $m = $matches[0];
- if (isset($m[1])) {
- $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed);
- } else {
- $part[] = trim($m[0], $trimmed);
+ foreach ((array) $header as $value) {
+ foreach (self::splitList($value) as $val) {
+ $part = [];
+ foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) {
+ if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) {
+ $m = $matches[0];
+ if (isset($m[1])) {
+ $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed);
+ } else {
+ $part[] = trim($m[0], $trimmed);
+ }
}
}
- }
- if ($part) {
- $params[] = $part;
+ if ($part) {
+ $params[] = $part;
+ }
}
}
@@ -45,24 +47,85 @@ final class Header
*
* @param string|array $header Header to normalize.
*
- * @return array Returns the normalized header field values.
+ * @deprecated Use self::splitList() instead.
*/
- public static function normalize($header)
+ public static function normalize($header): array
{
- if (!is_array($header)) {
- return array_map('trim', explode(',', $header));
+ $result = [];
+ foreach ((array) $header as $value) {
+ foreach (self::splitList($value) as $parsed) {
+ $result[] = $parsed;
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Splits a HTTP header defined to contain a comma-separated list into
+ * each individual value. Empty values will be removed.
+ *
+ * Example headers include 'accept', 'cache-control' and 'if-none-match'.
+ *
+ * This method must not be used to parse headers that are not defined as
+ * a list, such as 'user-agent' or 'set-cookie'.
+ *
+ * @param string|string[] $values Header value as returned by MessageInterface::getHeader()
+ *
+ * @return string[]
+ */
+ public static function splitList($values): array
+ {
+ if (!\is_array($values)) {
+ $values = [$values];
}
$result = [];
- foreach ($header as $value) {
- foreach ((array) $value as $v) {
- if (strpos($v, ',') === false) {
- $result[] = $v;
+ foreach ($values as $value) {
+ if (!\is_string($value)) {
+ throw new \TypeError('$header must either be a string or an array containing strings.');
+ }
+
+ $v = '';
+ $isQuoted = false;
+ $isEscaped = false;
+ for ($i = 0, $max = \strlen($value); $i < $max; $i++) {
+ if ($isEscaped) {
+ $v .= $value[$i];
+ $isEscaped = false;
+
continue;
}
- foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) {
- $result[] = trim($vv);
+
+ if (!$isQuoted && $value[$i] === ',') {
+ $v = \trim($v);
+ if ($v !== '') {
+ $result[] = $v;
+ }
+
+ $v = '';
+ continue;
}
+
+ if ($isQuoted && $value[$i] === '\\') {
+ $isEscaped = true;
+ $v .= $value[$i];
+
+ continue;
+ }
+ if ($value[$i] === '"') {
+ $isQuoted = !$isQuoted;
+ $v .= $value[$i];
+
+ continue;
+ }
+
+ $v .= $value[$i];
+ }
+
+ $v = \trim($v);
+ if ($v !== '') {
+ $result[] = $v;
}
}
diff --git a/vendor/guzzlehttp/psr7/src/HttpFactory.php b/vendor/guzzlehttp/psr7/src/HttpFactory.php
new file mode 100644
index 0000000..30be222
--- /dev/null
+++ b/vendor/guzzlehttp/psr7/src/HttpFactory.php
@@ -0,0 +1,100 @@
+getSize();
+ }
+
+ return new UploadedFile($stream, $size, $error, $clientFilename, $clientMediaType);
+ }
+
+ public function createStream(string $content = ''): StreamInterface
+ {
+ return Utils::streamFor($content);
+ }
+
+ public function createStreamFromFile(string $file, string $mode = 'r'): StreamInterface
+ {
+ try {
+ $resource = Utils::tryFopen($file, $mode);
+ } catch (\RuntimeException $e) {
+ if ('' === $mode || false === \in_array($mode[0], ['r', 'w', 'a', 'x', 'c'], true)) {
+ throw new \InvalidArgumentException(sprintf('Invalid file opening mode "%s"', $mode), 0, $e);
+ }
+
+ throw $e;
+ }
+
+ return Utils::streamFor($resource);
+ }
+
+ public function createStreamFromResource($resource): StreamInterface
+ {
+ return Utils::streamFor($resource);
+ }
+
+ public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface
+ {
+ if (empty($method)) {
+ if (!empty($serverParams['REQUEST_METHOD'])) {
+ $method = $serverParams['REQUEST_METHOD'];
+ } else {
+ throw new \InvalidArgumentException('Cannot determine HTTP method');
+ }
+ }
+
+ return new ServerRequest($method, $uri, [], null, '1.1', $serverParams);
+ }
+
+ public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface
+ {
+ return new Response($code, [], null, '1.1', $reasonPhrase);
+ }
+
+ public function createRequest(string $method, $uri): RequestInterface
+ {
+ return new Request($method, $uri);
+ }
+
+ public function createUri(string $uri = ''): UriInterface
+ {
+ return new Uri($uri);
+ }
+}
diff --git a/vendor/guzzlehttp/psr7/src/InflateStream.php b/vendor/guzzlehttp/psr7/src/InflateStream.php
index 0cbd2cc..8e00f1c 100644
--- a/vendor/guzzlehttp/psr7/src/InflateStream.php
+++ b/vendor/guzzlehttp/psr7/src/InflateStream.php
@@ -1,56 +1,37 @@
read(10);
- $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header);
- // Skip the header, that is 10 + length of filename + 1 (nil) bytes
- $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength);
$resource = StreamWrapper::getResource($stream);
- stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ);
+ // Specify window=15+32, so zlib will use header detection to both gzip (with header) and zlib data
+ // See http://www.zlib.net/manual.html#Advanced definition of inflateInit2
+ // "Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection"
+ // Default window size is 15.
+ stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ, ['window' => 15 + 32]);
$this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource));
}
-
- /**
- * @param StreamInterface $stream
- * @param $header
- *
- * @return int
- */
- private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header)
- {
- $filename_header_length = 0;
-
- if (substr(bin2hex($header), 6, 2) === '08') {
- // we have a filename, read until nil
- $filename_header_length = 1;
- while ($stream->read(1) !== chr(0)) {
- $filename_header_length++;
- }
- }
-
- return $filename_header_length;
- }
}
diff --git a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php
index 911e127..f6c8490 100644
--- a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php
+++ b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php
@@ -1,5 +1,7 @@
filename = $filename;
$this->mode = $mode;
+
+ // unsetting the property forces the first access to go through
+ // __get().
+ unset($this->stream);
}
/**
* Creates the underlying stream lazily when required.
- *
- * @return StreamInterface
*/
- protected function createStream()
+ protected function createStream(): StreamInterface
{
return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode));
}
diff --git a/vendor/guzzlehttp/psr7/src/LimitStream.php b/vendor/guzzlehttp/psr7/src/LimitStream.php
index 1173ec4..fb22325 100644
--- a/vendor/guzzlehttp/psr7/src/LimitStream.php
+++ b/vendor/guzzlehttp/psr7/src/LimitStream.php
@@ -1,15 +1,15 @@
stream = $stream;
$this->setLimit($limit);
$this->setOffset($offset);
}
- public function eof()
+ public function eof(): bool
{
// Always return true if the underlying stream is EOF
if ($this->stream->eof()) {
@@ -44,7 +47,7 @@ class LimitStream implements StreamInterface
}
// No limit and the underlying stream is not at EOF
- if ($this->limit == -1) {
+ if ($this->limit === -1) {
return false;
}
@@ -53,13 +56,12 @@ class LimitStream implements StreamInterface
/**
* Returns the size of the limited subset of data
- * {@inheritdoc}
*/
- public function getSize()
+ public function getSize(): ?int
{
if (null === ($length = $this->stream->getSize())) {
return null;
- } elseif ($this->limit == -1) {
+ } elseif ($this->limit === -1) {
return $length - $this->offset;
} else {
return min($this->limit, $length - $this->offset);
@@ -68,9 +70,8 @@ class LimitStream implements StreamInterface
/**
* Allow for a bounded seek on the read limited stream
- * {@inheritdoc}
*/
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
if ($whence !== SEEK_SET || $offset < 0) {
throw new \RuntimeException(sprintf(
@@ -93,9 +94,8 @@ class LimitStream implements StreamInterface
/**
* Give a relative tell()
- * {@inheritdoc}
*/
- public function tell()
+ public function tell(): int
{
return $this->stream->tell() - $this->offset;
}
@@ -107,7 +107,7 @@ class LimitStream implements StreamInterface
*
* @throws \RuntimeException if the stream cannot be seeked.
*/
- public function setOffset($offset)
+ public function setOffset(int $offset): void
{
$current = $this->stream->tell();
@@ -132,14 +132,14 @@ class LimitStream implements StreamInterface
* @param int $limit Number of bytes to allow to be read from the stream.
* Use -1 for no limit.
*/
- public function setLimit($limit)
+ public function setLimit(int $limit): void
{
$this->limit = $limit;
}
- public function read($length)
+ public function read($length): string
{
- if ($this->limit == -1) {
+ if ($this->limit === -1) {
return $this->stream->read($length);
}
diff --git a/vendor/guzzlehttp/psr7/src/Message.php b/vendor/guzzlehttp/psr7/src/Message.php
index 516d1cb..c1e15f8 100644
--- a/vendor/guzzlehttp/psr7/src/Message.php
+++ b/vendor/guzzlehttp/psr7/src/Message.php
@@ -1,5 +1,7 @@
getMethod() . ' '
@@ -52,10 +52,8 @@ final class Message
*
* @param MessageInterface $message The message to get the body summary
* @param int $truncateAt The maximum allowed size of the summary
- *
- * @return string|null
*/
- public static function bodySummary(MessageInterface $message, $truncateAt = 120)
+ public static function bodySummary(MessageInterface $message, int $truncateAt = 120): ?string
{
$body = $message->getBody();
@@ -69,6 +67,7 @@ final class Message
return null;
}
+ $body->rewind();
$summary = $body->read($truncateAt);
$body->rewind();
@@ -78,7 +77,7 @@ final class Message
// Matches any printable character, including unicode characters:
// letters, marks, numbers, punctuation, spacing, and separators.
- if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) {
+ if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary) !== 0) {
return null;
}
@@ -95,7 +94,7 @@ final class Message
*
* @throws \RuntimeException
*/
- public static function rewindBody(MessageInterface $message)
+ public static function rewindBody(MessageInterface $message): void
{
$body = $message->getBody();
@@ -112,10 +111,8 @@ final class Message
* array values, and a "body" key containing the body of the message.
*
* @param string $message HTTP request or response to parse.
- *
- * @return array
*/
- public static function parseMessage($message)
+ public static function parseMessage(string $message): array
{
if (!$message) {
throw new \InvalidArgumentException('Invalid message');
@@ -129,7 +126,7 @@ final class Message
throw new \InvalidArgumentException('Invalid message: Missing header delimiter');
}
- list($rawHeaders, $body) = $messageParts;
+ [$rawHeaders, $body] = $messageParts;
$rawHeaders .= "\r\n"; // Put back the delimiter we split previously
$headerParts = preg_split("/\r?\n/", $rawHeaders, 2);
@@ -137,7 +134,7 @@ final class Message
throw new \InvalidArgumentException('Invalid message: Missing status line');
}
- list($startLine, $rawHeaders) = $headerParts;
+ [$startLine, $rawHeaders] = $headerParts;
if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') {
// Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0
@@ -175,12 +172,13 @@ final class Message
*
* @param string $path Path from the start-line
* @param array $headers Array of headers (each value an array).
- *
- * @return string
*/
- public static function parseRequestUri($path, array $headers)
+ public static function parseRequestUri(string $path, array $headers): string
{
$hostKey = array_filter(array_keys($headers), function ($k) {
+ // Numeric array keys are converted to int by PHP.
+ $k = (string) $k;
+
return strtolower($k) === 'host';
});
@@ -199,10 +197,8 @@ final class Message
* Parses a request message string into a request object.
*
* @param string $message Request message string.
- *
- * @return Request
*/
- public static function parseRequest($message)
+ public static function parseRequest(string $message): RequestInterface
{
$data = self::parseMessage($message);
$matches = [];
@@ -227,10 +223,8 @@ final class Message
* Parses a response message string into a response object.
*
* @param string $message Response message string.
- *
- * @return Response
*/
- public static function parseResponse($message)
+ public static function parseResponse(string $message): ResponseInterface
{
$data = self::parseMessage($message);
// According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space
@@ -246,7 +240,7 @@ final class Message
$data['headers'],
$data['body'],
explode('/', $parts[0])[1],
- isset($parts[2]) ? $parts[2] : null
+ $parts[2] ?? null
);
}
}
diff --git a/vendor/guzzlehttp/psr7/src/MessageTrait.php b/vendor/guzzlehttp/psr7/src/MessageTrait.php
index 0bbd63e..464bdfa 100644
--- a/vendor/guzzlehttp/psr7/src/MessageTrait.php
+++ b/vendor/guzzlehttp/psr7/src/MessageTrait.php
@@ -1,7 +1,10 @@
array of values */
+ /** @var array Map of all registered headers, as original name => array of values */
private $headers = [];
- /** @var array Map of lowercase header name => original name at registration */
+ /** @var array Map of lowercase header name => original name at registration */
private $headerNames = [];
/** @var string */
@@ -21,12 +24,12 @@ trait MessageTrait
/** @var StreamInterface|null */
private $stream;
- public function getProtocolVersion()
+ public function getProtocolVersion(): string
{
return $this->protocol;
}
- public function withProtocolVersion($version)
+ public function withProtocolVersion($version): MessageInterface
{
if ($this->protocol === $version) {
return $this;
@@ -37,17 +40,17 @@ trait MessageTrait
return $new;
}
- public function getHeaders()
+ public function getHeaders(): array
{
return $this->headers;
}
- public function hasHeader($header)
+ public function hasHeader($header): bool
{
return isset($this->headerNames[strtolower($header)]);
}
- public function getHeader($header)
+ public function getHeader($header): array
{
$header = strtolower($header);
@@ -60,12 +63,12 @@ trait MessageTrait
return $this->headers[$header];
}
- public function getHeaderLine($header)
+ public function getHeaderLine($header): string
{
return implode(', ', $this->getHeader($header));
}
- public function withHeader($header, $value)
+ public function withHeader($header, $value): MessageInterface
{
$this->assertHeader($header);
$value = $this->normalizeHeaderValue($value);
@@ -81,7 +84,7 @@ trait MessageTrait
return $new;
}
- public function withAddedHeader($header, $value)
+ public function withAddedHeader($header, $value): MessageInterface
{
$this->assertHeader($header);
$value = $this->normalizeHeaderValue($value);
@@ -99,7 +102,7 @@ trait MessageTrait
return $new;
}
- public function withoutHeader($header)
+ public function withoutHeader($header): MessageInterface
{
$normalized = strtolower($header);
@@ -115,7 +118,7 @@ trait MessageTrait
return $new;
}
- public function getBody()
+ public function getBody(): StreamInterface
{
if (!$this->stream) {
$this->stream = Utils::streamFor('');
@@ -124,7 +127,7 @@ trait MessageTrait
return $this->stream;
}
- public function withBody(StreamInterface $body)
+ public function withBody(StreamInterface $body): MessageInterface
{
if ($body === $this->stream) {
return $this;
@@ -135,15 +138,16 @@ trait MessageTrait
return $new;
}
- private function setHeaders(array $headers)
+ /**
+ * @param array $headers
+ */
+ private function setHeaders(array $headers): void
{
$this->headerNames = $this->headers = [];
foreach ($headers as $header => $value) {
- if (is_int($header)) {
- // Numeric array keys are converted to int by PHP but having a header name '123' is not forbidden by the spec
- // and also allowed in withHeader(). So we need to cast it to string again for the following assertion to pass.
- $header = (string) $header;
- }
+ // Numeric array keys are converted to int by PHP.
+ $header = (string) $header;
+
$this->assertHeader($header);
$value = $this->normalizeHeaderValue($value);
$normalized = strtolower($header);
@@ -162,7 +166,7 @@ trait MessageTrait
*
* @return string[]
*/
- private function normalizeHeaderValue($value)
+ private function normalizeHeaderValue($value): array
{
if (!is_array($value)) {
return $this->trimAndValidateHeaderValues([$value]);
@@ -189,7 +193,7 @@ trait MessageTrait
*
* @see https://tools.ietf.org/html/rfc7230#section-3.2.4
*/
- private function trimAndValidateHeaderValues(array $values)
+ private function trimAndValidateHeaderValues(array $values): array
{
return array_map(function ($value) {
if (!is_scalar($value) && null !== $value) {
@@ -210,10 +214,8 @@ trait MessageTrait
* @see https://tools.ietf.org/html/rfc7230#section-3.2
*
* @param mixed $header
- *
- * @return void
*/
- private function assertHeader($header)
+ private function assertHeader($header): void
{
if (!is_string($header)) {
throw new \InvalidArgumentException(sprintf(
@@ -222,10 +224,6 @@ trait MessageTrait
));
}
- if ($header === '') {
- throw new \InvalidArgumentException('Header name can not be empty.');
- }
-
if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) {
throw new \InvalidArgumentException(
sprintf('"%s" is not valid header name.', $header)
@@ -234,10 +232,6 @@ trait MessageTrait
}
/**
- * @param string $value
- *
- * @return void
- *
* @see https://tools.ietf.org/html/rfc7230#section-3.2
*
* field-value = *( field-content / obs-fold )
@@ -247,7 +241,7 @@ trait MessageTrait
* obs-text = %x80-FF
* obs-fold = CRLF 1*( SP / HTAB )
*/
- private function assertValue($value)
+ private function assertValue(string $value): void
{
// The regular expression intentionally does not support the obs-fold production, because as
// per RFC 7230#3.2.4:
diff --git a/vendor/guzzlehttp/psr7/src/MimeType.php b/vendor/guzzlehttp/psr7/src/MimeType.php
index 205c7b1..0debbd1 100644
--- a/vendor/guzzlehttp/psr7/src/MimeType.php
+++ b/vendor/guzzlehttp/psr7/src/MimeType.php
@@ -1,17 +1,1226 @@
'application/vnd.1000minds.decision-model+xml',
+ '3dml' => 'text/vnd.in3d.3dml',
+ '3ds' => 'image/x-3ds',
+ '3g2' => 'video/3gpp2',
+ '3gp' => 'video/3gp',
+ '3gpp' => 'video/3gpp',
+ '3mf' => 'model/3mf',
+ '7z' => 'application/x-7z-compressed',
+ '7zip' => 'application/x-7z-compressed',
+ '123' => 'application/vnd.lotus-1-2-3',
+ 'aab' => 'application/x-authorware-bin',
+ 'aac' => 'audio/x-acc',
+ 'aam' => 'application/x-authorware-map',
+ 'aas' => 'application/x-authorware-seg',
+ 'abw' => 'application/x-abiword',
+ 'ac' => 'application/vnd.nokia.n-gage.ac+xml',
+ 'ac3' => 'audio/ac3',
+ 'acc' => 'application/vnd.americandynamics.acc',
+ 'ace' => 'application/x-ace-compressed',
+ 'acu' => 'application/vnd.acucobol',
+ 'acutc' => 'application/vnd.acucorp',
+ 'adp' => 'audio/adpcm',
+ 'aep' => 'application/vnd.audiograph',
+ 'afm' => 'application/x-font-type1',
+ 'afp' => 'application/vnd.ibm.modcap',
+ 'age' => 'application/vnd.age',
+ 'ahead' => 'application/vnd.ahead.space',
+ 'ai' => 'application/pdf',
+ 'aif' => 'audio/x-aiff',
+ 'aifc' => 'audio/x-aiff',
+ 'aiff' => 'audio/x-aiff',
+ 'air' => 'application/vnd.adobe.air-application-installer-package+zip',
+ 'ait' => 'application/vnd.dvb.ait',
+ 'ami' => 'application/vnd.amiga.ami',
+ 'amr' => 'audio/amr',
+ 'apk' => 'application/vnd.android.package-archive',
+ 'apng' => 'image/apng',
+ 'appcache' => 'text/cache-manifest',
+ 'application' => 'application/x-ms-application',
+ 'apr' => 'application/vnd.lotus-approach',
+ 'arc' => 'application/x-freearc',
+ 'arj' => 'application/x-arj',
+ 'asc' => 'application/pgp-signature',
+ 'asf' => 'video/x-ms-asf',
+ 'asm' => 'text/x-asm',
+ 'aso' => 'application/vnd.accpac.simply.aso',
+ 'asx' => 'video/x-ms-asf',
+ 'atc' => 'application/vnd.acucorp',
+ 'atom' => 'application/atom+xml',
+ 'atomcat' => 'application/atomcat+xml',
+ 'atomdeleted' => 'application/atomdeleted+xml',
+ 'atomsvc' => 'application/atomsvc+xml',
+ 'atx' => 'application/vnd.antix.game-component',
+ 'au' => 'audio/x-au',
+ 'avci' => 'image/avci',
+ 'avcs' => 'image/avcs',
+ 'avi' => 'video/x-msvideo',
+ 'avif' => 'image/avif',
+ 'aw' => 'application/applixware',
+ 'azf' => 'application/vnd.airzip.filesecure.azf',
+ 'azs' => 'application/vnd.airzip.filesecure.azs',
+ 'azv' => 'image/vnd.airzip.accelerator.azv',
+ 'azw' => 'application/vnd.amazon.ebook',
+ 'b16' => 'image/vnd.pco.b16',
+ 'bat' => 'application/x-msdownload',
+ 'bcpio' => 'application/x-bcpio',
+ 'bdf' => 'application/x-font-bdf',
+ 'bdm' => 'application/vnd.syncml.dm+wbxml',
+ 'bdoc' => 'application/x-bdoc',
+ 'bed' => 'application/vnd.realvnc.bed',
+ 'bh2' => 'application/vnd.fujitsu.oasysprs',
+ 'bin' => 'application/octet-stream',
+ 'blb' => 'application/x-blorb',
+ 'blorb' => 'application/x-blorb',
+ 'bmi' => 'application/vnd.bmi',
+ 'bmml' => 'application/vnd.balsamiq.bmml+xml',
+ 'bmp' => 'image/bmp',
+ 'book' => 'application/vnd.framemaker',
+ 'box' => 'application/vnd.previewsystems.box',
+ 'boz' => 'application/x-bzip2',
+ 'bpk' => 'application/octet-stream',
+ 'bpmn' => 'application/octet-stream',
+ 'bsp' => 'model/vnd.valve.source.compiled-map',
+ 'btif' => 'image/prs.btif',
+ 'buffer' => 'application/octet-stream',
+ 'bz' => 'application/x-bzip',
+ 'bz2' => 'application/x-bzip2',
+ 'c' => 'text/x-c',
+ 'c4d' => 'application/vnd.clonk.c4group',
+ 'c4f' => 'application/vnd.clonk.c4group',
+ 'c4g' => 'application/vnd.clonk.c4group',
+ 'c4p' => 'application/vnd.clonk.c4group',
+ 'c4u' => 'application/vnd.clonk.c4group',
+ 'c11amc' => 'application/vnd.cluetrust.cartomobile-config',
+ 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg',
+ 'cab' => 'application/vnd.ms-cab-compressed',
+ 'caf' => 'audio/x-caf',
+ 'cap' => 'application/vnd.tcpdump.pcap',
+ 'car' => 'application/vnd.curl.car',
+ 'cat' => 'application/vnd.ms-pki.seccat',
+ 'cb7' => 'application/x-cbr',
+ 'cba' => 'application/x-cbr',
+ 'cbr' => 'application/x-cbr',
+ 'cbt' => 'application/x-cbr',
+ 'cbz' => 'application/x-cbr',
+ 'cc' => 'text/x-c',
+ 'cco' => 'application/x-cocoa',
+ 'cct' => 'application/x-director',
+ 'ccxml' => 'application/ccxml+xml',
+ 'cdbcmsg' => 'application/vnd.contact.cmsg',
+ 'cdf' => 'application/x-netcdf',
+ 'cdfx' => 'application/cdfx+xml',
+ 'cdkey' => 'application/vnd.mediastation.cdkey',
+ 'cdmia' => 'application/cdmi-capability',
+ 'cdmic' => 'application/cdmi-container',
+ 'cdmid' => 'application/cdmi-domain',
+ 'cdmio' => 'application/cdmi-object',
+ 'cdmiq' => 'application/cdmi-queue',
+ 'cdr' => 'application/cdr',
+ 'cdx' => 'chemical/x-cdx',
+ 'cdxml' => 'application/vnd.chemdraw+xml',
+ 'cdy' => 'application/vnd.cinderella',
+ 'cer' => 'application/pkix-cert',
+ 'cfs' => 'application/x-cfs-compressed',
+ 'cgm' => 'image/cgm',
+ 'chat' => 'application/x-chat',
+ 'chm' => 'application/vnd.ms-htmlhelp',
+ 'chrt' => 'application/vnd.kde.kchart',
+ 'cif' => 'chemical/x-cif',
+ 'cii' => 'application/vnd.anser-web-certificate-issue-initiation',
+ 'cil' => 'application/vnd.ms-artgalry',
+ 'cjs' => 'application/node',
+ 'cla' => 'application/vnd.claymore',
+ 'class' => 'application/octet-stream',
+ 'clkk' => 'application/vnd.crick.clicker.keyboard',
+ 'clkp' => 'application/vnd.crick.clicker.palette',
+ 'clkt' => 'application/vnd.crick.clicker.template',
+ 'clkw' => 'application/vnd.crick.clicker.wordbank',
+ 'clkx' => 'application/vnd.crick.clicker',
+ 'clp' => 'application/x-msclip',
+ 'cmc' => 'application/vnd.cosmocaller',
+ 'cmdf' => 'chemical/x-cmdf',
+ 'cml' => 'chemical/x-cml',
+ 'cmp' => 'application/vnd.yellowriver-custom-menu',
+ 'cmx' => 'image/x-cmx',
+ 'cod' => 'application/vnd.rim.cod',
+ 'coffee' => 'text/coffeescript',
+ 'com' => 'application/x-msdownload',
+ 'conf' => 'text/plain',
+ 'cpio' => 'application/x-cpio',
+ 'cpl' => 'application/cpl+xml',
+ 'cpp' => 'text/x-c',
+ 'cpt' => 'application/mac-compactpro',
+ 'crd' => 'application/x-mscardfile',
+ 'crl' => 'application/pkix-crl',
+ 'crt' => 'application/x-x509-ca-cert',
+ 'crx' => 'application/x-chrome-extension',
+ 'cryptonote' => 'application/vnd.rig.cryptonote',
+ 'csh' => 'application/x-csh',
+ 'csl' => 'application/vnd.citationstyles.style+xml',
+ 'csml' => 'chemical/x-csml',
+ 'csp' => 'application/vnd.commonspace',
+ 'csr' => 'application/octet-stream',
+ 'css' => 'text/css',
+ 'cst' => 'application/x-director',
+ 'csv' => 'text/csv',
+ 'cu' => 'application/cu-seeme',
+ 'curl' => 'text/vnd.curl',
+ 'cww' => 'application/prs.cww',
+ 'cxt' => 'application/x-director',
+ 'cxx' => 'text/x-c',
+ 'dae' => 'model/vnd.collada+xml',
+ 'daf' => 'application/vnd.mobius.daf',
+ 'dart' => 'application/vnd.dart',
+ 'dataless' => 'application/vnd.fdsn.seed',
+ 'davmount' => 'application/davmount+xml',
+ 'dbf' => 'application/vnd.dbf',
+ 'dbk' => 'application/docbook+xml',
+ 'dcr' => 'application/x-director',
+ 'dcurl' => 'text/vnd.curl.dcurl',
+ 'dd2' => 'application/vnd.oma.dd2+xml',
+ 'ddd' => 'application/vnd.fujixerox.ddd',
+ 'ddf' => 'application/vnd.syncml.dmddf+xml',
+ 'dds' => 'image/vnd.ms-dds',
+ 'deb' => 'application/x-debian-package',
+ 'def' => 'text/plain',
+ 'deploy' => 'application/octet-stream',
+ 'der' => 'application/x-x509-ca-cert',
+ 'dfac' => 'application/vnd.dreamfactory',
+ 'dgc' => 'application/x-dgc-compressed',
+ 'dic' => 'text/x-c',
+ 'dir' => 'application/x-director',
+ 'dis' => 'application/vnd.mobius.dis',
+ 'disposition-notification' => 'message/disposition-notification',
+ 'dist' => 'application/octet-stream',
+ 'distz' => 'application/octet-stream',
+ 'djv' => 'image/vnd.djvu',
+ 'djvu' => 'image/vnd.djvu',
+ 'dll' => 'application/octet-stream',
+ 'dmg' => 'application/x-apple-diskimage',
+ 'dmn' => 'application/octet-stream',
+ 'dmp' => 'application/vnd.tcpdump.pcap',
+ 'dms' => 'application/octet-stream',
+ 'dna' => 'application/vnd.dna',
+ 'doc' => 'application/msword',
+ 'docm' => 'application/vnd.ms-word.template.macroEnabled.12',
+ 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ 'dot' => 'application/msword',
+ 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
+ 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
+ 'dp' => 'application/vnd.osgi.dp',
+ 'dpg' => 'application/vnd.dpgraph',
+ 'dra' => 'audio/vnd.dra',
+ 'drle' => 'image/dicom-rle',
+ 'dsc' => 'text/prs.lines.tag',
+ 'dssc' => 'application/dssc+der',
+ 'dtb' => 'application/x-dtbook+xml',
+ 'dtd' => 'application/xml-dtd',
+ 'dts' => 'audio/vnd.dts',
+ 'dtshd' => 'audio/vnd.dts.hd',
+ 'dump' => 'application/octet-stream',
+ 'dvb' => 'video/vnd.dvb.file',
+ 'dvi' => 'application/x-dvi',
+ 'dwd' => 'application/atsc-dwd+xml',
+ 'dwf' => 'model/vnd.dwf',
+ 'dwg' => 'image/vnd.dwg',
+ 'dxf' => 'image/vnd.dxf',
+ 'dxp' => 'application/vnd.spotfire.dxp',
+ 'dxr' => 'application/x-director',
+ 'ear' => 'application/java-archive',
+ 'ecelp4800' => 'audio/vnd.nuera.ecelp4800',
+ 'ecelp7470' => 'audio/vnd.nuera.ecelp7470',
+ 'ecelp9600' => 'audio/vnd.nuera.ecelp9600',
+ 'ecma' => 'application/ecmascript',
+ 'edm' => 'application/vnd.novadigm.edm',
+ 'edx' => 'application/vnd.novadigm.edx',
+ 'efif' => 'application/vnd.picsel',
+ 'ei6' => 'application/vnd.pg.osasli',
+ 'elc' => 'application/octet-stream',
+ 'emf' => 'image/emf',
+ 'eml' => 'message/rfc822',
+ 'emma' => 'application/emma+xml',
+ 'emotionml' => 'application/emotionml+xml',
+ 'emz' => 'application/x-msmetafile',
+ 'eol' => 'audio/vnd.digital-winds',
+ 'eot' => 'application/vnd.ms-fontobject',
+ 'eps' => 'application/postscript',
+ 'epub' => 'application/epub+zip',
+ 'es' => 'application/ecmascript',
+ 'es3' => 'application/vnd.eszigno3+xml',
+ 'esa' => 'application/vnd.osgi.subsystem',
+ 'esf' => 'application/vnd.epson.esf',
+ 'et3' => 'application/vnd.eszigno3+xml',
+ 'etx' => 'text/x-setext',
+ 'eva' => 'application/x-eva',
+ 'evy' => 'application/x-envoy',
+ 'exe' => 'application/octet-stream',
+ 'exi' => 'application/exi',
+ 'exp' => 'application/express',
+ 'exr' => 'image/aces',
+ 'ext' => 'application/vnd.novadigm.ext',
+ 'ez' => 'application/andrew-inset',
+ 'ez2' => 'application/vnd.ezpix-album',
+ 'ez3' => 'application/vnd.ezpix-package',
+ 'f' => 'text/x-fortran',
+ 'f4v' => 'video/mp4',
+ 'f77' => 'text/x-fortran',
+ 'f90' => 'text/x-fortran',
+ 'fbs' => 'image/vnd.fastbidsheet',
+ 'fcdt' => 'application/vnd.adobe.formscentral.fcdt',
+ 'fcs' => 'application/vnd.isac.fcs',
+ 'fdf' => 'application/vnd.fdf',
+ 'fdt' => 'application/fdt+xml',
+ 'fe_launch' => 'application/vnd.denovo.fcselayout-link',
+ 'fg5' => 'application/vnd.fujitsu.oasysgp',
+ 'fgd' => 'application/x-director',
+ 'fh' => 'image/x-freehand',
+ 'fh4' => 'image/x-freehand',
+ 'fh5' => 'image/x-freehand',
+ 'fh7' => 'image/x-freehand',
+ 'fhc' => 'image/x-freehand',
+ 'fig' => 'application/x-xfig',
+ 'fits' => 'image/fits',
+ 'flac' => 'audio/x-flac',
+ 'fli' => 'video/x-fli',
+ 'flo' => 'application/vnd.micrografx.flo',
+ 'flv' => 'video/x-flv',
+ 'flw' => 'application/vnd.kde.kivio',
+ 'flx' => 'text/vnd.fmi.flexstor',
+ 'fly' => 'text/vnd.fly',
+ 'fm' => 'application/vnd.framemaker',
+ 'fnc' => 'application/vnd.frogans.fnc',
+ 'fo' => 'application/vnd.software602.filler.form+xml',
+ 'for' => 'text/x-fortran',
+ 'fpx' => 'image/vnd.fpx',
+ 'frame' => 'application/vnd.framemaker',
+ 'fsc' => 'application/vnd.fsc.weblaunch',
+ 'fst' => 'image/vnd.fst',
+ 'ftc' => 'application/vnd.fluxtime.clip',
+ 'fti' => 'application/vnd.anser-web-funds-transfer-initiation',
+ 'fvt' => 'video/vnd.fvt',
+ 'fxp' => 'application/vnd.adobe.fxp',
+ 'fxpl' => 'application/vnd.adobe.fxp',
+ 'fzs' => 'application/vnd.fuzzysheet',
+ 'g2w' => 'application/vnd.geoplan',
+ 'g3' => 'image/g3fax',
+ 'g3w' => 'application/vnd.geospace',
+ 'gac' => 'application/vnd.groove-account',
+ 'gam' => 'application/x-tads',
+ 'gbr' => 'application/rpki-ghostbusters',
+ 'gca' => 'application/x-gca-compressed',
+ 'gdl' => 'model/vnd.gdl',
+ 'gdoc' => 'application/vnd.google-apps.document',
+ 'ged' => 'text/vnd.familysearch.gedcom',
+ 'geo' => 'application/vnd.dynageo',
+ 'geojson' => 'application/geo+json',
+ 'gex' => 'application/vnd.geometry-explorer',
+ 'ggb' => 'application/vnd.geogebra.file',
+ 'ggt' => 'application/vnd.geogebra.tool',
+ 'ghf' => 'application/vnd.groove-help',
+ 'gif' => 'image/gif',
+ 'gim' => 'application/vnd.groove-identity-message',
+ 'glb' => 'model/gltf-binary',
+ 'gltf' => 'model/gltf+json',
+ 'gml' => 'application/gml+xml',
+ 'gmx' => 'application/vnd.gmx',
+ 'gnumeric' => 'application/x-gnumeric',
+ 'gpg' => 'application/gpg-keys',
+ 'gph' => 'application/vnd.flographit',
+ 'gpx' => 'application/gpx+xml',
+ 'gqf' => 'application/vnd.grafeq',
+ 'gqs' => 'application/vnd.grafeq',
+ 'gram' => 'application/srgs',
+ 'gramps' => 'application/x-gramps-xml',
+ 'gre' => 'application/vnd.geometry-explorer',
+ 'grv' => 'application/vnd.groove-injector',
+ 'grxml' => 'application/srgs+xml',
+ 'gsf' => 'application/x-font-ghostscript',
+ 'gsheet' => 'application/vnd.google-apps.spreadsheet',
+ 'gslides' => 'application/vnd.google-apps.presentation',
+ 'gtar' => 'application/x-gtar',
+ 'gtm' => 'application/vnd.groove-tool-message',
+ 'gtw' => 'model/vnd.gtw',
+ 'gv' => 'text/vnd.graphviz',
+ 'gxf' => 'application/gxf',
+ 'gxt' => 'application/vnd.geonext',
+ 'gz' => 'application/gzip',
+ 'gzip' => 'application/gzip',
+ 'h' => 'text/x-c',
+ 'h261' => 'video/h261',
+ 'h263' => 'video/h263',
+ 'h264' => 'video/h264',
+ 'hal' => 'application/vnd.hal+xml',
+ 'hbci' => 'application/vnd.hbci',
+ 'hbs' => 'text/x-handlebars-template',
+ 'hdd' => 'application/x-virtualbox-hdd',
+ 'hdf' => 'application/x-hdf',
+ 'heic' => 'image/heic',
+ 'heics' => 'image/heic-sequence',
+ 'heif' => 'image/heif',
+ 'heifs' => 'image/heif-sequence',
+ 'hej2' => 'image/hej2k',
+ 'held' => 'application/atsc-held+xml',
+ 'hh' => 'text/x-c',
+ 'hjson' => 'application/hjson',
+ 'hlp' => 'application/winhlp',
+ 'hpgl' => 'application/vnd.hp-hpgl',
+ 'hpid' => 'application/vnd.hp-hpid',
+ 'hps' => 'application/vnd.hp-hps',
+ 'hqx' => 'application/mac-binhex40',
+ 'hsj2' => 'image/hsj2',
+ 'htc' => 'text/x-component',
+ 'htke' => 'application/vnd.kenameaapp',
+ 'htm' => 'text/html',
+ 'html' => 'text/html',
+ 'hvd' => 'application/vnd.yamaha.hv-dic',
+ 'hvp' => 'application/vnd.yamaha.hv-voice',
+ 'hvs' => 'application/vnd.yamaha.hv-script',
+ 'i2g' => 'application/vnd.intergeo',
+ 'icc' => 'application/vnd.iccprofile',
+ 'ice' => 'x-conference/x-cooltalk',
+ 'icm' => 'application/vnd.iccprofile',
+ 'ico' => 'image/x-icon',
+ 'ics' => 'text/calendar',
+ 'ief' => 'image/ief',
+ 'ifb' => 'text/calendar',
+ 'ifm' => 'application/vnd.shana.informed.formdata',
+ 'iges' => 'model/iges',
+ 'igl' => 'application/vnd.igloader',
+ 'igm' => 'application/vnd.insors.igm',
+ 'igs' => 'model/iges',
+ 'igx' => 'application/vnd.micrografx.igx',
+ 'iif' => 'application/vnd.shana.informed.interchange',
+ 'img' => 'application/octet-stream',
+ 'imp' => 'application/vnd.accpac.simply.imp',
+ 'ims' => 'application/vnd.ms-ims',
+ 'in' => 'text/plain',
+ 'ini' => 'text/plain',
+ 'ink' => 'application/inkml+xml',
+ 'inkml' => 'application/inkml+xml',
+ 'install' => 'application/x-install-instructions',
+ 'iota' => 'application/vnd.astraea-software.iota',
+ 'ipfix' => 'application/ipfix',
+ 'ipk' => 'application/vnd.shana.informed.package',
+ 'irm' => 'application/vnd.ibm.rights-management',
+ 'irp' => 'application/vnd.irepository.package+xml',
+ 'iso' => 'application/x-iso9660-image',
+ 'itp' => 'application/vnd.shana.informed.formtemplate',
+ 'its' => 'application/its+xml',
+ 'ivp' => 'application/vnd.immervision-ivp',
+ 'ivu' => 'application/vnd.immervision-ivu',
+ 'jad' => 'text/vnd.sun.j2me.app-descriptor',
+ 'jade' => 'text/jade',
+ 'jam' => 'application/vnd.jam',
+ 'jar' => 'application/java-archive',
+ 'jardiff' => 'application/x-java-archive-diff',
+ 'java' => 'text/x-java-source',
+ 'jhc' => 'image/jphc',
+ 'jisp' => 'application/vnd.jisp',
+ 'jls' => 'image/jls',
+ 'jlt' => 'application/vnd.hp-jlyt',
+ 'jng' => 'image/x-jng',
+ 'jnlp' => 'application/x-java-jnlp-file',
+ 'joda' => 'application/vnd.joost.joda-archive',
+ 'jp2' => 'image/jp2',
+ 'jpe' => 'image/jpeg',
+ 'jpeg' => 'image/jpeg',
+ 'jpf' => 'image/jpx',
+ 'jpg' => 'image/jpeg',
+ 'jpg2' => 'image/jp2',
+ 'jpgm' => 'video/jpm',
+ 'jpgv' => 'video/jpeg',
+ 'jph' => 'image/jph',
+ 'jpm' => 'video/jpm',
+ 'jpx' => 'image/jpx',
+ 'js' => 'application/javascript',
+ 'json' => 'application/json',
+ 'json5' => 'application/json5',
+ 'jsonld' => 'application/ld+json',
+ 'jsonml' => 'application/jsonml+json',
+ 'jsx' => 'text/jsx',
+ 'jxr' => 'image/jxr',
+ 'jxra' => 'image/jxra',
+ 'jxrs' => 'image/jxrs',
+ 'jxs' => 'image/jxs',
+ 'jxsc' => 'image/jxsc',
+ 'jxsi' => 'image/jxsi',
+ 'jxss' => 'image/jxss',
+ 'kar' => 'audio/midi',
+ 'karbon' => 'application/vnd.kde.karbon',
+ 'kdb' => 'application/octet-stream',
+ 'kdbx' => 'application/x-keepass2',
+ 'key' => 'application/x-iwork-keynote-sffkey',
+ 'kfo' => 'application/vnd.kde.kformula',
+ 'kia' => 'application/vnd.kidspiration',
+ 'kml' => 'application/vnd.google-earth.kml+xml',
+ 'kmz' => 'application/vnd.google-earth.kmz',
+ 'kne' => 'application/vnd.kinar',
+ 'knp' => 'application/vnd.kinar',
+ 'kon' => 'application/vnd.kde.kontour',
+ 'kpr' => 'application/vnd.kde.kpresenter',
+ 'kpt' => 'application/vnd.kde.kpresenter',
+ 'kpxx' => 'application/vnd.ds-keypoint',
+ 'ksp' => 'application/vnd.kde.kspread',
+ 'ktr' => 'application/vnd.kahootz',
+ 'ktx' => 'image/ktx',
+ 'ktx2' => 'image/ktx2',
+ 'ktz' => 'application/vnd.kahootz',
+ 'kwd' => 'application/vnd.kde.kword',
+ 'kwt' => 'application/vnd.kde.kword',
+ 'lasxml' => 'application/vnd.las.las+xml',
+ 'latex' => 'application/x-latex',
+ 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop',
+ 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml',
+ 'les' => 'application/vnd.hhe.lesson-player',
+ 'less' => 'text/less',
+ 'lgr' => 'application/lgr+xml',
+ 'lha' => 'application/octet-stream',
+ 'link66' => 'application/vnd.route66.link66+xml',
+ 'list' => 'text/plain',
+ 'list3820' => 'application/vnd.ibm.modcap',
+ 'listafp' => 'application/vnd.ibm.modcap',
+ 'litcoffee' => 'text/coffeescript',
+ 'lnk' => 'application/x-ms-shortcut',
+ 'log' => 'text/plain',
+ 'lostxml' => 'application/lost+xml',
+ 'lrf' => 'application/octet-stream',
+ 'lrm' => 'application/vnd.ms-lrm',
+ 'ltf' => 'application/vnd.frogans.ltf',
+ 'lua' => 'text/x-lua',
+ 'luac' => 'application/x-lua-bytecode',
+ 'lvp' => 'audio/vnd.lucent.voice',
+ 'lwp' => 'application/vnd.lotus-wordpro',
+ 'lzh' => 'application/octet-stream',
+ 'm1v' => 'video/mpeg',
+ 'm2a' => 'audio/mpeg',
+ 'm2v' => 'video/mpeg',
+ 'm3a' => 'audio/mpeg',
+ 'm3u' => 'text/plain',
+ 'm3u8' => 'application/vnd.apple.mpegurl',
+ 'm4a' => 'audio/x-m4a',
+ 'm4p' => 'application/mp4',
+ 'm4s' => 'video/iso.segment',
+ 'm4u' => 'application/vnd.mpegurl',
+ 'm4v' => 'video/x-m4v',
+ 'm13' => 'application/x-msmediaview',
+ 'm14' => 'application/x-msmediaview',
+ 'm21' => 'application/mp21',
+ 'ma' => 'application/mathematica',
+ 'mads' => 'application/mads+xml',
+ 'maei' => 'application/mmt-aei+xml',
+ 'mag' => 'application/vnd.ecowin.chart',
+ 'maker' => 'application/vnd.framemaker',
+ 'man' => 'text/troff',
+ 'manifest' => 'text/cache-manifest',
+ 'map' => 'application/json',
+ 'mar' => 'application/octet-stream',
+ 'markdown' => 'text/markdown',
+ 'mathml' => 'application/mathml+xml',
+ 'mb' => 'application/mathematica',
+ 'mbk' => 'application/vnd.mobius.mbk',
+ 'mbox' => 'application/mbox',
+ 'mc1' => 'application/vnd.medcalcdata',
+ 'mcd' => 'application/vnd.mcd',
+ 'mcurl' => 'text/vnd.curl.mcurl',
+ 'md' => 'text/markdown',
+ 'mdb' => 'application/x-msaccess',
+ 'mdi' => 'image/vnd.ms-modi',
+ 'mdx' => 'text/mdx',
+ 'me' => 'text/troff',
+ 'mesh' => 'model/mesh',
+ 'meta4' => 'application/metalink4+xml',
+ 'metalink' => 'application/metalink+xml',
+ 'mets' => 'application/mets+xml',
+ 'mfm' => 'application/vnd.mfmp',
+ 'mft' => 'application/rpki-manifest',
+ 'mgp' => 'application/vnd.osgeo.mapguide.package',
+ 'mgz' => 'application/vnd.proteus.magazine',
+ 'mid' => 'audio/midi',
+ 'midi' => 'audio/midi',
+ 'mie' => 'application/x-mie',
+ 'mif' => 'application/vnd.mif',
+ 'mime' => 'message/rfc822',
+ 'mj2' => 'video/mj2',
+ 'mjp2' => 'video/mj2',
+ 'mjs' => 'application/javascript',
+ 'mk3d' => 'video/x-matroska',
+ 'mka' => 'audio/x-matroska',
+ 'mkd' => 'text/x-markdown',
+ 'mks' => 'video/x-matroska',
+ 'mkv' => 'video/x-matroska',
+ 'mlp' => 'application/vnd.dolby.mlp',
+ 'mmd' => 'application/vnd.chipnuts.karaoke-mmd',
+ 'mmf' => 'application/vnd.smaf',
+ 'mml' => 'text/mathml',
+ 'mmr' => 'image/vnd.fujixerox.edmics-mmr',
+ 'mng' => 'video/x-mng',
+ 'mny' => 'application/x-msmoney',
+ 'mobi' => 'application/x-mobipocket-ebook',
+ 'mods' => 'application/mods+xml',
+ 'mov' => 'video/quicktime',
+ 'movie' => 'video/x-sgi-movie',
+ 'mp2' => 'audio/mpeg',
+ 'mp2a' => 'audio/mpeg',
+ 'mp3' => 'audio/mpeg',
+ 'mp4' => 'video/mp4',
+ 'mp4a' => 'audio/mp4',
+ 'mp4s' => 'application/mp4',
+ 'mp4v' => 'video/mp4',
+ 'mp21' => 'application/mp21',
+ 'mpc' => 'application/vnd.mophun.certificate',
+ 'mpd' => 'application/dash+xml',
+ 'mpe' => 'video/mpeg',
+ 'mpeg' => 'video/mpeg',
+ 'mpf' => 'application/media-policy-dataset+xml',
+ 'mpg' => 'video/mpeg',
+ 'mpg4' => 'video/mp4',
+ 'mpga' => 'audio/mpeg',
+ 'mpkg' => 'application/vnd.apple.installer+xml',
+ 'mpm' => 'application/vnd.blueice.multipass',
+ 'mpn' => 'application/vnd.mophun.application',
+ 'mpp' => 'application/vnd.ms-project',
+ 'mpt' => 'application/vnd.ms-project',
+ 'mpy' => 'application/vnd.ibm.minipay',
+ 'mqy' => 'application/vnd.mobius.mqy',
+ 'mrc' => 'application/marc',
+ 'mrcx' => 'application/marcxml+xml',
+ 'ms' => 'text/troff',
+ 'mscml' => 'application/mediaservercontrol+xml',
+ 'mseed' => 'application/vnd.fdsn.mseed',
+ 'mseq' => 'application/vnd.mseq',
+ 'msf' => 'application/vnd.epson.msf',
+ 'msg' => 'application/vnd.ms-outlook',
+ 'msh' => 'model/mesh',
+ 'msi' => 'application/x-msdownload',
+ 'msl' => 'application/vnd.mobius.msl',
+ 'msm' => 'application/octet-stream',
+ 'msp' => 'application/octet-stream',
+ 'msty' => 'application/vnd.muvee.style',
+ 'mtl' => 'model/mtl',
+ 'mts' => 'model/vnd.mts',
+ 'mus' => 'application/vnd.musician',
+ 'musd' => 'application/mmt-usd+xml',
+ 'musicxml' => 'application/vnd.recordare.musicxml+xml',
+ 'mvb' => 'application/x-msmediaview',
+ 'mvt' => 'application/vnd.mapbox-vector-tile',
+ 'mwf' => 'application/vnd.mfer',
+ 'mxf' => 'application/mxf',
+ 'mxl' => 'application/vnd.recordare.musicxml',
+ 'mxmf' => 'audio/mobile-xmf',
+ 'mxml' => 'application/xv+xml',
+ 'mxs' => 'application/vnd.triscape.mxs',
+ 'mxu' => 'video/vnd.mpegurl',
+ 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install',
+ 'n3' => 'text/n3',
+ 'nb' => 'application/mathematica',
+ 'nbp' => 'application/vnd.wolfram.player',
+ 'nc' => 'application/x-netcdf',
+ 'ncx' => 'application/x-dtbncx+xml',
+ 'nfo' => 'text/x-nfo',
+ 'ngdat' => 'application/vnd.nokia.n-gage.data',
+ 'nitf' => 'application/vnd.nitf',
+ 'nlu' => 'application/vnd.neurolanguage.nlu',
+ 'nml' => 'application/vnd.enliven',
+ 'nnd' => 'application/vnd.noblenet-directory',
+ 'nns' => 'application/vnd.noblenet-sealer',
+ 'nnw' => 'application/vnd.noblenet-web',
+ 'npx' => 'image/vnd.net-fpx',
+ 'nq' => 'application/n-quads',
+ 'nsc' => 'application/x-conference',
+ 'nsf' => 'application/vnd.lotus-notes',
+ 'nt' => 'application/n-triples',
+ 'ntf' => 'application/vnd.nitf',
+ 'numbers' => 'application/x-iwork-numbers-sffnumbers',
+ 'nzb' => 'application/x-nzb',
+ 'oa2' => 'application/vnd.fujitsu.oasys2',
+ 'oa3' => 'application/vnd.fujitsu.oasys3',
+ 'oas' => 'application/vnd.fujitsu.oasys',
+ 'obd' => 'application/x-msbinder',
+ 'obgx' => 'application/vnd.openblox.game+xml',
+ 'obj' => 'model/obj',
+ 'oda' => 'application/oda',
+ 'odb' => 'application/vnd.oasis.opendocument.database',
+ 'odc' => 'application/vnd.oasis.opendocument.chart',
+ 'odf' => 'application/vnd.oasis.opendocument.formula',
+ 'odft' => 'application/vnd.oasis.opendocument.formula-template',
+ 'odg' => 'application/vnd.oasis.opendocument.graphics',
+ 'odi' => 'application/vnd.oasis.opendocument.image',
+ 'odm' => 'application/vnd.oasis.opendocument.text-master',
+ 'odp' => 'application/vnd.oasis.opendocument.presentation',
+ 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
+ 'odt' => 'application/vnd.oasis.opendocument.text',
+ 'oga' => 'audio/ogg',
+ 'ogex' => 'model/vnd.opengex',
+ 'ogg' => 'audio/ogg',
+ 'ogv' => 'video/ogg',
+ 'ogx' => 'application/ogg',
+ 'omdoc' => 'application/omdoc+xml',
+ 'onepkg' => 'application/onenote',
+ 'onetmp' => 'application/onenote',
+ 'onetoc' => 'application/onenote',
+ 'onetoc2' => 'application/onenote',
+ 'opf' => 'application/oebps-package+xml',
+ 'opml' => 'text/x-opml',
+ 'oprc' => 'application/vnd.palm',
+ 'opus' => 'audio/ogg',
+ 'org' => 'text/x-org',
+ 'osf' => 'application/vnd.yamaha.openscoreformat',
+ 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml',
+ 'osm' => 'application/vnd.openstreetmap.data+xml',
+ 'otc' => 'application/vnd.oasis.opendocument.chart-template',
+ 'otf' => 'font/otf',
+ 'otg' => 'application/vnd.oasis.opendocument.graphics-template',
+ 'oth' => 'application/vnd.oasis.opendocument.text-web',
+ 'oti' => 'application/vnd.oasis.opendocument.image-template',
+ 'otp' => 'application/vnd.oasis.opendocument.presentation-template',
+ 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
+ 'ott' => 'application/vnd.oasis.opendocument.text-template',
+ 'ova' => 'application/x-virtualbox-ova',
+ 'ovf' => 'application/x-virtualbox-ovf',
+ 'owl' => 'application/rdf+xml',
+ 'oxps' => 'application/oxps',
+ 'oxt' => 'application/vnd.openofficeorg.extension',
+ 'p' => 'text/x-pascal',
+ 'p7a' => 'application/x-pkcs7-signature',
+ 'p7b' => 'application/x-pkcs7-certificates',
+ 'p7c' => 'application/pkcs7-mime',
+ 'p7m' => 'application/pkcs7-mime',
+ 'p7r' => 'application/x-pkcs7-certreqresp',
+ 'p7s' => 'application/pkcs7-signature',
+ 'p8' => 'application/pkcs8',
+ 'p10' => 'application/x-pkcs10',
+ 'p12' => 'application/x-pkcs12',
+ 'pac' => 'application/x-ns-proxy-autoconfig',
+ 'pages' => 'application/x-iwork-pages-sffpages',
+ 'pas' => 'text/x-pascal',
+ 'paw' => 'application/vnd.pawaafile',
+ 'pbd' => 'application/vnd.powerbuilder6',
+ 'pbm' => 'image/x-portable-bitmap',
+ 'pcap' => 'application/vnd.tcpdump.pcap',
+ 'pcf' => 'application/x-font-pcf',
+ 'pcl' => 'application/vnd.hp-pcl',
+ 'pclxl' => 'application/vnd.hp-pclxl',
+ 'pct' => 'image/x-pict',
+ 'pcurl' => 'application/vnd.curl.pcurl',
+ 'pcx' => 'image/x-pcx',
+ 'pdb' => 'application/x-pilot',
+ 'pde' => 'text/x-processing',
+ 'pdf' => 'application/pdf',
+ 'pem' => 'application/x-x509-user-cert',
+ 'pfa' => 'application/x-font-type1',
+ 'pfb' => 'application/x-font-type1',
+ 'pfm' => 'application/x-font-type1',
+ 'pfr' => 'application/font-tdpfr',
+ 'pfx' => 'application/x-pkcs12',
+ 'pgm' => 'image/x-portable-graymap',
+ 'pgn' => 'application/x-chess-pgn',
+ 'pgp' => 'application/pgp',
+ 'phar' => 'application/octet-stream',
+ 'php' => 'application/x-httpd-php',
+ 'php3' => 'application/x-httpd-php',
+ 'php4' => 'application/x-httpd-php',
+ 'phps' => 'application/x-httpd-php-source',
+ 'phtml' => 'application/x-httpd-php',
+ 'pic' => 'image/x-pict',
+ 'pkg' => 'application/octet-stream',
+ 'pki' => 'application/pkixcmp',
+ 'pkipath' => 'application/pkix-pkipath',
+ 'pkpass' => 'application/vnd.apple.pkpass',
+ 'pl' => 'application/x-perl',
+ 'plb' => 'application/vnd.3gpp.pic-bw-large',
+ 'plc' => 'application/vnd.mobius.plc',
+ 'plf' => 'application/vnd.pocketlearn',
+ 'pls' => 'application/pls+xml',
+ 'pm' => 'application/x-perl',
+ 'pml' => 'application/vnd.ctc-posml',
+ 'png' => 'image/png',
+ 'pnm' => 'image/x-portable-anymap',
+ 'portpkg' => 'application/vnd.macports.portpkg',
+ 'pot' => 'application/vnd.ms-powerpoint',
+ 'potm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
+ 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
+ 'ppa' => 'application/vnd.ms-powerpoint',
+ 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
+ 'ppd' => 'application/vnd.cups-ppd',
+ 'ppm' => 'image/x-portable-pixmap',
+ 'pps' => 'application/vnd.ms-powerpoint',
+ 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
+ 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
+ 'ppt' => 'application/powerpoint',
+ 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
+ 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+ 'pqa' => 'application/vnd.palm',
+ 'prc' => 'model/prc',
+ 'pre' => 'application/vnd.lotus-freelance',
+ 'prf' => 'application/pics-rules',
+ 'provx' => 'application/provenance+xml',
+ 'ps' => 'application/postscript',
+ 'psb' => 'application/vnd.3gpp.pic-bw-small',
+ 'psd' => 'application/x-photoshop',
+ 'psf' => 'application/x-font-linux-psf',
+ 'pskcxml' => 'application/pskc+xml',
+ 'pti' => 'image/prs.pti',
+ 'ptid' => 'application/vnd.pvi.ptid1',
+ 'pub' => 'application/x-mspublisher',
+ 'pvb' => 'application/vnd.3gpp.pic-bw-var',
+ 'pwn' => 'application/vnd.3m.post-it-notes',
+ 'pya' => 'audio/vnd.ms-playready.media.pya',
+ 'pyv' => 'video/vnd.ms-playready.media.pyv',
+ 'qam' => 'application/vnd.epson.quickanime',
+ 'qbo' => 'application/vnd.intu.qbo',
+ 'qfx' => 'application/vnd.intu.qfx',
+ 'qps' => 'application/vnd.publishare-delta-tree',
+ 'qt' => 'video/quicktime',
+ 'qwd' => 'application/vnd.quark.quarkxpress',
+ 'qwt' => 'application/vnd.quark.quarkxpress',
+ 'qxb' => 'application/vnd.quark.quarkxpress',
+ 'qxd' => 'application/vnd.quark.quarkxpress',
+ 'qxl' => 'application/vnd.quark.quarkxpress',
+ 'qxt' => 'application/vnd.quark.quarkxpress',
+ 'ra' => 'audio/x-realaudio',
+ 'ram' => 'audio/x-pn-realaudio',
+ 'raml' => 'application/raml+yaml',
+ 'rapd' => 'application/route-apd+xml',
+ 'rar' => 'application/x-rar',
+ 'ras' => 'image/x-cmu-raster',
+ 'rcprofile' => 'application/vnd.ipunplugged.rcprofile',
+ 'rdf' => 'application/rdf+xml',
+ 'rdz' => 'application/vnd.data-vision.rdz',
+ 'relo' => 'application/p2p-overlay+xml',
+ 'rep' => 'application/vnd.businessobjects',
+ 'res' => 'application/x-dtbresource+xml',
+ 'rgb' => 'image/x-rgb',
+ 'rif' => 'application/reginfo+xml',
+ 'rip' => 'audio/vnd.rip',
+ 'ris' => 'application/x-research-info-systems',
+ 'rl' => 'application/resource-lists+xml',
+ 'rlc' => 'image/vnd.fujixerox.edmics-rlc',
+ 'rld' => 'application/resource-lists-diff+xml',
+ 'rm' => 'audio/x-pn-realaudio',
+ 'rmi' => 'audio/midi',
+ 'rmp' => 'audio/x-pn-realaudio-plugin',
+ 'rms' => 'application/vnd.jcp.javame.midlet-rms',
+ 'rmvb' => 'application/vnd.rn-realmedia-vbr',
+ 'rnc' => 'application/relax-ng-compact-syntax',
+ 'rng' => 'application/xml',
+ 'roa' => 'application/rpki-roa',
+ 'roff' => 'text/troff',
+ 'rp9' => 'application/vnd.cloanto.rp9',
+ 'rpm' => 'audio/x-pn-realaudio-plugin',
+ 'rpss' => 'application/vnd.nokia.radio-presets',
+ 'rpst' => 'application/vnd.nokia.radio-preset',
+ 'rq' => 'application/sparql-query',
+ 'rs' => 'application/rls-services+xml',
+ 'rsa' => 'application/x-pkcs7',
+ 'rsat' => 'application/atsc-rsat+xml',
+ 'rsd' => 'application/rsd+xml',
+ 'rsheet' => 'application/urc-ressheet+xml',
+ 'rss' => 'application/rss+xml',
+ 'rtf' => 'text/rtf',
+ 'rtx' => 'text/richtext',
+ 'run' => 'application/x-makeself',
+ 'rusd' => 'application/route-usd+xml',
+ 'rv' => 'video/vnd.rn-realvideo',
+ 's' => 'text/x-asm',
+ 's3m' => 'audio/s3m',
+ 'saf' => 'application/vnd.yamaha.smaf-audio',
+ 'sass' => 'text/x-sass',
+ 'sbml' => 'application/sbml+xml',
+ 'sc' => 'application/vnd.ibm.secure-container',
+ 'scd' => 'application/x-msschedule',
+ 'scm' => 'application/vnd.lotus-screencam',
+ 'scq' => 'application/scvp-cv-request',
+ 'scs' => 'application/scvp-cv-response',
+ 'scss' => 'text/x-scss',
+ 'scurl' => 'text/vnd.curl.scurl',
+ 'sda' => 'application/vnd.stardivision.draw',
+ 'sdc' => 'application/vnd.stardivision.calc',
+ 'sdd' => 'application/vnd.stardivision.impress',
+ 'sdkd' => 'application/vnd.solent.sdkm+xml',
+ 'sdkm' => 'application/vnd.solent.sdkm+xml',
+ 'sdp' => 'application/sdp',
+ 'sdw' => 'application/vnd.stardivision.writer',
+ 'sea' => 'application/octet-stream',
+ 'see' => 'application/vnd.seemail',
+ 'seed' => 'application/vnd.fdsn.seed',
+ 'sema' => 'application/vnd.sema',
+ 'semd' => 'application/vnd.semd',
+ 'semf' => 'application/vnd.semf',
+ 'senmlx' => 'application/senml+xml',
+ 'sensmlx' => 'application/sensml+xml',
+ 'ser' => 'application/java-serialized-object',
+ 'setpay' => 'application/set-payment-initiation',
+ 'setreg' => 'application/set-registration-initiation',
+ 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data',
+ 'sfs' => 'application/vnd.spotfire.sfs',
+ 'sfv' => 'text/x-sfv',
+ 'sgi' => 'image/sgi',
+ 'sgl' => 'application/vnd.stardivision.writer-global',
+ 'sgm' => 'text/sgml',
+ 'sgml' => 'text/sgml',
+ 'sh' => 'application/x-sh',
+ 'shar' => 'application/x-shar',
+ 'shex' => 'text/shex',
+ 'shf' => 'application/shf+xml',
+ 'shtml' => 'text/html',
+ 'sid' => 'image/x-mrsid-image',
+ 'sieve' => 'application/sieve',
+ 'sig' => 'application/pgp-signature',
+ 'sil' => 'audio/silk',
+ 'silo' => 'model/mesh',
+ 'sis' => 'application/vnd.symbian.install',
+ 'sisx' => 'application/vnd.symbian.install',
+ 'sit' => 'application/x-stuffit',
+ 'sitx' => 'application/x-stuffitx',
+ 'siv' => 'application/sieve',
+ 'skd' => 'application/vnd.koan',
+ 'skm' => 'application/vnd.koan',
+ 'skp' => 'application/vnd.koan',
+ 'skt' => 'application/vnd.koan',
+ 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12',
+ 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
+ 'slim' => 'text/slim',
+ 'slm' => 'text/slim',
+ 'sls' => 'application/route-s-tsid+xml',
+ 'slt' => 'application/vnd.epson.salt',
+ 'sm' => 'application/vnd.stepmania.stepchart',
+ 'smf' => 'application/vnd.stardivision.math',
+ 'smi' => 'application/smil',
+ 'smil' => 'application/smil',
+ 'smv' => 'video/x-smv',
+ 'smzip' => 'application/vnd.stepmania.package',
+ 'snd' => 'audio/basic',
+ 'snf' => 'application/x-font-snf',
+ 'so' => 'application/octet-stream',
+ 'spc' => 'application/x-pkcs7-certificates',
+ 'spdx' => 'text/spdx',
+ 'spf' => 'application/vnd.yamaha.smaf-phrase',
+ 'spl' => 'application/x-futuresplash',
+ 'spot' => 'text/vnd.in3d.spot',
+ 'spp' => 'application/scvp-vp-response',
+ 'spq' => 'application/scvp-vp-request',
+ 'spx' => 'audio/ogg',
+ 'sql' => 'application/x-sql',
+ 'src' => 'application/x-wais-source',
+ 'srt' => 'application/x-subrip',
+ 'sru' => 'application/sru+xml',
+ 'srx' => 'application/sparql-results+xml',
+ 'ssdl' => 'application/ssdl+xml',
+ 'sse' => 'application/vnd.kodak-descriptor',
+ 'ssf' => 'application/vnd.epson.ssf',
+ 'ssml' => 'application/ssml+xml',
+ 'sst' => 'application/octet-stream',
+ 'st' => 'application/vnd.sailingtracker.track',
+ 'stc' => 'application/vnd.sun.xml.calc.template',
+ 'std' => 'application/vnd.sun.xml.draw.template',
+ 'stf' => 'application/vnd.wt.stf',
+ 'sti' => 'application/vnd.sun.xml.impress.template',
+ 'stk' => 'application/hyperstudio',
+ 'stl' => 'model/stl',
+ 'stpx' => 'model/step+xml',
+ 'stpxz' => 'model/step-xml+zip',
+ 'stpz' => 'model/step+zip',
+ 'str' => 'application/vnd.pg.format',
+ 'stw' => 'application/vnd.sun.xml.writer.template',
+ 'styl' => 'text/stylus',
+ 'stylus' => 'text/stylus',
+ 'sub' => 'text/vnd.dvb.subtitle',
+ 'sus' => 'application/vnd.sus-calendar',
+ 'susp' => 'application/vnd.sus-calendar',
+ 'sv4cpio' => 'application/x-sv4cpio',
+ 'sv4crc' => 'application/x-sv4crc',
+ 'svc' => 'application/vnd.dvb.service',
+ 'svd' => 'application/vnd.svd',
+ 'svg' => 'image/svg+xml',
+ 'svgz' => 'image/svg+xml',
+ 'swa' => 'application/x-director',
+ 'swf' => 'application/x-shockwave-flash',
+ 'swi' => 'application/vnd.aristanetworks.swi',
+ 'swidtag' => 'application/swid+xml',
+ 'sxc' => 'application/vnd.sun.xml.calc',
+ 'sxd' => 'application/vnd.sun.xml.draw',
+ 'sxg' => 'application/vnd.sun.xml.writer.global',
+ 'sxi' => 'application/vnd.sun.xml.impress',
+ 'sxm' => 'application/vnd.sun.xml.math',
+ 'sxw' => 'application/vnd.sun.xml.writer',
+ 't' => 'text/troff',
+ 't3' => 'application/x-t3vm-image',
+ 't38' => 'image/t38',
+ 'taglet' => 'application/vnd.mynfc',
+ 'tao' => 'application/vnd.tao.intent-module-archive',
+ 'tap' => 'image/vnd.tencent.tap',
+ 'tar' => 'application/x-tar',
+ 'tcap' => 'application/vnd.3gpp2.tcap',
+ 'tcl' => 'application/x-tcl',
+ 'td' => 'application/urc-targetdesc+xml',
+ 'teacher' => 'application/vnd.smart.teacher',
+ 'tei' => 'application/tei+xml',
+ 'teicorpus' => 'application/tei+xml',
+ 'tex' => 'application/x-tex',
+ 'texi' => 'application/x-texinfo',
+ 'texinfo' => 'application/x-texinfo',
+ 'text' => 'text/plain',
+ 'tfi' => 'application/thraud+xml',
+ 'tfm' => 'application/x-tex-tfm',
+ 'tfx' => 'image/tiff-fx',
+ 'tga' => 'image/x-tga',
+ 'tgz' => 'application/x-tar',
+ 'thmx' => 'application/vnd.ms-officetheme',
+ 'tif' => 'image/tiff',
+ 'tiff' => 'image/tiff',
+ 'tk' => 'application/x-tcl',
+ 'tmo' => 'application/vnd.tmobile-livetv',
+ 'toml' => 'application/toml',
+ 'torrent' => 'application/x-bittorrent',
+ 'tpl' => 'application/vnd.groove-tool-template',
+ 'tpt' => 'application/vnd.trid.tpt',
+ 'tr' => 'text/troff',
+ 'tra' => 'application/vnd.trueapp',
+ 'trig' => 'application/trig',
+ 'trm' => 'application/x-msterminal',
+ 'ts' => 'video/mp2t',
+ 'tsd' => 'application/timestamped-data',
+ 'tsv' => 'text/tab-separated-values',
+ 'ttc' => 'font/collection',
+ 'ttf' => 'font/ttf',
+ 'ttl' => 'text/turtle',
+ 'ttml' => 'application/ttml+xml',
+ 'twd' => 'application/vnd.simtech-mindmapper',
+ 'twds' => 'application/vnd.simtech-mindmapper',
+ 'txd' => 'application/vnd.genomatix.tuxedo',
+ 'txf' => 'application/vnd.mobius.txf',
+ 'txt' => 'text/plain',
+ 'u3d' => 'model/u3d',
+ 'u8dsn' => 'message/global-delivery-status',
+ 'u8hdr' => 'message/global-headers',
+ 'u8mdn' => 'message/global-disposition-notification',
+ 'u8msg' => 'message/global',
+ 'u32' => 'application/x-authorware-bin',
+ 'ubj' => 'application/ubjson',
+ 'udeb' => 'application/x-debian-package',
+ 'ufd' => 'application/vnd.ufdl',
+ 'ufdl' => 'application/vnd.ufdl',
+ 'ulx' => 'application/x-glulx',
+ 'umj' => 'application/vnd.umajin',
+ 'unityweb' => 'application/vnd.unity',
+ 'uoml' => 'application/vnd.uoml+xml',
+ 'uri' => 'text/uri-list',
+ 'uris' => 'text/uri-list',
+ 'urls' => 'text/uri-list',
+ 'usdz' => 'model/vnd.usdz+zip',
+ 'ustar' => 'application/x-ustar',
+ 'utz' => 'application/vnd.uiq.theme',
+ 'uu' => 'text/x-uuencode',
+ 'uva' => 'audio/vnd.dece.audio',
+ 'uvd' => 'application/vnd.dece.data',
+ 'uvf' => 'application/vnd.dece.data',
+ 'uvg' => 'image/vnd.dece.graphic',
+ 'uvh' => 'video/vnd.dece.hd',
+ 'uvi' => 'image/vnd.dece.graphic',
+ 'uvm' => 'video/vnd.dece.mobile',
+ 'uvp' => 'video/vnd.dece.pd',
+ 'uvs' => 'video/vnd.dece.sd',
+ 'uvt' => 'application/vnd.dece.ttml+xml',
+ 'uvu' => 'video/vnd.uvvu.mp4',
+ 'uvv' => 'video/vnd.dece.video',
+ 'uvva' => 'audio/vnd.dece.audio',
+ 'uvvd' => 'application/vnd.dece.data',
+ 'uvvf' => 'application/vnd.dece.data',
+ 'uvvg' => 'image/vnd.dece.graphic',
+ 'uvvh' => 'video/vnd.dece.hd',
+ 'uvvi' => 'image/vnd.dece.graphic',
+ 'uvvm' => 'video/vnd.dece.mobile',
+ 'uvvp' => 'video/vnd.dece.pd',
+ 'uvvs' => 'video/vnd.dece.sd',
+ 'uvvt' => 'application/vnd.dece.ttml+xml',
+ 'uvvu' => 'video/vnd.uvvu.mp4',
+ 'uvvv' => 'video/vnd.dece.video',
+ 'uvvx' => 'application/vnd.dece.unspecified',
+ 'uvvz' => 'application/vnd.dece.zip',
+ 'uvx' => 'application/vnd.dece.unspecified',
+ 'uvz' => 'application/vnd.dece.zip',
+ 'vbox' => 'application/x-virtualbox-vbox',
+ 'vbox-extpack' => 'application/x-virtualbox-vbox-extpack',
+ 'vcard' => 'text/vcard',
+ 'vcd' => 'application/x-cdlink',
+ 'vcf' => 'text/x-vcard',
+ 'vcg' => 'application/vnd.groove-vcard',
+ 'vcs' => 'text/x-vcalendar',
+ 'vcx' => 'application/vnd.vcx',
+ 'vdi' => 'application/x-virtualbox-vdi',
+ 'vds' => 'model/vnd.sap.vds',
+ 'vhd' => 'application/x-virtualbox-vhd',
+ 'vis' => 'application/vnd.visionary',
+ 'viv' => 'video/vnd.vivo',
+ 'vlc' => 'application/videolan',
+ 'vmdk' => 'application/x-virtualbox-vmdk',
+ 'vob' => 'video/x-ms-vob',
+ 'vor' => 'application/vnd.stardivision.writer',
+ 'vox' => 'application/x-authorware-bin',
+ 'vrml' => 'model/vrml',
+ 'vsd' => 'application/vnd.visio',
+ 'vsf' => 'application/vnd.vsf',
+ 'vss' => 'application/vnd.visio',
+ 'vst' => 'application/vnd.visio',
+ 'vsw' => 'application/vnd.visio',
+ 'vtf' => 'image/vnd.valve.source.texture',
+ 'vtt' => 'text/vtt',
+ 'vtu' => 'model/vnd.vtu',
+ 'vxml' => 'application/voicexml+xml',
+ 'w3d' => 'application/x-director',
+ 'wad' => 'application/x-doom',
+ 'wadl' => 'application/vnd.sun.wadl+xml',
+ 'war' => 'application/java-archive',
+ 'wasm' => 'application/wasm',
+ 'wav' => 'audio/x-wav',
+ 'wax' => 'audio/x-ms-wax',
+ 'wbmp' => 'image/vnd.wap.wbmp',
+ 'wbs' => 'application/vnd.criticaltools.wbs+xml',
+ 'wbxml' => 'application/wbxml',
+ 'wcm' => 'application/vnd.ms-works',
+ 'wdb' => 'application/vnd.ms-works',
+ 'wdp' => 'image/vnd.ms-photo',
+ 'weba' => 'audio/webm',
+ 'webapp' => 'application/x-web-app-manifest+json',
+ 'webm' => 'video/webm',
+ 'webmanifest' => 'application/manifest+json',
+ 'webp' => 'image/webp',
+ 'wg' => 'application/vnd.pmi.widget',
+ 'wgt' => 'application/widget',
+ 'wif' => 'application/watcherinfo+xml',
+ 'wks' => 'application/vnd.ms-works',
+ 'wm' => 'video/x-ms-wm',
+ 'wma' => 'audio/x-ms-wma',
+ 'wmd' => 'application/x-ms-wmd',
+ 'wmf' => 'image/wmf',
+ 'wml' => 'text/vnd.wap.wml',
+ 'wmlc' => 'application/wmlc',
+ 'wmls' => 'text/vnd.wap.wmlscript',
+ 'wmlsc' => 'application/vnd.wap.wmlscriptc',
+ 'wmv' => 'video/x-ms-wmv',
+ 'wmx' => 'video/x-ms-wmx',
+ 'wmz' => 'application/x-msmetafile',
+ 'woff' => 'font/woff',
+ 'woff2' => 'font/woff2',
+ 'word' => 'application/msword',
+ 'wpd' => 'application/vnd.wordperfect',
+ 'wpl' => 'application/vnd.ms-wpl',
+ 'wps' => 'application/vnd.ms-works',
+ 'wqd' => 'application/vnd.wqd',
+ 'wri' => 'application/x-mswrite',
+ 'wrl' => 'model/vrml',
+ 'wsc' => 'message/vnd.wfa.wsc',
+ 'wsdl' => 'application/wsdl+xml',
+ 'wspolicy' => 'application/wspolicy+xml',
+ 'wtb' => 'application/vnd.webturbo',
+ 'wvx' => 'video/x-ms-wvx',
+ 'x3d' => 'model/x3d+xml',
+ 'x3db' => 'model/x3d+fastinfoset',
+ 'x3dbz' => 'model/x3d+binary',
+ 'x3dv' => 'model/x3d-vrml',
+ 'x3dvz' => 'model/x3d+vrml',
+ 'x3dz' => 'model/x3d+xml',
+ 'x32' => 'application/x-authorware-bin',
+ 'x_b' => 'model/vnd.parasolid.transmit.binary',
+ 'x_t' => 'model/vnd.parasolid.transmit.text',
+ 'xaml' => 'application/xaml+xml',
+ 'xap' => 'application/x-silverlight-app',
+ 'xar' => 'application/vnd.xara',
+ 'xav' => 'application/xcap-att+xml',
+ 'xbap' => 'application/x-ms-xbap',
+ 'xbd' => 'application/vnd.fujixerox.docuworks.binder',
+ 'xbm' => 'image/x-xbitmap',
+ 'xca' => 'application/xcap-caps+xml',
+ 'xcs' => 'application/calendar+xml',
+ 'xdf' => 'application/xcap-diff+xml',
+ 'xdm' => 'application/vnd.syncml.dm+xml',
+ 'xdp' => 'application/vnd.adobe.xdp+xml',
+ 'xdssc' => 'application/dssc+xml',
+ 'xdw' => 'application/vnd.fujixerox.docuworks',
+ 'xel' => 'application/xcap-el+xml',
+ 'xenc' => 'application/xenc+xml',
+ 'xer' => 'application/patch-ops-error+xml',
+ 'xfdf' => 'application/vnd.adobe.xfdf',
+ 'xfdl' => 'application/vnd.xfdl',
+ 'xht' => 'application/xhtml+xml',
+ 'xhtml' => 'application/xhtml+xml',
+ 'xhvml' => 'application/xv+xml',
+ 'xif' => 'image/vnd.xiff',
+ 'xl' => 'application/excel',
+ 'xla' => 'application/vnd.ms-excel',
+ 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
+ 'xlc' => 'application/vnd.ms-excel',
+ 'xlf' => 'application/xliff+xml',
+ 'xlm' => 'application/vnd.ms-excel',
+ 'xls' => 'application/vnd.ms-excel',
+ 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
+ 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
+ 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'xlt' => 'application/vnd.ms-excel',
+ 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
+ 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
+ 'xlw' => 'application/vnd.ms-excel',
+ 'xm' => 'audio/xm',
+ 'xml' => 'application/xml',
+ 'xns' => 'application/xcap-ns+xml',
+ 'xo' => 'application/vnd.olpc-sugar',
+ 'xop' => 'application/xop+xml',
+ 'xpi' => 'application/x-xpinstall',
+ 'xpl' => 'application/xproc+xml',
+ 'xpm' => 'image/x-xpixmap',
+ 'xpr' => 'application/vnd.is-xpr',
+ 'xps' => 'application/vnd.ms-xpsdocument',
+ 'xpw' => 'application/vnd.intercon.formnet',
+ 'xpx' => 'application/vnd.intercon.formnet',
+ 'xsd' => 'application/xml',
+ 'xsl' => 'application/xml',
+ 'xslt' => 'application/xslt+xml',
+ 'xsm' => 'application/vnd.syncml+xml',
+ 'xspf' => 'application/xspf+xml',
+ 'xul' => 'application/vnd.mozilla.xul+xml',
+ 'xvm' => 'application/xv+xml',
+ 'xvml' => 'application/xv+xml',
+ 'xwd' => 'image/x-xwindowdump',
+ 'xyz' => 'chemical/x-xyz',
+ 'xz' => 'application/x-xz',
+ 'yaml' => 'text/yaml',
+ 'yang' => 'application/yang',
+ 'yin' => 'application/yin+xml',
+ 'yml' => 'text/yaml',
+ 'ymp' => 'text/x-suse-ymp',
+ 'z' => 'application/x-compress',
+ 'z1' => 'application/x-zmachine',
+ 'z2' => 'application/x-zmachine',
+ 'z3' => 'application/x-zmachine',
+ 'z4' => 'application/x-zmachine',
+ 'z5' => 'application/x-zmachine',
+ 'z6' => 'application/x-zmachine',
+ 'z7' => 'application/x-zmachine',
+ 'z8' => 'application/x-zmachine',
+ 'zaz' => 'application/vnd.zzazz.deck+xml',
+ 'zip' => 'application/zip',
+ 'zir' => 'application/vnd.zul',
+ 'zirz' => 'application/vnd.zul',
+ 'zmm' => 'application/vnd.handheld-entertainment+xml',
+ 'zsh' => 'text/x-scriptzsh',
+ ];
+
/**
* Determines the mimetype of a file by looking at its extension.
*
- * @param string $filename
- *
- * @return string|null
+ * @link https://raw.githubusercontent.com/jshttp/mime-db/master/db.json
*/
- public static function fromFilename($filename)
+ public static function fromFilename(string $filename): ?string
{
return self::fromExtension(pathinfo($filename, PATHINFO_EXTENSION));
}
@@ -19,122 +1228,10 @@ final class MimeType
/**
* Maps a file extensions to a mimetype.
*
- * @param string $extension string The file extension.
- *
- * @return string|null
- *
- * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
+ * @link https://raw.githubusercontent.com/jshttp/mime-db/master/db.json
*/
- public static function fromExtension($extension)
+ public static function fromExtension(string $extension): ?string
{
- static $mimetypes = [
- '3gp' => 'video/3gpp',
- '7z' => 'application/x-7z-compressed',
- 'aac' => 'audio/x-aac',
- 'ai' => 'application/postscript',
- 'aif' => 'audio/x-aiff',
- 'asc' => 'text/plain',
- 'asf' => 'video/x-ms-asf',
- 'atom' => 'application/atom+xml',
- 'avi' => 'video/x-msvideo',
- 'bmp' => 'image/bmp',
- 'bz2' => 'application/x-bzip2',
- 'cer' => 'application/pkix-cert',
- 'crl' => 'application/pkix-crl',
- 'crt' => 'application/x-x509-ca-cert',
- 'css' => 'text/css',
- 'csv' => 'text/csv',
- 'cu' => 'application/cu-seeme',
- 'deb' => 'application/x-debian-package',
- 'doc' => 'application/msword',
- 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
- 'dvi' => 'application/x-dvi',
- 'eot' => 'application/vnd.ms-fontobject',
- 'eps' => 'application/postscript',
- 'epub' => 'application/epub+zip',
- 'etx' => 'text/x-setext',
- 'flac' => 'audio/flac',
- 'flv' => 'video/x-flv',
- 'gif' => 'image/gif',
- 'gz' => 'application/gzip',
- 'htm' => 'text/html',
- 'html' => 'text/html',
- 'ico' => 'image/x-icon',
- 'ics' => 'text/calendar',
- 'ini' => 'text/plain',
- 'iso' => 'application/x-iso9660-image',
- 'jar' => 'application/java-archive',
- 'jpe' => 'image/jpeg',
- 'jpeg' => 'image/jpeg',
- 'jpg' => 'image/jpeg',
- 'js' => 'text/javascript',
- 'json' => 'application/json',
- 'latex' => 'application/x-latex',
- 'log' => 'text/plain',
- 'm4a' => 'audio/mp4',
- 'm4v' => 'video/mp4',
- 'mid' => 'audio/midi',
- 'midi' => 'audio/midi',
- 'mov' => 'video/quicktime',
- 'mkv' => 'video/x-matroska',
- 'mp3' => 'audio/mpeg',
- 'mp4' => 'video/mp4',
- 'mp4a' => 'audio/mp4',
- 'mp4v' => 'video/mp4',
- 'mpe' => 'video/mpeg',
- 'mpeg' => 'video/mpeg',
- 'mpg' => 'video/mpeg',
- 'mpg4' => 'video/mp4',
- 'oga' => 'audio/ogg',
- 'ogg' => 'audio/ogg',
- 'ogv' => 'video/ogg',
- 'ogx' => 'application/ogg',
- 'pbm' => 'image/x-portable-bitmap',
- 'pdf' => 'application/pdf',
- 'pgm' => 'image/x-portable-graymap',
- 'png' => 'image/png',
- 'pnm' => 'image/x-portable-anymap',
- 'ppm' => 'image/x-portable-pixmap',
- 'ppt' => 'application/vnd.ms-powerpoint',
- 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
- 'ps' => 'application/postscript',
- 'qt' => 'video/quicktime',
- 'rar' => 'application/x-rar-compressed',
- 'ras' => 'image/x-cmu-raster',
- 'rss' => 'application/rss+xml',
- 'rtf' => 'application/rtf',
- 'sgm' => 'text/sgml',
- 'sgml' => 'text/sgml',
- 'svg' => 'image/svg+xml',
- 'swf' => 'application/x-shockwave-flash',
- 'tar' => 'application/x-tar',
- 'tif' => 'image/tiff',
- 'tiff' => 'image/tiff',
- 'torrent' => 'application/x-bittorrent',
- 'ttf' => 'application/x-font-ttf',
- 'txt' => 'text/plain',
- 'wav' => 'audio/x-wav',
- 'webm' => 'video/webm',
- 'webp' => 'image/webp',
- 'wma' => 'audio/x-ms-wma',
- 'wmv' => 'video/x-ms-wmv',
- 'woff' => 'application/x-font-woff',
- 'wsdl' => 'application/wsdl+xml',
- 'xbm' => 'image/x-xbitmap',
- 'xls' => 'application/vnd.ms-excel',
- 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
- 'xml' => 'application/xml',
- 'xpm' => 'image/x-xpixmap',
- 'xwd' => 'image/x-xwindowdump',
- 'yaml' => 'text/yaml',
- 'yml' => 'text/yaml',
- 'zip' => 'application/zip',
- ];
-
- $extension = strtolower($extension);
-
- return isset($mimetypes[$extension])
- ? $mimetypes[$extension]
- : null;
+ return self::MIME_TYPES[strtolower($extension)] ?? null;
}
}
diff --git a/vendor/guzzlehttp/psr7/src/MultipartStream.php b/vendor/guzzlehttp/psr7/src/MultipartStream.php
index 5a6079a..3e12b74 100644
--- a/vendor/guzzlehttp/psr7/src/MultipartStream.php
+++ b/vendor/guzzlehttp/psr7/src/MultipartStream.php
@@ -1,5 +1,7 @@
boundary = $boundary ?: sha1(uniqid('', true));
+ $this->boundary = $boundary ?: bin2hex(random_bytes(20));
$this->stream = $this->createStream($elements);
}
- /**
- * Get the boundary
- *
- * @return string
- */
- public function getBoundary()
+ public function getBoundary(): string
{
return $this->boundary;
}
- public function isWritable()
+ public function isWritable(): bool
{
return false;
}
/**
* Get the headers needed before transferring the content of a POST file
+ *
+ * @param array $headers
*/
- private function getHeaders(array $headers)
+ private function getHeaders(array $headers): string
{
$str = '';
foreach ($headers as $key => $value) {
@@ -65,11 +66,14 @@ class MultipartStream implements StreamInterface
/**
* Create the aggregate stream that will be used to upload the POST data
*/
- protected function createStream(array $elements)
+ protected function createStream(array $elements = []): StreamInterface
{
$stream = new AppendStream();
foreach ($elements as $element) {
+ if (!is_array($element)) {
+ throw new \UnexpectedValueException("An array is expected");
+ }
$this->addElement($stream, $element);
}
@@ -79,7 +83,7 @@ class MultipartStream implements StreamInterface
return $stream;
}
- private function addElement(AppendStream $stream, array $element)
+ private function addElement(AppendStream $stream, array $element): void
{
foreach (['contents', 'name'] as $key) {
if (!array_key_exists($key, $element)) {
@@ -91,16 +95,16 @@ class MultipartStream implements StreamInterface
if (empty($element['filename'])) {
$uri = $element['contents']->getMetadata('uri');
- if (substr($uri, 0, 6) !== 'php://') {
+ if ($uri && \is_string($uri) && \substr($uri, 0, 6) !== 'php://' && \substr($uri, 0, 7) !== 'data://') {
$element['filename'] = $uri;
}
}
- list($body, $headers) = $this->createElement(
+ [$body, $headers] = $this->createElement(
$element['name'],
$element['contents'],
- isset($element['filename']) ? $element['filename'] : null,
- isset($element['headers']) ? $element['headers'] : []
+ $element['filename'] ?? null,
+ $element['headers'] ?? []
);
$stream->addStream(Utils::streamFor($this->getHeaders($headers)));
@@ -108,10 +112,7 @@ class MultipartStream implements StreamInterface
$stream->addStream(Utils::streamFor("\r\n"));
}
- /**
- * @return array
- */
- private function createElement($name, StreamInterface $stream, $filename, array $headers)
+ private function createElement(string $name, StreamInterface $stream, ?string $filename, array $headers): array
{
// Set a default content-disposition header if one was no provided
$disposition = $this->getHeader($headers, 'content-disposition');
@@ -144,7 +145,7 @@ class MultipartStream implements StreamInterface
return [$stream, $headers];
}
- private function getHeader(array $headers, $key)
+ private function getHeader(array $headers, string $key)
{
$lowercaseHeader = strtolower($key);
foreach ($headers as $k => $v) {
diff --git a/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/vendor/guzzlehttp/psr7/src/NoSeekStream.php
index d66bdde..161a224 100644
--- a/vendor/guzzlehttp/psr7/src/NoSeekStream.php
+++ b/vendor/guzzlehttp/psr7/src/NoSeekStream.php
@@ -1,24 +1,27 @@
source = $source;
- $this->size = isset($options['size']) ? $options['size'] : null;
- $this->metadata = isset($options['metadata']) ? $options['metadata'] : [];
+ $this->size = $options['size'] ?? null;
+ $this->metadata = $options['metadata'] ?? [];
$this->buffer = new BufferStream();
}
- public function __toString()
+ public function __toString(): string
{
try {
return Utils::copyToString($this);
- } catch (\Exception $e) {
+ } catch (\Throwable $e) {
+ if (\PHP_VERSION_ID >= 70400) {
+ throw $e;
+ }
+ trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
return '';
}
}
- public function close()
+ public function close(): void
{
$this->detach();
}
public function detach()
{
- $this->tellPos = false;
+ $this->tellPos = 0;
$this->source = null;
return null;
}
- public function getSize()
+ public function getSize(): ?int
{
return $this->size;
}
- public function tell()
+ public function tell(): int
{
return $this->tellPos;
}
- public function eof()
+ public function eof(): bool
{
- return !$this->source;
+ return $this->source === null;
}
- public function isSeekable()
+ public function isSeekable(): bool
{
return false;
}
- public function rewind()
+ public function rewind(): void
{
$this->seek(0);
}
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
throw new \RuntimeException('Cannot seek a PumpStream');
}
- public function isWritable()
+ public function isWritable(): bool
{
return false;
}
- public function write($string)
+ public function write($string): int
{
throw new \RuntimeException('Cannot write to a PumpStream');
}
- public function isReadable()
+ public function isReadable(): bool
{
return true;
}
- public function read($length)
+ public function read($length): string
{
$data = $this->buffer->read($length);
$readLen = strlen($data);
@@ -134,7 +138,7 @@ class PumpStream implements StreamInterface
return $data;
}
- public function getContents()
+ public function getContents(): string
{
$result = '';
while (!$this->eof()) {
@@ -144,16 +148,21 @@ class PumpStream implements StreamInterface
return $result;
}
+ /**
+ * {@inheritdoc}
+ *
+ * @return mixed
+ */
public function getMetadata($key = null)
{
if (!$key) {
return $this->metadata;
}
- return isset($this->metadata[$key]) ? $this->metadata[$key] : null;
+ return $this->metadata[$key] ?? null;
}
- private function pump($length)
+ private function pump(int $length): void
{
if ($this->source) {
do {
diff --git a/vendor/guzzlehttp/psr7/src/Query.php b/vendor/guzzlehttp/psr7/src/Query.php
index 5a7cc03..2faab3a 100644
--- a/vendor/guzzlehttp/psr7/src/Query.php
+++ b/vendor/guzzlehttp/psr7/src/Query.php
@@ -1,5 +1,7 @@
$v) {
- $k = $encoder($k);
+ $k = $encoder((string) $k);
if (!is_array($v)) {
$qs .= $k;
+ $v = is_bool($v) ? (int) $v : $v;
if ($v !== null) {
- $qs .= '=' . $encoder($v);
+ $qs .= '=' . $encoder((string) $v);
}
$qs .= '&';
} else {
foreach ($v as $vv) {
$qs .= $k;
+ $vv = is_bool($vv) ? (int) $vv : $vv;
if ($vv !== null) {
- $qs .= '=' . $encoder($vv);
+ $qs .= '=' . $encoder((string) $vv);
}
$qs .= '&';
}
diff --git a/vendor/guzzlehttp/psr7/src/Request.php b/vendor/guzzlehttp/psr7/src/Request.php
index c1cdaeb..b17af66 100644
--- a/vendor/guzzlehttp/psr7/src/Request.php
+++ b/vendor/guzzlehttp/psr7/src/Request.php
@@ -1,5 +1,7 @@
$headers Request headers
* @param string|resource|StreamInterface|null $body Request body
* @param string $version Protocol version
*/
public function __construct(
- $method,
+ string $method,
$uri,
array $headers = [],
$body = null,
- $version = '1.1'
+ string $version = '1.1'
) {
$this->assertMethod($method);
if (!($uri instanceof UriInterface)) {
@@ -56,14 +58,14 @@ class Request implements RequestInterface
}
}
- public function getRequestTarget()
+ public function getRequestTarget(): string
{
if ($this->requestTarget !== null) {
return $this->requestTarget;
}
$target = $this->uri->getPath();
- if ($target == '') {
+ if ($target === '') {
$target = '/';
}
if ($this->uri->getQuery() != '') {
@@ -73,7 +75,7 @@ class Request implements RequestInterface
return $target;
}
- public function withRequestTarget($requestTarget)
+ public function withRequestTarget($requestTarget): RequestInterface
{
if (preg_match('#\s#', $requestTarget)) {
throw new InvalidArgumentException(
@@ -86,12 +88,12 @@ class Request implements RequestInterface
return $new;
}
- public function getMethod()
+ public function getMethod(): string
{
return $this->method;
}
- public function withMethod($method)
+ public function withMethod($method): RequestInterface
{
$this->assertMethod($method);
$new = clone $this;
@@ -99,12 +101,12 @@ class Request implements RequestInterface
return $new;
}
- public function getUri()
+ public function getUri(): UriInterface
{
return $this->uri;
}
- public function withUri(UriInterface $uri, $preserveHost = false)
+ public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface
{
if ($uri === $this->uri) {
return $this;
@@ -120,7 +122,7 @@ class Request implements RequestInterface
return $new;
}
- private function updateHostFromUri()
+ private function updateHostFromUri(): void
{
$host = $this->uri->getHost();
@@ -143,10 +145,13 @@ class Request implements RequestInterface
$this->headers = [$header => [$host]] + $this->headers;
}
- private function assertMethod($method)
+ /**
+ * @param mixed $method
+ */
+ private function assertMethod($method): void
{
if (!is_string($method) || $method === '') {
- throw new \InvalidArgumentException('Method must be a non-empty string.');
+ throw new InvalidArgumentException('Method must be a non-empty string.');
}
}
}
diff --git a/vendor/guzzlehttp/psr7/src/Response.php b/vendor/guzzlehttp/psr7/src/Response.php
index 8c01a0f..4c6ee6f 100644
--- a/vendor/guzzlehttp/psr7/src/Response.php
+++ b/vendor/guzzlehttp/psr7/src/Response.php
@@ -1,5 +1,7 @@
'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
@@ -34,6 +36,7 @@ class Response implements ResponseInterface
305 => 'Use Proxy',
306 => 'Switch Proxy',
307 => 'Temporary Redirect',
+ 308 => 'Permanent Redirect',
400 => 'Bad Request',
401 => 'Unauthorized',
402 => 'Payment Required',
@@ -71,31 +74,30 @@ class Response implements ResponseInterface
506 => 'Variant Also Negotiates',
507 => 'Insufficient Storage',
508 => 'Loop Detected',
+ 510 => 'Not Extended',
511 => 'Network Authentication Required',
];
/** @var string */
- private $reasonPhrase = '';
+ private $reasonPhrase;
/** @var int */
- private $statusCode = 200;
+ private $statusCode;
/**
* @param int $status Status code
- * @param array $headers Response headers
+ * @param array $headers Response headers
* @param string|resource|StreamInterface|null $body Response body
* @param string $version Protocol version
* @param string|null $reason Reason phrase (when empty a default will be used based on the status code)
*/
public function __construct(
- $status = 200,
+ int $status = 200,
array $headers = [],
$body = null,
- $version = '1.1',
- $reason = null
+ string $version = '1.1',
+ string $reason = null
) {
- $this->assertStatusCodeIsInteger($status);
- $status = (int) $status;
$this->assertStatusCodeRange($status);
$this->statusCode = $status;
@@ -105,8 +107,8 @@ class Response implements ResponseInterface
}
$this->setHeaders($headers);
- if ($reason == '' && isset(self::$phrases[$this->statusCode])) {
- $this->reasonPhrase = self::$phrases[$this->statusCode];
+ if ($reason == '' && isset(self::PHRASES[$this->statusCode])) {
+ $this->reasonPhrase = self::PHRASES[$this->statusCode];
} else {
$this->reasonPhrase = (string) $reason;
}
@@ -114,17 +116,17 @@ class Response implements ResponseInterface
$this->protocol = $version;
}
- public function getStatusCode()
+ public function getStatusCode(): int
{
return $this->statusCode;
}
- public function getReasonPhrase()
+ public function getReasonPhrase(): string
{
return $this->reasonPhrase;
}
- public function withStatus($code, $reasonPhrase = '')
+ public function withStatus($code, $reasonPhrase = ''): ResponseInterface
{
$this->assertStatusCodeIsInteger($code);
$code = (int) $code;
@@ -132,21 +134,24 @@ class Response implements ResponseInterface
$new = clone $this;
$new->statusCode = $code;
- if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) {
- $reasonPhrase = self::$phrases[$new->statusCode];
+ if ($reasonPhrase == '' && isset(self::PHRASES[$new->statusCode])) {
+ $reasonPhrase = self::PHRASES[$new->statusCode];
}
$new->reasonPhrase = (string) $reasonPhrase;
return $new;
}
- private function assertStatusCodeIsInteger($statusCode)
+ /**
+ * @param mixed $statusCode
+ */
+ private function assertStatusCodeIsInteger($statusCode): void
{
if (filter_var($statusCode, FILTER_VALIDATE_INT) === false) {
throw new \InvalidArgumentException('Status code must be an integer value.');
}
}
- private function assertStatusCodeRange($statusCode)
+ private function assertStatusCodeRange(int $statusCode): void
{
if ($statusCode < 100 || $statusCode >= 600) {
throw new \InvalidArgumentException('Status code must be an integer value between 1xx and 5xx.');
diff --git a/vendor/guzzlehttp/psr7/src/Rfc7230.php b/vendor/guzzlehttp/psr7/src/Rfc7230.php
index 51b571f..3022401 100644
--- a/vendor/guzzlehttp/psr7/src/Rfc7230.php
+++ b/vendor/guzzlehttp/psr7/src/Rfc7230.php
@@ -1,12 +1,16 @@
@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m";
- const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)";
+ public const HEADER_REGEX = "(^([^()<>@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m";
+ public const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)";
}
diff --git a/vendor/guzzlehttp/psr7/src/ServerRequest.php b/vendor/guzzlehttp/psr7/src/ServerRequest.php
index e6d26f5..b2aa382 100644
--- a/vendor/guzzlehttp/psr7/src/ServerRequest.php
+++ b/vendor/guzzlehttp/psr7/src/ServerRequest.php
@@ -1,5 +1,7 @@
$headers Request headers
* @param string|resource|StreamInterface|null $body Request body
* @param string $version Protocol version
* @param array $serverParams Typically the $_SERVER superglobal
*/
public function __construct(
- $method,
+ string $method,
$uri,
array $headers = [],
$body = null,
- $version = '1.1',
+ string $version = '1.1',
array $serverParams = []
) {
$this->serverParams = $serverParams;
@@ -78,13 +80,11 @@ class ServerRequest extends Request implements ServerRequestInterface
/**
* Return an UploadedFile instance array.
*
- * @param array $files A array which respect $_FILES structure
- *
- * @return array
+ * @param array $files An array which respect $_FILES structure
*
* @throws InvalidArgumentException for unrecognized values
*/
- public static function normalizeFiles(array $files)
+ public static function normalizeFiles(array $files): array
{
$normalized = [];
@@ -112,7 +112,7 @@ class ServerRequest extends Request implements ServerRequestInterface
*
* @param array $value $_FILES struct
*
- * @return array|UploadedFileInterface
+ * @return UploadedFileInterface|UploadedFileInterface[]
*/
private static function createUploadedFileFromSpec(array $value)
{
@@ -135,21 +135,19 @@ class ServerRequest extends Request implements ServerRequestInterface
* Loops through all nested files and returns a normalized array of
* UploadedFileInterface instances.
*
- * @param array $files
- *
* @return UploadedFileInterface[]
*/
- private static function normalizeNestedFileSpec(array $files = [])
+ private static function normalizeNestedFileSpec(array $files = []): array
{
$normalizedFiles = [];
foreach (array_keys($files['tmp_name']) as $key) {
$spec = [
'tmp_name' => $files['tmp_name'][$key],
- 'size' => $files['size'][$key],
- 'error' => $files['error'][$key],
- 'name' => $files['name'][$key],
- 'type' => $files['type'][$key],
+ 'size' => $files['size'][$key] ?? null,
+ 'error' => $files['error'][$key] ?? null,
+ 'name' => $files['name'][$key] ?? null,
+ 'type' => $files['type'][$key] ?? null,
];
$normalizedFiles[$key] = self::createUploadedFileFromSpec($spec);
}
@@ -164,12 +162,10 @@ class ServerRequest extends Request implements ServerRequestInterface
* $_COOKIE
* $_FILES
* $_SERVER
- *
- * @return ServerRequestInterface
*/
- public static function fromGlobals()
+ public static function fromGlobals(): ServerRequestInterface
{
- $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
+ $method = $_SERVER['REQUEST_METHOD'] ?? 'GET';
$headers = getallheaders();
$uri = self::getUriFromGlobals();
$body = new CachingStream(new LazyOpenStream('php://input', 'r+'));
@@ -184,7 +180,7 @@ class ServerRequest extends Request implements ServerRequestInterface
->withUploadedFiles(self::normalizeFiles($_FILES));
}
- private static function extractHostAndPortFromAuthority($authority)
+ private static function extractHostAndPortFromAuthority(string $authority): array
{
$uri = 'http://' . $authority;
$parts = parse_url($uri);
@@ -192,18 +188,16 @@ class ServerRequest extends Request implements ServerRequestInterface
return [null, null];
}
- $host = isset($parts['host']) ? $parts['host'] : null;
- $port = isset($parts['port']) ? $parts['port'] : null;
+ $host = $parts['host'] ?? null;
+ $port = $parts['port'] ?? null;
return [$host, $port];
}
/**
* Get a Uri populated with values from $_SERVER.
- *
- * @return UriInterface
*/
- public static function getUriFromGlobals()
+ public static function getUriFromGlobals(): UriInterface
{
$uri = new Uri('');
@@ -211,7 +205,7 @@ class ServerRequest extends Request implements ServerRequestInterface
$hasPort = false;
if (isset($_SERVER['HTTP_HOST'])) {
- list($host, $port) = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']);
+ [$host, $port] = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']);
if ($host !== null) {
$uri = $uri->withHost($host);
}
@@ -247,26 +241,17 @@ class ServerRequest extends Request implements ServerRequestInterface
return $uri;
}
- /**
- * {@inheritdoc}
- */
- public function getServerParams()
+ public function getServerParams(): array
{
return $this->serverParams;
}
- /**
- * {@inheritdoc}
- */
- public function getUploadedFiles()
+ public function getUploadedFiles(): array
{
return $this->uploadedFiles;
}
- /**
- * {@inheritdoc}
- */
- public function withUploadedFiles(array $uploadedFiles)
+ public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface
{
$new = clone $this;
$new->uploadedFiles = $uploadedFiles;
@@ -274,18 +259,12 @@ class ServerRequest extends Request implements ServerRequestInterface
return $new;
}
- /**
- * {@inheritdoc}
- */
- public function getCookieParams()
+ public function getCookieParams(): array
{
return $this->cookieParams;
}
- /**
- * {@inheritdoc}
- */
- public function withCookieParams(array $cookies)
+ public function withCookieParams(array $cookies): ServerRequestInterface
{
$new = clone $this;
$new->cookieParams = $cookies;
@@ -293,18 +272,12 @@ class ServerRequest extends Request implements ServerRequestInterface
return $new;
}
- /**
- * {@inheritdoc}
- */
- public function getQueryParams()
+ public function getQueryParams(): array
{
return $this->queryParams;
}
- /**
- * {@inheritdoc}
- */
- public function withQueryParams(array $query)
+ public function withQueryParams(array $query): ServerRequestInterface
{
$new = clone $this;
$new->queryParams = $query;
@@ -314,16 +287,15 @@ class ServerRequest extends Request implements ServerRequestInterface
/**
* {@inheritdoc}
+ *
+ * @return array|object|null
*/
public function getParsedBody()
{
return $this->parsedBody;
}
- /**
- * {@inheritdoc}
- */
- public function withParsedBody($data)
+ public function withParsedBody($data): ServerRequestInterface
{
$new = clone $this;
$new->parsedBody = $data;
@@ -331,16 +303,15 @@ class ServerRequest extends Request implements ServerRequestInterface
return $new;
}
- /**
- * {@inheritdoc}
- */
- public function getAttributes()
+ public function getAttributes(): array
{
return $this->attributes;
}
/**
* {@inheritdoc}
+ *
+ * @return mixed
*/
public function getAttribute($attribute, $default = null)
{
@@ -351,10 +322,7 @@ class ServerRequest extends Request implements ServerRequestInterface
return $this->attributes[$attribute];
}
- /**
- * {@inheritdoc}
- */
- public function withAttribute($attribute, $value)
+ public function withAttribute($attribute, $value): ServerRequestInterface
{
$new = clone $this;
$new->attributes[$attribute] = $value;
@@ -362,10 +330,7 @@ class ServerRequest extends Request implements ServerRequestInterface
return $new;
}
- /**
- * {@inheritdoc}
- */
- public function withoutAttribute($attribute)
+ public function withoutAttribute($attribute): ServerRequestInterface
{
if (false === array_key_exists($attribute, $this->attributes)) {
return $this;
diff --git a/vendor/guzzlehttp/psr7/src/Stream.php b/vendor/guzzlehttp/psr7/src/Stream.php
index 3865d6d..ecd3186 100644
--- a/vendor/guzzlehttp/psr7/src/Stream.php
+++ b/vendor/guzzlehttp/psr7/src/Stream.php
@@ -1,33 +1,36 @@
size = $options['size'];
}
- $this->customMetadata = isset($options['metadata'])
- ? $options['metadata']
- : [];
-
+ $this->customMetadata = $options['metadata'] ?? [];
$this->stream = $stream;
$meta = stream_get_meta_data($this->stream);
$this->seekable = $meta['seekable'];
@@ -74,34 +74,36 @@ class Stream implements StreamInterface
$this->close();
}
- public function __toString()
+ public function __toString(): string
{
try {
if ($this->isSeekable()) {
$this->seek(0);
}
return $this->getContents();
- } catch (\Exception $e) {
+ } catch (\Throwable $e) {
+ if (\PHP_VERSION_ID >= 70400) {
+ throw $e;
+ }
+ trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
return '';
}
}
- public function getContents()
+ public function getContents(): string
{
if (!isset($this->stream)) {
throw new \RuntimeException('Stream is detached');
}
- $contents = stream_get_contents($this->stream);
-
- if ($contents === false) {
- throw new \RuntimeException('Unable to read stream contents');
+ if (!$this->readable) {
+ throw new \RuntimeException('Cannot read from non-readable stream');
}
- return $contents;
+ return Utils::tryGetContents($this->stream);
}
- public function close()
+ public function close(): void
{
if (isset($this->stream)) {
if (is_resource($this->stream)) {
@@ -125,7 +127,7 @@ class Stream implements StreamInterface
return $result;
}
- public function getSize()
+ public function getSize(): ?int
{
if ($this->size !== null) {
return $this->size;
@@ -141,7 +143,7 @@ class Stream implements StreamInterface
}
$stats = fstat($this->stream);
- if (isset($stats['size'])) {
+ if (is_array($stats) && isset($stats['size'])) {
$this->size = $stats['size'];
return $this->size;
}
@@ -149,22 +151,22 @@ class Stream implements StreamInterface
return null;
}
- public function isReadable()
+ public function isReadable(): bool
{
return $this->readable;
}
- public function isWritable()
+ public function isWritable(): bool
{
return $this->writable;
}
- public function isSeekable()
+ public function isSeekable(): bool
{
return $this->seekable;
}
- public function eof()
+ public function eof(): bool
{
if (!isset($this->stream)) {
throw new \RuntimeException('Stream is detached');
@@ -173,7 +175,7 @@ class Stream implements StreamInterface
return feof($this->stream);
}
- public function tell()
+ public function tell(): int
{
if (!isset($this->stream)) {
throw new \RuntimeException('Stream is detached');
@@ -188,12 +190,12 @@ class Stream implements StreamInterface
return $result;
}
- public function rewind()
+ public function rewind(): void
{
$this->seek(0);
}
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
$whence = (int) $whence;
@@ -209,7 +211,7 @@ class Stream implements StreamInterface
}
}
- public function read($length)
+ public function read($length): string
{
if (!isset($this->stream)) {
throw new \RuntimeException('Stream is detached');
@@ -225,7 +227,12 @@ class Stream implements StreamInterface
return '';
}
- $string = fread($this->stream, $length);
+ try {
+ $string = fread($this->stream, $length);
+ } catch (\Exception $e) {
+ throw new \RuntimeException('Unable to read from stream', 0, $e);
+ }
+
if (false === $string) {
throw new \RuntimeException('Unable to read from stream');
}
@@ -233,7 +240,7 @@ class Stream implements StreamInterface
return $string;
}
- public function write($string)
+ public function write($string): int
{
if (!isset($this->stream)) {
throw new \RuntimeException('Stream is detached');
@@ -253,6 +260,11 @@ class Stream implements StreamInterface
return $result;
}
+ /**
+ * {@inheritdoc}
+ *
+ * @return mixed
+ */
public function getMetadata($key = null)
{
if (!isset($this->stream)) {
@@ -265,6 +277,6 @@ class Stream implements StreamInterface
$meta = stream_get_meta_data($this->stream);
- return isset($meta[$key]) ? $meta[$key] : null;
+ return $meta[$key] ?? null;
}
}
diff --git a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php
index 5025dd6..56d4104 100644
--- a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php
+++ b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php
@@ -1,5 +1,7 @@
stream = $this->createStream();
return $this->stream;
}
@@ -37,22 +37,23 @@ trait StreamDecoratorTrait
throw new \UnexpectedValueException("$name not found on class");
}
- public function __toString()
+ public function __toString(): string
{
try {
if ($this->isSeekable()) {
$this->seek(0);
}
return $this->getContents();
- } catch (\Exception $e) {
- // Really, PHP? https://bugs.php.net/bug.php?id=53648
- trigger_error('StreamDecorator::__toString exception: '
- . (string) $e, E_USER_ERROR);
+ } catch (\Throwable $e) {
+ if (\PHP_VERSION_ID >= 70400) {
+ throw $e;
+ }
+ trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
return '';
}
}
- public function getContents()
+ public function getContents(): string
{
return Utils::copyToString($this);
}
@@ -60,24 +61,28 @@ trait StreamDecoratorTrait
/**
* Allow decorators to implement custom methods
*
- * @param string $method Missing method name
- * @param array $args Method arguments
- *
* @return mixed
*/
- public function __call($method, array $args)
+ public function __call(string $method, array $args)
{
- $result = call_user_func_array([$this->stream, $method], $args);
+ /** @var callable $callable */
+ $callable = [$this->stream, $method];
+ $result = call_user_func_array($callable, $args);
// Always return the wrapped object if the result is a return $this
return $result === $this->stream ? $this : $result;
}
- public function close()
+ public function close(): void
{
$this->stream->close();
}
+ /**
+ * {@inheritdoc}
+ *
+ * @return mixed
+ */
public function getMetadata($key = null)
{
return $this->stream->getMetadata($key);
@@ -88,52 +93,52 @@ trait StreamDecoratorTrait
return $this->stream->detach();
}
- public function getSize()
+ public function getSize(): ?int
{
return $this->stream->getSize();
}
- public function eof()
+ public function eof(): bool
{
return $this->stream->eof();
}
- public function tell()
+ public function tell(): int
{
return $this->stream->tell();
}
- public function isReadable()
+ public function isReadable(): bool
{
return $this->stream->isReadable();
}
- public function isWritable()
+ public function isWritable(): bool
{
return $this->stream->isWritable();
}
- public function isSeekable()
+ public function isSeekable(): bool
{
return $this->stream->isSeekable();
}
- public function rewind()
+ public function rewind(): void
{
$this->seek(0);
}
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
$this->stream->seek($offset, $whence);
}
- public function read($length)
+ public function read($length): string
{
return $this->stream->read($length);
}
- public function write($string)
+ public function write($string): int
{
return $this->stream->write($string);
}
@@ -141,11 +146,9 @@ trait StreamDecoratorTrait
/**
* Implement in subclasses to dynamically create streams when requested.
*
- * @return StreamInterface
- *
* @throws \BadMethodCallException
*/
- protected function createStream()
+ protected function createStream(): StreamInterface
{
throw new \BadMethodCallException('Not implemented');
}
diff --git a/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/vendor/guzzlehttp/psr7/src/StreamWrapper.php
index fc7cb96..2a93464 100644
--- a/vendor/guzzlehttp/psr7/src/StreamWrapper.php
+++ b/vendor/guzzlehttp/psr7/src/StreamWrapper.php
@@ -1,5 +1,7 @@
context);
@@ -83,41 +83,48 @@ class StreamWrapper
return true;
}
- public function stream_read($count)
+ public function stream_read(int $count): string
{
return $this->stream->read($count);
}
- public function stream_write($data)
+ public function stream_write(string $data): int
{
- return (int) $this->stream->write($data);
+ return $this->stream->write($data);
}
- public function stream_tell()
+ public function stream_tell(): int
{
return $this->stream->tell();
}
- public function stream_eof()
+ public function stream_eof(): bool
{
return $this->stream->eof();
}
- public function stream_seek($offset, $whence)
+ public function stream_seek(int $offset, int $whence): bool
{
$this->stream->seek($offset, $whence);
return true;
}
- public function stream_cast($cast_as)
+ /**
+ * @return resource|false
+ */
+ public function stream_cast(int $cast_as)
{
$stream = clone($this->stream);
+ $resource = $stream->detach();
- return $stream->detach();
+ return $resource ?? false;
}
- public function stream_stat()
+ /**
+ * @return array
+ */
+ public function stream_stat(): array
{
static $modeMap = [
'r' => 33060,
@@ -144,7 +151,10 @@ class StreamWrapper
];
}
- public function url_stat($path, $flags)
+ /**
+ * @return array
+ */
+ public function url_stat(string $path, int $flags): array
{
return [
'dev' => 0,
diff --git a/vendor/guzzlehttp/psr7/src/UploadedFile.php b/vendor/guzzlehttp/psr7/src/UploadedFile.php
index bf342c4..b1521bc 100644
--- a/vendor/guzzlehttp/psr7/src/UploadedFile.php
+++ b/vendor/guzzlehttp/psr7/src/UploadedFile.php
@@ -1,5 +1,7 @@
setError($errorStatus);
- $this->setSize($size);
- $this->setClientFilename($clientFilename);
- $this->setClientMediaType($clientMediaType);
+ $this->size = $size;
+ $this->clientFilename = $clientFilename;
+ $this->clientMediaType = $clientMediaType;
if ($this->isOk()) {
$this->setStreamOrFile($streamOrFile);
@@ -85,11 +80,11 @@ class UploadedFile implements UploadedFileInterface
/**
* Depending on the value set file or stream variable
*
- * @param mixed $streamOrFile
+ * @param StreamInterface|string|resource $streamOrFile
*
* @throws InvalidArgumentException
*/
- private function setStreamOrFile($streamOrFile)
+ private function setStreamOrFile($streamOrFile): void
{
if (is_string($streamOrFile)) {
$this->file = $streamOrFile;
@@ -105,19 +100,11 @@ class UploadedFile implements UploadedFileInterface
}
/**
- * @param int $error
- *
* @throws InvalidArgumentException
*/
- private function setError($error)
+ private function setError(int $error): void
{
- if (false === is_int($error)) {
- throw new InvalidArgumentException(
- 'Upload file error status must be an integer'
- );
- }
-
- if (false === in_array($error, UploadedFile::$errors)) {
+ if (false === in_array($error, UploadedFile::ERRORS, true)) {
throw new InvalidArgumentException(
'Invalid error status for UploadedFile'
);
@@ -126,88 +113,20 @@ class UploadedFile implements UploadedFileInterface
$this->error = $error;
}
- /**
- * @param int $size
- *
- * @throws InvalidArgumentException
- */
- private function setSize($size)
- {
- if (false === is_int($size)) {
- throw new InvalidArgumentException(
- 'Upload file size must be an integer'
- );
- }
-
- $this->size = $size;
- }
-
- /**
- * @param mixed $param
- *
- * @return bool
- */
- private function isStringOrNull($param)
- {
- return in_array(gettype($param), ['string', 'NULL']);
- }
-
- /**
- * @param mixed $param
- *
- * @return bool
- */
- private function isStringNotEmpty($param)
+ private function isStringNotEmpty($param): bool
{
return is_string($param) && false === empty($param);
}
- /**
- * @param string|null $clientFilename
- *
- * @throws InvalidArgumentException
- */
- private function setClientFilename($clientFilename)
- {
- if (false === $this->isStringOrNull($clientFilename)) {
- throw new InvalidArgumentException(
- 'Upload file client filename must be a string or null'
- );
- }
-
- $this->clientFilename = $clientFilename;
- }
-
- /**
- * @param string|null $clientMediaType
- *
- * @throws InvalidArgumentException
- */
- private function setClientMediaType($clientMediaType)
- {
- if (false === $this->isStringOrNull($clientMediaType)) {
- throw new InvalidArgumentException(
- 'Upload file client media type must be a string or null'
- );
- }
-
- $this->clientMediaType = $clientMediaType;
- }
-
/**
* Return true if there is no upload error
- *
- * @return bool
*/
- private function isOk()
+ private function isOk(): bool
{
return $this->error === UPLOAD_ERR_OK;
}
- /**
- * @return bool
- */
- public function isMoved()
+ public function isMoved(): bool
{
return $this->moved;
}
@@ -215,7 +134,7 @@ class UploadedFile implements UploadedFileInterface
/**
* @throws RuntimeException if is moved or not ok
*/
- private function validateActive()
+ private function validateActive(): void
{
if (false === $this->isOk()) {
throw new RuntimeException('Cannot retrieve stream due to upload error');
@@ -226,12 +145,7 @@ class UploadedFile implements UploadedFileInterface
}
}
- /**
- * {@inheritdoc}
- *
- * @throws RuntimeException if the upload was not successful.
- */
- public function getStream()
+ public function getStream(): StreamInterface
{
$this->validateActive();
@@ -239,23 +153,13 @@ class UploadedFile implements UploadedFileInterface
return $this->stream;
}
- return new LazyOpenStream($this->file, 'r+');
+ /** @var string $file */
+ $file = $this->file;
+
+ return new LazyOpenStream($file, 'r+');
}
- /**
- * {@inheritdoc}
- *
- * @see http://php.net/is_uploaded_file
- * @see http://php.net/move_uploaded_file
- *
- * @param string $targetPath Path to which to move the uploaded file.
- *
- * @throws RuntimeException if the upload was not successful.
- * @throws InvalidArgumentException if the $path specified is invalid.
- * @throws RuntimeException on any error during the move operation, or on
- * the second or subsequent call to the method.
- */
- public function moveTo($targetPath)
+ public function moveTo($targetPath): void
{
$this->validateActive();
@@ -266,7 +170,7 @@ class UploadedFile implements UploadedFileInterface
}
if ($this->file) {
- $this->moved = php_sapi_name() == 'cli'
+ $this->moved = PHP_SAPI === 'cli'
? rename($this->file, $targetPath)
: move_uploaded_file($this->file, $targetPath);
} else {
@@ -285,43 +189,22 @@ class UploadedFile implements UploadedFileInterface
}
}
- /**
- * {@inheritdoc}
- *
- * @return int|null The file size in bytes or null if unknown.
- */
- public function getSize()
+ public function getSize(): ?int
{
return $this->size;
}
- /**
- * {@inheritdoc}
- *
- * @see http://php.net/manual/en/features.file-upload.errors.php
- *
- * @return int One of PHP's UPLOAD_ERR_XXX constants.
- */
- public function getError()
+ public function getError(): int
{
return $this->error;
}
- /**
- * {@inheritdoc}
- *
- * @return string|null The filename sent by the client or null if none
- * was provided.
- */
- public function getClientFilename()
+ public function getClientFilename(): ?string
{
return $this->clientFilename;
}
- /**
- * {@inheritdoc}
- */
- public function getClientMediaType()
+ public function getClientMediaType(): ?string
{
return $this->clientMediaType;
}
diff --git a/vendor/guzzlehttp/psr7/src/Uri.php b/vendor/guzzlehttp/psr7/src/Uri.php
index 0f9f020..09e878d 100644
--- a/vendor/guzzlehttp/psr7/src/Uri.php
+++ b/vendor/guzzlehttp/psr7/src/Uri.php
@@ -1,7 +1,10 @@
80,
'https' => 443,
'ftp' => 21,
@@ -35,9 +38,20 @@ class Uri implements UriInterface
'ldap' => 389,
];
- private static $charUnreserved = 'a-zA-Z0-9_\-\.~';
- private static $charSubDelims = '!\$&\'\(\)\*\+,;=';
- private static $replaceQuery = ['=' => '%3D', '&' => '%26'];
+ /**
+ * Unreserved characters for use in a regex.
+ *
+ * @link https://tools.ietf.org/html/rfc3986#section-2.3
+ */
+ private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~';
+
+ /**
+ * Sub-delims for use in a regex.
+ *
+ * @link https://tools.ietf.org/html/rfc3986#section-2.2
+ */
+ private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;=';
+ private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26'];
/** @var string Uri scheme. */
private $scheme = '';
@@ -60,21 +74,19 @@ class Uri implements UriInterface
/** @var string Uri fragment. */
private $fragment = '';
- /**
- * @param string $uri URI to parse
- */
- public function __construct($uri = '')
+ /** @var string|null String representation */
+ private $composedComponents;
+
+ public function __construct(string $uri = '')
{
- // weak type check to also accept null until we can add scalar type hints
- if ($uri != '') {
+ if ($uri !== '') {
$parts = self::parse($uri);
if ($parts === false) {
- throw new \InvalidArgumentException("Unable to parse URI: $uri");
+ throw new MalformedUriException("Unable to parse URI: $uri");
}
$this->applyParts($parts);
}
}
-
/**
* UTF-8 aware \parse_url() replacement.
*
@@ -88,19 +100,19 @@ class Uri implements UriInterface
* @see https://www.php.net/manual/en/function.parse-url.php#114817
* @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING
*
- * @param string $url
- *
* @return array|false
*/
- private static function parse($url)
+ private static function parse(string $url)
{
// If IPv6
$prefix = '';
if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) {
+ /** @var array{0:string, 1:string, 2:string} $matches */
$prefix = $matches[1];
$url = $matches[2];
}
+ /** @var string */
$encodedUrl = preg_replace_callback(
'%[^:/@?&=#]+%usD',
static function ($matches) {
@@ -118,15 +130,19 @@ class Uri implements UriInterface
return array_map('urldecode', $result);
}
- public function __toString()
+ public function __toString(): string
{
- return self::composeComponents(
- $this->scheme,
- $this->getAuthority(),
- $this->path,
- $this->query,
- $this->fragment
- );
+ if ($this->composedComponents === null) {
+ $this->composedComponents = self::composeComponents(
+ $this->scheme,
+ $this->getAuthority(),
+ $this->path,
+ $this->query,
+ $this->fragment
+ );
+ }
+
+ return $this->composedComponents;
}
/**
@@ -145,17 +161,9 @@ class Uri implements UriInterface
* `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to
* that format).
*
- * @param string $scheme
- * @param string $authority
- * @param string $path
- * @param string $query
- * @param string $fragment
- *
- * @return string
- *
* @link https://tools.ietf.org/html/rfc3986#section-5.3
*/
- public static function composeComponents($scheme, $authority, $path, $query, $fragment)
+ public static function composeComponents(?string $scheme, ?string $authority, string $path, ?string $query, ?string $fragment): string
{
$uri = '';
@@ -164,10 +172,14 @@ class Uri implements UriInterface
$uri .= $scheme . ':';
}
- if ($authority != ''|| $scheme === 'file') {
+ if ($authority != '' || $scheme === 'file') {
$uri .= '//' . $authority;
}
+ if ($authority != '' && $path != '' && $path[0] != '/') {
+ $path = '/' . $path;
+ }
+
$uri .= $path;
if ($query != '') {
@@ -186,15 +198,11 @@ class Uri implements UriInterface
*
* `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used
* independently of the implementation.
- *
- * @param UriInterface $uri
- *
- * @return bool
*/
- public static function isDefaultPort(UriInterface $uri)
+ public static function isDefaultPort(UriInterface $uri): bool
{
return $uri->getPort() === null
- || (isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()]);
+ || (isset(self::DEFAULT_PORTS[$uri->getScheme()]) && $uri->getPort() === self::DEFAULT_PORTS[$uri->getScheme()]);
}
/**
@@ -207,16 +215,12 @@ class Uri implements UriInterface
* - absolute-path references, e.g. '/path'
* - relative-path references, e.g. 'subpath'
*
- * @param UriInterface $uri
- *
- * @return bool
- *
* @see Uri::isNetworkPathReference
* @see Uri::isAbsolutePathReference
* @see Uri::isRelativePathReference
* @link https://tools.ietf.org/html/rfc3986#section-4
*/
- public static function isAbsolute(UriInterface $uri)
+ public static function isAbsolute(UriInterface $uri): bool
{
return $uri->getScheme() !== '';
}
@@ -226,13 +230,9 @@ class Uri implements UriInterface
*
* A relative reference that begins with two slash characters is termed an network-path reference.
*
- * @param UriInterface $uri
- *
- * @return bool
- *
* @link https://tools.ietf.org/html/rfc3986#section-4.2
*/
- public static function isNetworkPathReference(UriInterface $uri)
+ public static function isNetworkPathReference(UriInterface $uri): bool
{
return $uri->getScheme() === '' && $uri->getAuthority() !== '';
}
@@ -242,13 +242,9 @@ class Uri implements UriInterface
*
* A relative reference that begins with a single slash character is termed an absolute-path reference.
*
- * @param UriInterface $uri
- *
- * @return bool
- *
* @link https://tools.ietf.org/html/rfc3986#section-4.2
*/
- public static function isAbsolutePathReference(UriInterface $uri)
+ public static function isAbsolutePathReference(UriInterface $uri): bool
{
return $uri->getScheme() === ''
&& $uri->getAuthority() === ''
@@ -261,13 +257,9 @@ class Uri implements UriInterface
*
* A relative reference that does not begin with a slash character is termed a relative-path reference.
*
- * @param UriInterface $uri
- *
- * @return bool
- *
* @link https://tools.ietf.org/html/rfc3986#section-4.2
*/
- public static function isRelativePathReference(UriInterface $uri)
+ public static function isRelativePathReference(UriInterface $uri): bool
{
return $uri->getScheme() === ''
&& $uri->getAuthority() === ''
@@ -284,11 +276,9 @@ class Uri implements UriInterface
* @param UriInterface $uri The URI to check
* @param UriInterface|null $base An optional base URI to compare against
*
- * @return bool
- *
* @link https://tools.ietf.org/html/rfc3986#section-4.4
*/
- public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null)
+ public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool
{
if ($base !== null) {
$uri = UriResolver::resolve($base, $uri);
@@ -302,41 +292,6 @@ class Uri implements UriInterface
return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === '';
}
- /**
- * Removes dot segments from a path and returns the new path.
- *
- * @param string $path
- *
- * @return string
- *
- * @deprecated since version 1.4. Use UriResolver::removeDotSegments instead.
- * @see UriResolver::removeDotSegments
- */
- public static function removeDotSegments($path)
- {
- return UriResolver::removeDotSegments($path);
- }
-
- /**
- * Converts the relative URI into a new URI that is resolved against the base URI.
- *
- * @param UriInterface $base Base URI
- * @param string|UriInterface $rel Relative URI
- *
- * @return UriInterface
- *
- * @deprecated since version 1.4. Use UriResolver::resolve instead.
- * @see UriResolver::resolve
- */
- public static function resolve(UriInterface $base, $rel)
- {
- if (!($rel instanceof UriInterface)) {
- $rel = new self($rel);
- }
-
- return UriResolver::resolve($base, $rel);
- }
-
/**
* Creates a new URI with a specific query string value removed.
*
@@ -345,10 +300,8 @@ class Uri implements UriInterface
*
* @param UriInterface $uri URI to use as a base.
* @param string $key Query string key to remove.
- *
- * @return UriInterface
*/
- public static function withoutQueryValue(UriInterface $uri, $key)
+ public static function withoutQueryValue(UriInterface $uri, string $key): UriInterface
{
$result = self::getFilteredQueryString($uri, [$key]);
@@ -367,10 +320,8 @@ class Uri implements UriInterface
* @param UriInterface $uri URI to use as a base.
* @param string $key Key to set.
* @param string|null $value Value to set
- *
- * @return UriInterface
*/
- public static function withQueryValue(UriInterface $uri, $key, $value)
+ public static function withQueryValue(UriInterface $uri, string $key, ?string $value): UriInterface
{
$result = self::getFilteredQueryString($uri, [$key]);
@@ -384,17 +335,15 @@ class Uri implements UriInterface
*
* It has the same behavior as withQueryValue() but for an associative array of key => value.
*
- * @param UriInterface $uri URI to use as a base.
- * @param array $keyValueArray Associative array of key and values
- *
- * @return UriInterface
+ * @param UriInterface $uri URI to use as a base.
+ * @param array $keyValueArray Associative array of key and values
*/
- public static function withQueryValues(UriInterface $uri, array $keyValueArray)
+ public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface
{
$result = self::getFilteredQueryString($uri, array_keys($keyValueArray));
foreach ($keyValueArray as $key => $value) {
- $result[] = self::generateQueryString($key, $value);
+ $result[] = self::generateQueryString((string) $key, $value !== null ? (string) $value : null);
}
return $uri->withQuery(implode('&', $result));
@@ -403,15 +352,11 @@ class Uri implements UriInterface
/**
* Creates a URI from a hash of `parse_url` components.
*
- * @param array $parts
- *
- * @return UriInterface
- *
* @link http://php.net/manual/en/function.parse-url.php
*
- * @throws \InvalidArgumentException If the components do not form a valid URI.
+ * @throws MalformedUriException If the components do not form a valid URI.
*/
- public static function fromParts(array $parts)
+ public static function fromParts(array $parts): UriInterface
{
$uri = new self();
$uri->applyParts($parts);
@@ -420,12 +365,12 @@ class Uri implements UriInterface
return $uri;
}
- public function getScheme()
+ public function getScheme(): string
{
return $this->scheme;
}
- public function getAuthority()
+ public function getAuthority(): string
{
$authority = $this->host;
if ($this->userInfo !== '') {
@@ -439,37 +384,37 @@ class Uri implements UriInterface
return $authority;
}
- public function getUserInfo()
+ public function getUserInfo(): string
{
return $this->userInfo;
}
- public function getHost()
+ public function getHost(): string
{
return $this->host;
}
- public function getPort()
+ public function getPort(): ?int
{
return $this->port;
}
- public function getPath()
+ public function getPath(): string
{
return $this->path;
}
- public function getQuery()
+ public function getQuery(): string
{
return $this->query;
}
- public function getFragment()
+ public function getFragment(): string
{
return $this->fragment;
}
- public function withScheme($scheme)
+ public function withScheme($scheme): UriInterface
{
$scheme = $this->filterScheme($scheme);
@@ -479,13 +424,14 @@ class Uri implements UriInterface
$new = clone $this;
$new->scheme = $scheme;
+ $new->composedComponents = null;
$new->removeDefaultPort();
$new->validateState();
return $new;
}
- public function withUserInfo($user, $password = null)
+ public function withUserInfo($user, $password = null): UriInterface
{
$info = $this->filterUserInfoComponent($user);
if ($password !== null) {
@@ -498,12 +444,13 @@ class Uri implements UriInterface
$new = clone $this;
$new->userInfo = $info;
+ $new->composedComponents = null;
$new->validateState();
return $new;
}
- public function withHost($host)
+ public function withHost($host): UriInterface
{
$host = $this->filterHost($host);
@@ -513,12 +460,13 @@ class Uri implements UriInterface
$new = clone $this;
$new->host = $host;
+ $new->composedComponents = null;
$new->validateState();
return $new;
}
- public function withPort($port)
+ public function withPort($port): UriInterface
{
$port = $this->filterPort($port);
@@ -528,13 +476,14 @@ class Uri implements UriInterface
$new = clone $this;
$new->port = $port;
+ $new->composedComponents = null;
$new->removeDefaultPort();
$new->validateState();
return $new;
}
- public function withPath($path)
+ public function withPath($path): UriInterface
{
$path = $this->filterPath($path);
@@ -544,12 +493,13 @@ class Uri implements UriInterface
$new = clone $this;
$new->path = $path;
+ $new->composedComponents = null;
$new->validateState();
return $new;
}
- public function withQuery($query)
+ public function withQuery($query): UriInterface
{
$query = $this->filterQueryAndFragment($query);
@@ -559,11 +509,12 @@ class Uri implements UriInterface
$new = clone $this;
$new->query = $query;
+ $new->composedComponents = null;
return $new;
}
- public function withFragment($fragment)
+ public function withFragment($fragment): UriInterface
{
$fragment = $this->filterQueryAndFragment($fragment);
@@ -573,16 +524,22 @@ class Uri implements UriInterface
$new = clone $this;
$new->fragment = $fragment;
+ $new->composedComponents = null;
return $new;
}
+ public function jsonSerialize(): string
+ {
+ return $this->__toString();
+ }
+
/**
* Apply parse_url parts to a URI.
*
* @param array $parts Array of parse_url parts to apply.
*/
- private function applyParts(array $parts)
+ private function applyParts(array $parts): void
{
$this->scheme = isset($parts['scheme'])
? $this->filterScheme($parts['scheme'])
@@ -613,13 +570,11 @@ class Uri implements UriInterface
}
/**
- * @param string $scheme
- *
- * @return string
+ * @param mixed $scheme
*
* @throws \InvalidArgumentException If the scheme is invalid.
*/
- private function filterScheme($scheme)
+ private function filterScheme($scheme): string
{
if (!is_string($scheme)) {
throw new \InvalidArgumentException('Scheme must be a string');
@@ -629,33 +584,29 @@ class Uri implements UriInterface
}
/**
- * @param string $component
- *
- * @return string
+ * @param mixed $component
*
* @throws \InvalidArgumentException If the user info is invalid.
*/
- private function filterUserInfoComponent($component)
+ private function filterUserInfoComponent($component): string
{
if (!is_string($component)) {
throw new \InvalidArgumentException('User info must be a string');
}
return preg_replace_callback(
- '/(?:[^%' . self::$charUnreserved . self::$charSubDelims . ']+|%(?![A-Fa-f0-9]{2}))/',
+ '/(?:[^%' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ']+|%(?![A-Fa-f0-9]{2}))/',
[$this, 'rawurlencodeMatchZero'],
$component
);
}
/**
- * @param string $host
- *
- * @return string
+ * @param mixed $host
*
* @throws \InvalidArgumentException If the host is invalid.
*/
- private function filterHost($host)
+ private function filterHost($host): string
{
if (!is_string($host)) {
throw new \InvalidArgumentException('Host must be a string');
@@ -665,13 +616,11 @@ class Uri implements UriInterface
}
/**
- * @param int|null $port
- *
- * @return int|null
+ * @param mixed $port
*
* @throws \InvalidArgumentException If the port is invalid.
*/
- private function filterPort($port)
+ private function filterPort($port): ?int
{
if ($port === null) {
return null;
@@ -688,12 +637,11 @@ class Uri implements UriInterface
}
/**
- * @param UriInterface $uri
- * @param array $keys
+ * @param string[] $keys
*
- * @return array
+ * @return string[]
*/
- private static function getFilteredQueryString(UriInterface $uri, array $keys)
+ private static function getFilteredQueryString(UriInterface $uri, array $keys): array
{
$current = $uri->getQuery();
@@ -708,27 +656,21 @@ class Uri implements UriInterface
});
}
- /**
- * @param string $key
- * @param string|null $value
- *
- * @return string
- */
- private static function generateQueryString($key, $value)
+ private static function generateQueryString(string $key, ?string $value): string
{
// Query string separators ("=", "&") within the key or value need to be encoded
// (while preventing double-encoding) before setting the query string. All other
// chars that need percent-encoding will be encoded by withQuery().
- $queryString = strtr($key, self::$replaceQuery);
+ $queryString = strtr($key, self::QUERY_SEPARATORS_REPLACEMENT);
if ($value !== null) {
- $queryString .= '=' . strtr($value, self::$replaceQuery);
+ $queryString .= '=' . strtr($value, self::QUERY_SEPARATORS_REPLACEMENT);
}
return $queryString;
}
- private function removeDefaultPort()
+ private function removeDefaultPort(): void
{
if ($this->port !== null && self::isDefaultPort($this)) {
$this->port = null;
@@ -738,20 +680,18 @@ class Uri implements UriInterface
/**
* Filters the path of a URI
*
- * @param string $path
- *
- * @return string
+ * @param mixed $path
*
* @throws \InvalidArgumentException If the path is invalid.
*/
- private function filterPath($path)
+ private function filterPath($path): string
{
if (!is_string($path)) {
throw new \InvalidArgumentException('Path must be a string');
}
return preg_replace_callback(
- '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/',
+ '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/',
[$this, 'rawurlencodeMatchZero'],
$path
);
@@ -760,31 +700,29 @@ class Uri implements UriInterface
/**
* Filters the query string or fragment of a URI.
*
- * @param string $str
- *
- * @return string
+ * @param mixed $str
*
* @throws \InvalidArgumentException If the query or fragment is invalid.
*/
- private function filterQueryAndFragment($str)
+ private function filterQueryAndFragment($str): string
{
if (!is_string($str)) {
throw new \InvalidArgumentException('Query and fragment must be a string');
}
return preg_replace_callback(
- '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/',
+ '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/',
[$this, 'rawurlencodeMatchZero'],
$str
);
}
- private function rawurlencodeMatchZero(array $match)
+ private function rawurlencodeMatchZero(array $match): string
{
return rawurlencode($match[0]);
}
- private function validateState()
+ private function validateState(): void
{
if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) {
$this->host = self::HTTP_DEFAULT_HOST;
@@ -792,19 +730,11 @@ class Uri implements UriInterface
if ($this->getAuthority() === '') {
if (0 === strpos($this->path, '//')) {
- throw new \InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"');
+ throw new MalformedUriException('The path of a URI without an authority must not start with two slashes "//"');
}
if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) {
- throw new \InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon');
+ throw new MalformedUriException('A relative URI must not have a path beginning with a segment containing a colon');
}
- } elseif (isset($this->path[0]) && $this->path[0] !== '/') {
- @trigger_error(
- 'The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI ' .
- 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.',
- E_USER_DEPRECATED
- );
- $this->path = '/' . $this->path;
- //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty');
}
}
}
diff --git a/vendor/guzzlehttp/psr7/src/UriComparator.php b/vendor/guzzlehttp/psr7/src/UriComparator.php
index ccf51ff..70c582a 100644
--- a/vendor/guzzlehttp/psr7/src/UriComparator.php
+++ b/vendor/guzzlehttp/psr7/src/UriComparator.php
@@ -1,5 +1,7 @@
getHost(), $modified->getHost()) !== 0) {
return true;
@@ -34,10 +34,7 @@ final class UriComparator
return false;
}
- /**
- * @return int
- */
- private static function computePort(UriInterface $uri)
+ private static function computePort(UriInterface $uri): int
{
$port = $uri->getPort();
diff --git a/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/vendor/guzzlehttp/psr7/src/UriNormalizer.php
index 81419ea..e12971e 100644
--- a/vendor/guzzlehttp/psr7/src/UriNormalizer.php
+++ b/vendor/guzzlehttp/psr7/src/UriNormalizer.php
@@ -1,5 +1,7 @@
getScheme() !== '' &&
($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '')
@@ -174,6 +162,7 @@ final class UriResolver
// inherit the base query component when resolving.
if ($target->getQuery() === '') {
$segments = explode('/', $target->getPath());
+ /** @var string $lastSegment */
$lastSegment = end($segments);
return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment);
@@ -182,7 +171,7 @@ final class UriResolver
return $emptyPathUri;
}
- private static function getRelativePath(UriInterface $base, UriInterface $target)
+ private static function getRelativePath(UriInterface $base, UriInterface $target): string
{
$sourceSegments = explode('/', $base->getPath());
$targetSegments = explode('/', $target->getPath());
diff --git a/vendor/guzzlehttp/psr7/src/Utils.php b/vendor/guzzlehttp/psr7/src/Utils.php
index 6b6c8cc..3a4cf39 100644
--- a/vendor/guzzlehttp/psr7/src/Utils.php
+++ b/vendor/guzzlehttp/psr7/src/Utils.php
@@ -1,5 +1,7 @@
$keys
- *
- * @return array
+ * @param string[] $keys
*/
- public static function caselessRemove($keys, array $data)
+ public static function caselessRemove(array $keys, array $data): array
{
$result = [];
@@ -25,7 +25,7 @@ final class Utils
}
foreach ($data as $k => $v) {
- if (!in_array(strtolower($k), $keys)) {
+ if (!is_string($k) || !in_array(strtolower($k), $keys)) {
$result[$k] = $v;
}
}
@@ -44,7 +44,7 @@ final class Utils
*
* @throws \RuntimeException on error.
*/
- public static function copyToStream(StreamInterface $source, StreamInterface $dest, $maxLen = -1)
+ public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void
{
$bufferSize = 8192;
@@ -76,19 +76,16 @@ final class Utils
* @param int $maxLen Maximum number of bytes to read. Pass -1
* to read the entire stream.
*
- * @return string
- *
* @throws \RuntimeException on error.
*/
- public static function copyToString(StreamInterface $stream, $maxLen = -1)
+ public static function copyToString(StreamInterface $stream, int $maxLen = -1): string
{
$buffer = '';
if ($maxLen === -1) {
while (!$stream->eof()) {
$buf = $stream->read(1048576);
- // Using a loose equality here to match on '' and false.
- if ($buf == null) {
+ if ($buf === '') {
break;
}
$buffer .= $buf;
@@ -99,8 +96,7 @@ final class Utils
$len = 0;
while (!$stream->eof() && $len < $maxLen) {
$buf = $stream->read($maxLen - $len);
- // Using a loose equality here to match on '' and false.
- if ($buf == null) {
+ if ($buf === '') {
break;
}
$buffer .= $buf;
@@ -120,11 +116,9 @@ final class Utils
* @param string $algo Hash algorithm (e.g. md5, crc32, etc)
* @param bool $rawOutput Whether or not to use raw output
*
- * @return string Returns the hash of the stream
- *
* @throws \RuntimeException on error.
*/
- public static function hash(StreamInterface $stream, $algo, $rawOutput = false)
+ public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string
{
$pos = $stream->tell();
@@ -137,7 +131,7 @@ final class Utils
hash_update($ctx, $stream->read(1048576));
}
- $out = hash_final($ctx, (bool) $rawOutput);
+ $out = hash_final($ctx, $rawOutput);
$stream->seek($pos);
return $out;
@@ -160,10 +154,8 @@ final class Utils
*
* @param RequestInterface $request Request to clone and modify.
* @param array $changes Changes to apply.
- *
- * @return RequestInterface
*/
- public static function modifyRequest(RequestInterface $request, array $changes)
+ public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface
{
if (!$changes) {
return $request;
@@ -204,13 +196,11 @@ final class Utils
if ($request instanceof ServerRequestInterface) {
$new = (new ServerRequest(
- isset($changes['method']) ? $changes['method'] : $request->getMethod(),
+ $changes['method'] ?? $request->getMethod(),
$uri,
$headers,
- isset($changes['body']) ? $changes['body'] : $request->getBody(),
- isset($changes['version'])
- ? $changes['version']
- : $request->getProtocolVersion(),
+ $changes['body'] ?? $request->getBody(),
+ $changes['version'] ?? $request->getProtocolVersion(),
$request->getServerParams()
))
->withParsedBody($request->getParsedBody())
@@ -226,13 +216,11 @@ final class Utils
}
return new Request(
- isset($changes['method']) ? $changes['method'] : $request->getMethod(),
+ $changes['method'] ?? $request->getMethod(),
$uri,
$headers,
- isset($changes['body']) ? $changes['body'] : $request->getBody(),
- isset($changes['version'])
- ? $changes['version']
- : $request->getProtocolVersion()
+ $changes['body'] ?? $request->getBody(),
+ $changes['version'] ?? $request->getProtocolVersion()
);
}
@@ -241,17 +229,14 @@ final class Utils
*
* @param StreamInterface $stream Stream to read from
* @param int|null $maxLength Maximum buffer length
- *
- * @return string
*/
- public static function readLine(StreamInterface $stream, $maxLength = null)
+ public static function readLine(StreamInterface $stream, ?int $maxLength = null): string
{
$buffer = '';
$size = 0;
while (!$stream->eof()) {
- // Using a loose equality here to match on '' and false.
- if (null == ($byte = $stream->read(1))) {
+ if ('' === ($byte = $stream->read(1))) {
return $buffer;
}
$buffer .= $byte;
@@ -294,18 +279,16 @@ final class Utils
* buffered and used in subsequent reads.
*
* @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data
- * @param array $options Additional options
- *
- * @return StreamInterface
+ * @param array{size?: int, metadata?: array} $options Additional options
*
* @throws \InvalidArgumentException if the $resource arg is not valid.
*/
- public static function streamFor($resource = '', array $options = [])
+ public static function streamFor($resource = '', array $options = []): StreamInterface
{
if (is_scalar($resource)) {
$stream = self::tryFopen('php://temp', 'r+');
if ($resource !== '') {
- fwrite($stream, $resource);
+ fwrite($stream, (string) $resource);
fseek($stream, 0);
}
return new Stream($stream, $options);
@@ -317,15 +300,17 @@ final class Utils
* The 'php://input' is a special stream with quirks and inconsistencies.
* We avoid using that stream by reading it into php://temp
*/
- $metaData = \stream_get_meta_data($resource);
- if (isset($metaData['uri']) && $metaData['uri'] === 'php://input') {
+
+ /** @var resource $resource */
+ if ((\stream_get_meta_data($resource)['uri'] ?? '') === 'php://input') {
$stream = self::tryFopen('php://temp', 'w+');
- fwrite($stream, stream_get_contents($resource));
+ stream_copy_to_stream($resource, $stream);
fseek($stream, 0);
$resource = $stream;
}
return new Stream($resource, $options);
case 'object':
+ /** @var object $resource */
if ($resource instanceof StreamInterface) {
return $resource;
} elseif ($resource instanceof \Iterator) {
@@ -338,7 +323,7 @@ final class Utils
return $result;
}, $options);
} elseif (method_exists($resource, '__toString')) {
- return Utils::streamFor((string) $resource, $options);
+ return self::streamFor((string) $resource, $options);
}
break;
case 'NULL':
@@ -365,21 +350,22 @@ final class Utils
*
* @throws \RuntimeException if the file cannot be opened
*/
- public static function tryFopen($filename, $mode)
+ public static function tryFopen(string $filename, string $mode)
{
$ex = null;
- set_error_handler(function () use ($filename, $mode, &$ex) {
+ set_error_handler(static function (int $errno, string $errstr) use ($filename, $mode, &$ex): bool {
$ex = new \RuntimeException(sprintf(
'Unable to open "%s" using mode "%s": %s',
$filename,
$mode,
- func_get_args()[1]
+ $errstr
));
return true;
});
try {
+ /** @var resource $handle */
$handle = fopen($filename, $mode);
} catch (\Throwable $e) {
$ex = new \RuntimeException(sprintf(
@@ -400,6 +386,53 @@ final class Utils
return $handle;
}
+ /**
+ * Safely gets the contents of a given stream.
+ *
+ * When stream_get_contents fails, PHP normally raises a warning. This
+ * function adds an error handler that checks for errors and throws an
+ * exception instead.
+ *
+ * @param resource $stream
+ *
+ * @throws \RuntimeException if the stream cannot be read
+ */
+ public static function tryGetContents($stream): string
+ {
+ $ex = null;
+ set_error_handler(static function (int $errno, string $errstr) use (&$ex): bool {
+ $ex = new \RuntimeException(sprintf(
+ 'Unable to read stream contents: %s',
+ $errstr
+ ));
+
+ return true;
+ });
+
+ try {
+ /** @var string|false $contents */
+ $contents = stream_get_contents($stream);
+
+ if ($contents === false) {
+ $ex = new \RuntimeException('Unable to read stream contents');
+ }
+ } catch (\Throwable $e) {
+ $ex = new \RuntimeException(sprintf(
+ 'Unable to read stream contents: %s',
+ $e->getMessage()
+ ), 0, $e);
+ }
+
+ restore_error_handler();
+
+ if ($ex) {
+ /** @var $ex \RuntimeException */
+ throw $ex;
+ }
+
+ return $contents;
+ }
+
/**
* Returns a UriInterface for the given value.
*
@@ -409,11 +442,9 @@ final class Utils
*
* @param string|UriInterface $uri
*
- * @return UriInterface
- *
* @throws \InvalidArgumentException
*/
- public static function uriFor($uri)
+ public static function uriFor($uri): UriInterface
{
if ($uri instanceof UriInterface) {
return $uri;
diff --git a/vendor/guzzlehttp/psr7/src/functions.php b/vendor/guzzlehttp/psr7/src/functions.php
deleted file mode 100644
index b0901fa..0000000
--- a/vendor/guzzlehttp/psr7/src/functions.php
+++ /dev/null
@@ -1,422 +0,0 @@
- '1', 'foo[b]' => '2'])`.
- *
- * @param string $str Query string to parse
- * @param int|bool $urlEncoding How the query string is encoded
- *
- * @return array
- *
- * @deprecated parse_query will be removed in guzzlehttp/psr7:2.0. Use Query::parse instead.
- */
-function parse_query($str, $urlEncoding = true)
-{
- return Query::parse($str, $urlEncoding);
-}
-
-/**
- * Build a query string from an array of key value pairs.
- *
- * This function can use the return value of `parse_query()` to build a query
- * string. This function does not modify the provided keys when an array is
- * encountered (like `http_build_query()` would).
- *
- * @param array $params Query string parameters.
- * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
- * to encode using RFC3986, or PHP_QUERY_RFC1738
- * to encode using RFC1738.
- *
- * @return string
- *
- * @deprecated build_query will be removed in guzzlehttp/psr7:2.0. Use Query::build instead.
- */
-function build_query(array $params, $encoding = PHP_QUERY_RFC3986)
-{
- return Query::build($params, $encoding);
-}
-
-/**
- * Determines the mimetype of a file by looking at its extension.
- *
- * @param string $filename
- *
- * @return string|null
- *
- * @deprecated mimetype_from_filename will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromFilename instead.
- */
-function mimetype_from_filename($filename)
-{
- return MimeType::fromFilename($filename);
-}
-
-/**
- * Maps a file extensions to a mimetype.
- *
- * @param $extension string The file extension.
- *
- * @return string|null
- *
- * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
- * @deprecated mimetype_from_extension will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromExtension instead.
- */
-function mimetype_from_extension($extension)
-{
- return MimeType::fromExtension($extension);
-}
-
-/**
- * Parses an HTTP message into an associative array.
- *
- * The array contains the "start-line" key containing the start line of
- * the message, "headers" key containing an associative array of header
- * array values, and a "body" key containing the body of the message.
- *
- * @param string $message HTTP request or response to parse.
- *
- * @return array
- *
- * @internal
- *
- * @deprecated _parse_message will be removed in guzzlehttp/psr7:2.0. Use Message::parseMessage instead.
- */
-function _parse_message($message)
-{
- return Message::parseMessage($message);
-}
-
-/**
- * Constructs a URI for an HTTP request message.
- *
- * @param string $path Path from the start-line
- * @param array $headers Array of headers (each value an array).
- *
- * @return string
- *
- * @internal
- *
- * @deprecated _parse_request_uri will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequestUri instead.
- */
-function _parse_request_uri($path, array $headers)
-{
- return Message::parseRequestUri($path, $headers);
-}
-
-/**
- * Get a short summary of the message body.
- *
- * Will return `null` if the response is not printable.
- *
- * @param MessageInterface $message The message to get the body summary
- * @param int $truncateAt The maximum allowed size of the summary
- *
- * @return string|null
- *
- * @deprecated get_message_body_summary will be removed in guzzlehttp/psr7:2.0. Use Message::bodySummary instead.
- */
-function get_message_body_summary(MessageInterface $message, $truncateAt = 120)
-{
- return Message::bodySummary($message, $truncateAt);
-}
-
-/**
- * Remove the items given by the keys, case insensitively from the data.
- *
- * @param iterable $keys
- *
- * @return array
- *
- * @internal
- *
- * @deprecated _caseless_remove will be removed in guzzlehttp/psr7:2.0. Use Utils::caselessRemove instead.
- */
-function _caseless_remove($keys, array $data)
-{
- return Utils::caselessRemove($keys, $data);
-}
diff --git a/vendor/guzzlehttp/psr7/src/functions_include.php b/vendor/guzzlehttp/psr7/src/functions_include.php
deleted file mode 100644
index 96a4a83..0000000
--- a/vendor/guzzlehttp/psr7/src/functions_include.php
+++ /dev/null
@@ -1,6 +0,0 @@
- 'QueryList',
- 'wd2' => 'teststr'
-]);
-
-//opt
-
-$rt = GHttp::get('https://www.baidu.com/s',[
- 'wd' => 'QueryList'
-],[
- 'headers' => [
- 'referer' => 'https://baidu.com',
- 'User-Agent' => 'Mozilla/5.0 (Windows NTChrome/58.0.3029.110 Safari/537.36',
- 'Cookie' => 'cookie xxx'
- ]
-]);
-
-$rt = GHttp::getJson('https://xxxx.com/json');
-
-```
-
-#### 2.post / postRaw / postJson
-```php
-$rt = GHttp::post('https://www.posttestserver.com/post.php',[
- 'name' => 'QueryList',
- 'password' => 'ql'
-]);
-
-$rt = GHttp::post('https://www.posttestserver.com/post.php','name=QueryList&password=ql');
-
-
-$rt = GHttp::postRaw('http://httpbin.org/post','raw data');
-$rt = GHttp::postRaw('http://httpbin.org/post',['aa' => 11,'bb' => 22]);
-
-
-$rt = GHttp::postJson('http://httpbin.org/post',['aa' => 11,'bb' => 22]);
-$rt = GHttp::postJson('http://httpbin.org/post','aa=11&bb=22');
-
-```
-#### 3.download
-
-```php
-GHttp::download('http://sw.bos.baidu.com/setup.exe','./path/to/xx.exe');
-```
-### 4. concurrent requests
-```php
-use Jaeger\GHttp;
-
-$urls = [
- 'http://httpbin.org/get?name=php',
- 'http://httpbin.org/get?name=go',
- 'http://httpbin.org/get?name=c#',
- 'http://httpbin.org/get?name=java'
-];
-
-GHttp::multiRequest($urls)->withHeaders([
- 'X-Powered-By' => 'Jaeger'
-])->withOptions([
- 'timeout' => 10
-])->concurrency(2)->success(function($response,$index){
- print_r((String)$response->getBody());
- print_r($index);
-})->error(function($reason,$index){
- print_r($reason);
-})->get();
-```
-
-```php
-use Jaeger\GHttp;
-use GuzzleHttp\Psr7\Request;
-
-$requests = [
- new Request('POST','http://httpbin.org/post',[
- 'Content-Type' => 'application/x-www-form-urlencoded',
- 'User-Agent' => 'g-http'
- ],http_build_query([
- 'name' => 'php'
- ])),
- new Request('POST','http://httpbin.org/post',[
- 'Content-Type' => 'application/x-www-form-urlencoded',
- 'User-Agent' => 'g-http'
- ],http_build_query([
- 'name' => 'go'
- ])),
- new Request('POST','http://httpbin.org/post',[
- 'Content-Type' => 'application/x-www-form-urlencoded',
- 'User-Agent' => 'g-http'
- ],http_build_query([
- 'name' => 'c#'
- ]))
-];
-
-GHttp::multiRequest($requests)->success(function($response,$index){
- print_r((String)$response->getBody());
- print_r($index);
-})->post();
-```
-### 5. Request with cache
-
-Base on PHP-Cache: http://www.php-cache.com
-
-- Use filesystem cache
-```php
-use Jaeger\GHttp;
-
-$rt = GHttp::get('http://httpbin.org/get',[
- 'wd' => 'QueryList'
-],[
- 'cache' => __DIR__,
- 'cache_ttl' => 120 //seconds
-]);
-
-```
-
-- Use predis cache
-
-Install predis adapter:
-```
-composer require cache/predis-adapter
-```
-
-Usage:
-```php
-use Jaeger\GHttp;
-use Cache\Adapter\Predis\PredisCachePool;
-
-$client = new \Predis\Client('tcp:/127.0.0.1:6379');
-$pool = new PredisCachePool($client);
-
-$rt = GHttp::get('http://httpbin.org/get',[
- 'wd' => 'QueryList'
-],[
- 'cache' => $pool,
- 'cache_ttl' => 120 //seconds
-]);
-```
\ No newline at end of file
diff --git a/vendor/jaeger/g-http/composer.json b/vendor/jaeger/g-http/composer.json
deleted file mode 100644
index 6781037..0000000
--- a/vendor/jaeger/g-http/composer.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "jaeger/g-http",
- "description": "Simple Http client base on GuzzleHttp",
- "license": "MIT",
- "authors": [
- {
- "name": "Jaeger",
- "email": "JaegerCode@gmail.com"
- }
- ],
- "require": {
- "cache/filesystem-adapter": "^1",
- "guzzlehttp/guzzle": "^6.0 | ^7.0"
- },
- "autoload":{
- "psr-4":{
- "Jaeger\\":"src"
- }
- }
-}
diff --git a/vendor/jaeger/g-http/examples/multi_request.php b/vendor/jaeger/g-http/examples/multi_request.php
deleted file mode 100644
index b2a138d..0000000
--- a/vendor/jaeger/g-http/examples/multi_request.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
- * Date: 18/12/10
- * Time: 下午4:04
- */
-require __DIR__.'/../vendor/autoload.php';
-use Jaeger\GHttp;
-
-$urls = [
- 'http://httpbin.org/get?name=php',
- 'http://httpbin.org/get?name=go',
- 'http://httpbin.org/get?name=c#',
- 'http://httpbin.org/get?name=java'
-];
-
-GHttp::multiRequest($urls)->withHeaders([
- 'X-Powered-By' => 'Jaeger'
-])->withOptions([
- 'timeout' => 10
-])->concurrency(2)->success(function($response,$index){
- print_r((String)$response->getBody());
- print_r($index);
-})->error(function($reason,$index){
- print_r($reason);
-})->get();
\ No newline at end of file
diff --git a/vendor/jaeger/g-http/examples/multi_request_2.php b/vendor/jaeger/g-http/examples/multi_request_2.php
deleted file mode 100644
index d66612b..0000000
--- a/vendor/jaeger/g-http/examples/multi_request_2.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
- * Date: 18/12/10
- * Time: 下午6:51
- */
-
-require __DIR__.'/../vendor/autoload.php';
-use Jaeger\GHttp;
-use GuzzleHttp\Psr7\Request;
-
-$requests = [
- new Request('POST','http://httpbin.org/post',[
- 'Content-Type' => 'application/x-www-form-urlencoded',
- 'User-Agent' => 'g-http'
- ],http_build_query([
- 'name' => 'php'
- ])),
- new Request('POST','http://httpbin.org/post',[
- 'Content-Type' => 'application/x-www-form-urlencoded',
- 'User-Agent' => 'g-http'
- ],http_build_query([
- 'name' => 'go'
- ])),
- new Request('POST','http://httpbin.org/post',[
- 'Content-Type' => 'application/x-www-form-urlencoded',
- 'User-Agent' => 'g-http'
- ],http_build_query([
- 'name' => 'c#'
- ]))
-];
-
-GHttp::multiRequest($requests)->success(function($response,$index){
- print_r((String)$response->getBody());
- print_r($index);
-})->post();
\ No newline at end of file
diff --git a/vendor/jaeger/g-http/examples/request_with_cache.php b/vendor/jaeger/g-http/examples/request_with_cache.php
deleted file mode 100644
index cdefdbb..0000000
--- a/vendor/jaeger/g-http/examples/request_with_cache.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
- * Date: 18/12/11
- * Time: 下午6:48
- */
-
-require __DIR__.'/../vendor/autoload.php';
-use Jaeger\GHttp;
-use Cache\Adapter\Predis\PredisCachePool;
-
-
-$rt = GHttp::get('http://httpbin.org/get',[
- 'wd' => 'QueryList'
-],[
- 'cache' => __DIR__,
- 'cache_ttl' => 120
-]);
-
-print_r($rt);
-
-$client = new \Predis\Client('tcp:/127.0.0.1:6379');
-$pool = new PredisCachePool($client);
-
-$rt = GHttp::get('http://httpbin.org/get',[
- 'wd' => 'QueryList'
-],[
- 'cache' => $pool,
- 'cache_ttl' => 120
-]);
-
-print_r($rt);
\ No newline at end of file
diff --git a/vendor/jaeger/g-http/examples/simple.php b/vendor/jaeger/g-http/examples/simple.php
deleted file mode 100644
index df65510..0000000
--- a/vendor/jaeger/g-http/examples/simple.php
+++ /dev/null
@@ -1,22 +0,0 @@
-
- * Date: 18/12/11
- * Time: 下午6:48
- */
-
-require __DIR__.'/../vendor/autoload.php';
-use Jaeger\GHttp;
-
-$rt = GHttp::get('http://httpbin.org/get',[
- 'wd' => 'QueryList'
-],[
- 'headers' => [
- 'referer' => 'https://baidu.com',
- 'User-Agent' => 'Mozilla/5.0 (Windows NTChrome/58.0.3029.110 Safari/537.36',
- 'Cookie' => 'cookie xxx'
- ],
-]);
-
-print_r($rt);
diff --git a/vendor/jaeger/g-http/src/Cache.php b/vendor/jaeger/g-http/src/Cache.php
deleted file mode 100644
index f163a6e..0000000
--- a/vendor/jaeger/g-http/src/Cache.php
+++ /dev/null
@@ -1,65 +0,0 @@
-
- * Date: 18/12/11
- * Time: 下午6:39
- */
-
-namespace Jaeger;
-
-
-use Cache\Adapter\Common\AbstractCachePool;
-use Cache\Adapter\Filesystem\FilesystemCachePool;
-use League\Flysystem\Adapter\Local;
-use League\Flysystem\Filesystem;
-
-class Cache extends GHttp
-{
- public static function remember($name, $arguments)
- {
- $cachePool = null;
- $cacheConfig = self::initCacheConfig($arguments);
-
- if (empty($cacheConfig['cache'])) {
- return self::$name(...$arguments);
- }
- if (is_string($cacheConfig['cache'])) {
- $filesystemAdapter = new Local($cacheConfig['cache']);
- $filesystem = new Filesystem($filesystemAdapter);
- $cachePool = new FilesystemCachePool($filesystem);
- }else if ($cacheConfig['cache'] instanceof AbstractCachePool) {
- $cachePool = $cacheConfig['cache'];
- }
-
- $cacheKey = self::getCacheKey($name,$arguments);
- $data = $cachePool->get($cacheKey);
- if(empty($data)) {
- $data = self::$name(...$arguments);
- if(!empty($data)) {
- $cachePool->set($cacheKey,$data,$cacheConfig['cache_ttl']);
- }
- }
- return $data;
- }
-
- protected static function initCacheConfig($arguments)
- {
- $cacheConfig = [
- 'cache' => null,
- 'cache_ttl' => null
- ];
- if(!empty($arguments[2])) {
- $cacheConfig = array_merge([
- 'cache' => null,
- 'cache_ttl' => null
- ],$arguments[2]);
- }
- return $cacheConfig;
- }
-
- protected static function getCacheKey($name, $arguments)
- {
- return md5($name.'_'.json_encode($arguments));
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/g-http/src/GHttp.php b/vendor/jaeger/g-http/src/GHttp.php
deleted file mode 100644
index 8daf808..0000000
--- a/vendor/jaeger/g-http/src/GHttp.php
+++ /dev/null
@@ -1,164 +0,0 @@
-
- *
- * @Version V1.0
- */
-
-namespace Jaeger;
-
-use GuzzleHttp\Client;
-
-/**
- * Class GHttp
- * @package Jaeger
- *
- * @method static string get($url,$args = null,$otherArgs = [])
- * @method static mixed getJson($url, $args = null, $otherArgs = [])
- * @method static string post($url,$args = null,$otherArgs = [])
- * @method static string postRaw($url, $raw = null, $otherArgs = [])
- * @method static string postJson($url, $args = null, $otherArgs = [])
- */
-class GHttp
-{
- private static $client = null;
-
- public static function __callStatic($name, $arguments)
- {
- $protectedName = '_'.$name;
- if(method_exists(self::class,$protectedName)){
- return Cache::remember($protectedName, $arguments);
- }
- throw new MethodNotFoundException('Call undefined method '.self::class.':'.$name.'()');
- }
-
- public static function getClient(array $config = [])
- {
- if(self::$client == null){
- self::$client = new Client($config);
- }
- return self::$client;
- }
-
- /**
- * @param $url
- * @param array $args
- * @param array $otherArgs
- * @return string
- */
- protected static function _get($url,$args = null,$otherArgs = [])
- {
- is_string($args) && parse_str($args,$args);
- $args = array_merge([
- 'verify' => false,
- 'query' => $args,
- 'headers' => [
- 'referer' => $url,
- 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
- ]
- ],$otherArgs);
- $client = self::getClient();
- $response = $client->request('GET', $url,$args);
- return (string)$response->getBody();
- }
-
- protected static function _getJson($url, $args = null, $otherArgs = [])
- {
- $data = self::get($url, $args , $otherArgs);
- return json_decode($data,JSON_UNESCAPED_UNICODE);
- }
-
- /**
- * @param $url
- * @param array $args
- * @param array $otherArgs
- * @return string
- */
- protected static function _post($url,$args = null,$otherArgs = [])
- {
- is_string($args) && parse_str($args,$args);
- $args = array_merge([
- 'verify' => false,
- 'form_params' => $args,
- 'headers' => [
- 'referer' => $url,
- 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
- ]
- ],$otherArgs);
- $client = self::getClient();
- $response = $client->request('Post', $url,$args);
- return (string)$response->getBody();
- }
-
- /**
- * @param $url
- * @param null $raw
- * @param array $otherArgs
- * @return string
- */
- protected static function _postRaw($url, $raw = null, $otherArgs = [])
- {
- is_array($raw) && $raw = json_encode($raw);
- $args = array_merge([
- 'verify' => false,
- 'body' => $raw,
- 'headers' => [
- 'referer' => $url,
- 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
- ]
- ],$otherArgs);
- $client = self::getClient();
- $response = $client->request('Post', $url,$args);
- return (string)$response->getBody();
- }
-
- /**
- * @param $url
- * @param null $args
- * @param array $otherArgs
- * @return string
- */
- protected static function _postJson($url, $args = null, $otherArgs = [])
- {
- is_string($args) && parse_str($args,$args);
- $args = array_merge([
- 'verify' => false,
- 'json' => $args,
- 'headers' => [
- 'referer' => $url,
- 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
- ]
- ],$otherArgs);
- $client = self::getClient();
- $response = $client->request('Post', $url,$args);
- return (string)$response->getBody();
- }
-
- /**
- * @param $url
- * @param $filePath
- * @param null $args
- * @param array $otherArgs
- * @return string
- */
- public static function download($url,$filePath,$args = null,$otherArgs = [])
- {
- $otherArgs = array_merge($otherArgs,[
- 'sink' => $filePath,
- ]);
- return self::get($url,$args,$otherArgs);
- }
-
- /**
- * @param $urls
- * @return MultiRequest
- */
- public static function multiRequest($urls)
- {
- $client = self::getClient();
- return MultiRequest::newRequest($client)->urls($urls);
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/g-http/src/MethodNotFoundException.php b/vendor/jaeger/g-http/src/MethodNotFoundException.php
deleted file mode 100644
index dc6e527..0000000
--- a/vendor/jaeger/g-http/src/MethodNotFoundException.php
+++ /dev/null
@@ -1,19 +0,0 @@
-
- * Date: 18/12/12
- * Time: 上午10:56
- */
-
-namespace Jaeger;
-use Exception;
-use Throwable;
-
-class MethodNotFoundException extends Exception
-{
- public function __construct($message = "", $code = 0, Throwable $previous = null)
- {
- parent::__construct($message, $code, $previous);
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/g-http/src/MultiRequest.php b/vendor/jaeger/g-http/src/MultiRequest.php
deleted file mode 100644
index d77fc7f..0000000
--- a/vendor/jaeger/g-http/src/MultiRequest.php
+++ /dev/null
@@ -1,113 +0,0 @@
-
- * Date: 18/12/10
- * Time: 下午6:04
- */
-
-namespace Jaeger;
-use GuzzleHttp\Client;
-use Closure;
-use GuzzleHttp\Pool;
-use GuzzleHttp\Psr7\Request;
-
-class MultiRequest
-{
- protected $client;
- protected $headers = [];
- protected $options = [];
- protected $successCallback;
- protected $errorCallback;
- protected $urls = [];
- protected $method;
- protected $concurrency = 5;
-
- public function __construct(Client $client)
- {
- $this->client = $client;
- $this->headers = [
- 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
- ];
- }
-
- public static function newRequest(Client $client)
- {
- $request = new self($client);
- return $request;
- }
-
- public function withHeaders($headers)
- {
- $this->headers = array_merge($this->headers,$headers);
- return $this;
- }
-
- public function withOptions($options)
- {
- $this->options = $options;
- return $this;
- }
-
- public function concurrency($concurrency)
- {
- $this->concurrency = $concurrency;
- return $this;
- }
-
- public function success(Closure $success)
- {
- $this->successCallback = $success;
- return $this;
- }
-
- public function error(Closure $error)
- {
- $this->errorCallback = $error;
- return $this;
- }
-
- public function urls(array $urls)
- {
- $this->urls = $urls;
- return $this;
- }
-
- public function get()
- {
- $this->method = 'GET';
- $this->send();
- }
-
- public function post()
- {
- $this->method = 'POST';
- $this->send();
- }
-
- protected function send()
- {
- $client = $this->client;
-
- $requests = function ($urls) use($client){
- foreach ($urls as $url) {
- if (is_string($url)) {
- yield new Request($this->method,$url,$this->headers);
- } else {
- yield $url;
- }
- }
- };
-
- $pool = new Pool($client, $requests($this->urls), [
- 'concurrency' => $this->concurrency,
- 'fulfilled' => $this->successCallback,
- 'rejected' => $this->errorCallback,
- 'options' => $this->options
- ]);
-
- $promise = $pool->promise();
- $promise->wait();
- }
-
-}
\ No newline at end of file
diff --git a/vendor/jaeger/phpquery-single/README.md b/vendor/jaeger/phpquery-single/README.md
deleted file mode 100644
index 903163e..0000000
--- a/vendor/jaeger/phpquery-single/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# phpQuery-single
-phpQuery onefile composer.Continuous maintenance,Welcome PR.
-
-`QueryList` base on phpQuery: https://github.com/jae-jae/QueryList
-
-phpQuery单文件版本,持续维护,欢迎PR.
-> phpQuery项目主页:http://code.google.com/p/phpquery/
-
-`QueryList`是基于phpQuery的采集工具: https://github.com/jae-jae/QueryList
-
-## Composer Installation
-Packagist: https://packagist.org/packages/jaeger/phpquery-single
-```
-composer require jaeger/phpquery-single
-```
-
-## Usage
-```php
-$html = <<
-
- 其它的一些 文本
-
-STR;
-
-$doc = phpQuery::newDocumentHTML($html);
-
-$src = $doc->find('.two img:eq(0)')->attr('src');
-
-echo $src;
-// http://querylist.cc/1.jpg
-```
\ No newline at end of file
diff --git a/vendor/jaeger/phpquery-single/composer.json b/vendor/jaeger/phpquery-single/composer.json
deleted file mode 100644
index 24fe5a4..0000000
--- a/vendor/jaeger/phpquery-single/composer.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "jaeger/phpquery-single",
- "description": "phpQuery单文件版本,是Querylist的依赖(http://querylist.cc/),phpQuery项目主页:http://code.google.com/p/phpquery/",
- "homepage": "http://code.google.com/p/phpquery/",
- "license": "MIT",
- "require": {
- "PHP":">=5.3.0"
- },
- "authors": [
- {
- "name": "Tobiasz Cudnik"
- ,"email": "tobiasz.cudnik@gmail.com"
- ,"homepage": "https://github.com/TobiaszCudnik"
- ,"role": "Developer"
- }
- ,{
- "name": "Jaeger",
- "role": "Packager"
- }
- ],
- "autoload":{
- "classmap":["phpQuery.php"]
- }
-}
diff --git a/vendor/jaeger/phpquery-single/phpQuery.php b/vendor/jaeger/phpquery-single/phpQuery.php
deleted file mode 100644
index 90391cd..0000000
--- a/vendor/jaeger/phpquery-single/phpQuery.php
+++ /dev/null
@@ -1,6086 +0,0 @@
-
- * @license http://www.opensource.org/licenses/mit-license.php MIT License
- * @package phpQuery
- */
-
-// class names for instanceof
-// TODO move them as class constants into phpQuery
-define('DOMDOCUMENT', 'DOMDocument');
-define('DOMELEMENT', 'DOMElement');
-define('DOMNODELIST', 'DOMNodeList');
-define('DOMNODE', 'DOMNode');
-
-/**
- * DOMEvent class.
- *
- * Based on
- * @link http://developer.mozilla.org/En/DOM:event
- * @author Tobiasz Cudnik
- * @package phpQuery
- * @todo implement ArrayAccess ?
- */
-class DOMEvent
-{
- /**
- * Returns a boolean indicating whether the event bubbles up through the DOM or not.
- *
- * @var unknown_type
- */
- public $bubbles = true;
- /**
- * Returns a boolean indicating whether the event is cancelable.
- *
- * @var unknown_type
- */
- public $cancelable = true;
- /**
- * Returns a reference to the currently registered target for the event.
- *
- * @var unknown_type
- */
- public $currentTarget;
- /**
- * Returns detail about the event, depending on the type of event.
- *
- * @var unknown_type
- * @link http://developer.mozilla.org/en/DOM/event.detail
- */
- public $detail; // ???
- /**
- * Used to indicate which phase of the event flow is currently being evaluated.
- *
- * NOT IMPLEMENTED
- *
- * @var unknown_type
- * @link http://developer.mozilla.org/en/DOM/event.eventPhase
- */
- public $eventPhase; // ???
- /**
- * The explicit original target of the event (Mozilla-specific).
- *
- * NOT IMPLEMENTED
- *
- * @var unknown_type
- */
- public $explicitOriginalTarget; // moz only
- /**
- * The original target of the event, before any retargetings (Mozilla-specific).
- *
- * NOT IMPLEMENTED
- *
- * @var unknown_type
- */
- public $originalTarget; // moz only
- /**
- * Identifies a secondary target for the event.
- *
- * @var unknown_type
- */
- public $relatedTarget;
- /**
- * Returns a reference to the target to which the event was originally dispatched.
- *
- * @var unknown_type
- */
- public $target;
- /**
- * Returns the time that the event was created.
- *
- * @var unknown_type
- */
- public $timeStamp;
- /**
- * Returns the name of the event (case-insensitive).
- */
- public $type;
- public $runDefault = true;
- public $data = null;
- public function __construct($data)
- {
- foreach ($data as $k => $v) {
- $this->$k = $v;
- }
- if (!$this->timeStamp)
- $this->timeStamp = time();
- }
- /**
- * Cancels the event (if it is cancelable).
- *
- */
- public function preventDefault()
- {
- $this->runDefault = false;
- }
- /**
- * Stops the propagation of events further along in the DOM.
- *
- */
- public function stopPropagation()
- {
- $this->bubbles = false;
- }
-}
-
-
-/**
- * DOMDocumentWrapper class simplifies work with DOMDocument.
- *
- * Know bug:
- * - in XHTML fragments, changes to
- *
- * @todo check XML catalogs compatibility
- * @author Tobiasz Cudnik
- * @package phpQuery
- */
-class DOMDocumentWrapper
-{
- /**
- * @var DOMDocument
- */
- public $document;
- public $id;
- /**
- * @todo Rewrite as method and quess if null.
- * @var unknown_type
- */
- public $contentType = '';
- public $xpath;
- public $uuid = 0;
- public $data = array();
- public $dataNodes = array();
- public $events = array();
- public $eventsNodes = array();
- public $eventsGlobal = array();
- /**
- * @TODO iframes support http://code.google.com/p/phpquery/issues/detail?id=28
- * @var unknown_type
- */
- public $frames = array();
- /**
- * Document root, by default equals to document itself.
- * Used by documentFragments.
- *
- * @var DOMNode
- */
- public $root;
- public $isDocumentFragment;
- public $isXML = false;
- public $isXHTML = false;
- public $isHTML = false;
- public $charset;
- public function __construct($markup = null, $contentType = null, $newDocumentID = null)
- {
- if (isset($markup))
- $this->load($markup, $contentType, $newDocumentID);
- $this->id = $newDocumentID
- ? $newDocumentID
- : md5(microtime());
- }
- public function load($markup, $contentType = null, $newDocumentID = null)
- {
- // phpQuery::$documents[$id] = $this;
- $this->contentType = strtolower($contentType);
- if ($markup instanceof DOMDOCUMENT) {
- $this->document = $markup;
- $this->root = $this->document;
- $this->charset = $this->document->encoding;
- // TODO isDocumentFragment
- $loaded = true;
- } else {
- $loaded = $this->loadMarkup($markup);
- }
- if ($loaded) {
- // $this->document->formatOutput = true;
- $this->document->preserveWhiteSpace = true;
- $this->xpath = new DOMXPath($this->document);
- $this->afterMarkupLoad();
- return true;
- // remember last loaded document
- // return phpQuery::selectDocument($id);
- }
- return false;
- }
- protected function afterMarkupLoad()
- {
- if ($this->isXHTML) {
- $this->xpath->registerNamespace("html", "http://www.w3.org/1999/xhtml");
- }
- }
- protected function loadMarkup($markup)
- {
- $loaded = false;
- if ($this->contentType) {
- self::debug("Load markup for content type {$this->contentType}");
- // content determined by contentType
- list($contentType, $charset) = $this->contentTypeToArray($this->contentType);
- switch ($contentType) {
- case 'text/html':
- phpQuery::debug("Loading HTML, content type '{$this->contentType}'");
- $loaded = $this->loadMarkupHTML($markup, $charset);
- break;
- case 'text/xml':
- case 'application/xhtml+xml':
- phpQuery::debug("Loading XML, content type '{$this->contentType}'");
- $loaded = $this->loadMarkupXML($markup, $charset);
- break;
- default:
- // for feeds or anything that sometimes doesn't use text/xml
- if (strpos('xml', $this->contentType) !== false) {
- phpQuery::debug("Loading XML, content type '{$this->contentType}'");
- $loaded = $this->loadMarkupXML($markup, $charset);
- } else
- phpQuery::debug("Could not determine document type from content type '{$this->contentType}'");
- }
- } else {
- // content type autodetection
- if ($this->isXML($markup)) {
- phpQuery::debug("Loading XML, isXML() == true");
- $loaded = $this->loadMarkupXML($markup);
- if (!$loaded && $this->isXHTML) {
- phpQuery::debug('Loading as XML failed, trying to load as HTML, isXHTML == true');
- $loaded = $this->loadMarkupHTML($markup);
- }
- } else {
- phpQuery::debug("Loading HTML, isXML() == false");
- $loaded = $this->loadMarkupHTML($markup);
- }
- }
- return $loaded;
- }
- protected function loadMarkupReset()
- {
- $this->isXML = $this->isXHTML = $this->isHTML = false;
- }
- protected function documentCreate($charset, $version = '1.0')
- {
- if (!$version)
- $version = '1.0';
- $this->document = new DOMDocument($version, $charset);
- $this->charset = $this->document->encoding;
- // $this->document->encoding = $charset;
- $this->document->formatOutput = true;
- $this->document->preserveWhiteSpace = true;
- }
- protected function loadMarkupHTML($markup, $requestedCharset = null)
- {
- if (phpQuery::$debug)
- phpQuery::debug('Full markup load (HTML): ' . substr($markup, 0, 250));
- $this->loadMarkupReset();
- $this->isHTML = true;
- if (!isset($this->isDocumentFragment))
- $this->isDocumentFragment = self::isDocumentFragmentHTML($markup);
- $charset = null;
- $documentCharset = $this->charsetFromHTML($markup);
- $addDocumentCharset = false;
- if ($documentCharset) {
- $charset = $documentCharset;
- $markup = $this->charsetFixHTML($markup);
- } else if ($requestedCharset) {
- $charset = $requestedCharset;
- }
- if (!$charset)
- $charset = phpQuery::$defaultCharset;
- // HTTP 1.1 says that the default charset is ISO-8859-1
- // @see http://www.w3.org/International/O-HTTP-charset
- if (!$documentCharset) {
- $documentCharset = 'ISO-8859-1';
- $addDocumentCharset = true;
- }
- // Should be careful here, still need 'magic encoding detection' since lots of pages have other 'default encoding'
- // Worse, some pages can have mixed encodings... we'll try not to worry about that
- $requestedCharset = $requestedCharset ? strtoupper($requestedCharset) : "";
- $documentCharset = strtoupper($documentCharset);
- phpQuery::debug("DOC: $documentCharset REQ: $requestedCharset");
- if ($requestedCharset && $documentCharset && $requestedCharset !== $documentCharset) {
- phpQuery::debug("CHARSET CONVERT");
- // Document Encoding Conversion
- // http://code.google.com/p/phpquery/issues/detail?id=86
- if (function_exists('mb_detect_encoding')) {
- $possibleCharsets = array($documentCharset, $requestedCharset, 'AUTO');
- $docEncoding = mb_detect_encoding($markup, implode(', ', $possibleCharsets));
- if (!$docEncoding)
- $docEncoding = $documentCharset; // ok trust the document
- phpQuery::debug("DETECTED '$docEncoding'");
- // Detected does not match what document says...
- if ($docEncoding !== $documentCharset) {
- // Tricky..
- }
- if ($docEncoding !== $requestedCharset) {
- phpQuery::debug("CONVERT $docEncoding => $requestedCharset");
- $markup = mb_convert_encoding($markup, $requestedCharset, $docEncoding);
- $markup = $this->charsetAppendToHTML($markup, $requestedCharset);
- $charset = $requestedCharset;
- }
- } else {
- phpQuery::debug("TODO: charset conversion without mbstring...");
- }
- }
- $return = false;
- if ($this->isDocumentFragment) {
- phpQuery::debug("Full markup load (HTML), DocumentFragment detected, using charset '$charset'");
- $return = $this->documentFragmentLoadMarkup($this, $charset, $markup);
- } else {
- if ($addDocumentCharset) {
- phpQuery::debug("Full markup load (HTML), appending charset: '$charset'");
- $markup = $this->charsetAppendToHTML($markup, $charset);
- }
- phpQuery::debug("Full markup load (HTML), documentCreate('$charset')");
- $this->documentCreate($charset);
- $return = phpQuery::$debug === 2
- ? $this->document->loadHTML($markup)
- : @$this->document->loadHTML($markup);
- if ($return)
- $this->root = $this->document;
- }
- if ($return && !$this->contentType)
- $this->contentType = 'text/html';
- return $return;
- }
- protected function loadMarkupXML($markup, $requestedCharset = null)
- {
- if (phpQuery::$debug)
- phpQuery::debug('Full markup load (XML): ' . substr($markup, 0, 250));
- $this->loadMarkupReset();
- $this->isXML = true;
- // check agains XHTML in contentType or markup
- $isContentTypeXHTML = $this->isXHTML();
- $isMarkupXHTML = $this->isXHTML($markup);
- if ($isContentTypeXHTML || $isMarkupXHTML) {
- self::debug('Full markup load (XML), XHTML detected');
- $this->isXHTML = true;
- }
- // determine document fragment
- if (!isset($this->isDocumentFragment))
- $this->isDocumentFragment = $this->isXHTML
- ? self::isDocumentFragmentXHTML($markup)
- : self::isDocumentFragmentXML($markup);
- // this charset will be used
- $charset = null;
- // charset from XML declaration @var string
- $documentCharset = $this->charsetFromXML($markup);
- if (!$documentCharset) {
- if ($this->isXHTML) {
- // this is XHTML, try to get charset from content-type meta header
- $documentCharset = $this->charsetFromHTML($markup);
- if ($documentCharset) {
- phpQuery::debug("Full markup load (XML), appending XHTML charset '$documentCharset'");
- $this->charsetAppendToXML($markup, $documentCharset);
- $charset = $documentCharset;
- }
- }
- if (!$documentCharset) {
- // if still no document charset...
- $charset = $requestedCharset;
- }
- } else if ($requestedCharset) {
- $charset = $requestedCharset;
- }
- if (!$charset) {
- $charset = phpQuery::$defaultCharset;
- }
- if ($requestedCharset && $documentCharset && $requestedCharset != $documentCharset) {
- // TODO place for charset conversion
- // $charset = $requestedCharset;
- }
- $return = false;
- if ($this->isDocumentFragment) {
- phpQuery::debug("Full markup load (XML), DocumentFragment detected, using charset '$charset'");
- $return = $this->documentFragmentLoadMarkup($this, $charset, $markup);
- } else {
- // FIXME ???
- if ($isContentTypeXHTML && !$isMarkupXHTML)
- if (!$documentCharset) {
- phpQuery::debug("Full markup load (XML), appending charset '$charset'");
- $markup = $this->charsetAppendToXML($markup, $charset);
- }
- // see http://pl2.php.net/manual/en/book.dom.php#78929
- // LIBXML_DTDLOAD (>= PHP 5.1)
- // does XML ctalogues works with LIBXML_NONET
- // $this->document->resolveExternals = true;
- // TODO test LIBXML_COMPACT for performance improvement
- // create document
- $this->documentCreate($charset);
- if (phpversion() < 5.1) {
- $this->document->resolveExternals = true;
- $return = phpQuery::$debug === 2
- ? $this->document->loadXML($markup)
- : @$this->document->loadXML($markup);
- } else {
- /** @link http://pl2.php.net/manual/en/libxml.constants.php */
- $libxmlStatic = phpQuery::$debug === 2
- ? LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_NONET
- : LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_NOERROR;
- $return = $this->document->loadXML($markup, $libxmlStatic);
- // if (! $return)
- // $return = $this->document->loadHTML($markup);
- }
- if ($return)
- $this->root = $this->document;
- }
- if ($return) {
- if (!$this->contentType) {
- if ($this->isXHTML)
- $this->contentType = 'application/xhtml+xml';
- else
- $this->contentType = 'text/xml';
- }
- return $return;
- } else {
- throw new Exception("Error loading XML markup");
- }
- }
- protected function isXHTML($markup = null)
- {
- if (!isset($markup)) {
- return strpos($this->contentType, 'xhtml') !== false;
- }
- // XXX ok ?
- return strpos($markup, "doctype) && is_object($dom->doctype)
- // ? $dom->doctype->publicId
- // : self::$defaultDoctype;
- }
- protected function isXML($markup)
- {
- // return strpos($markup, ']+http-equiv\\s*=\\s*(["|\'])Content-Type\\1([^>]+?)>@i',
- $markup,
- $matches
- );
- if (!isset($matches[0]))
- return array(null, null);
- // get attr 'content'
- preg_match('@content\\s*=\\s*(["|\'])(.+?)\\1@', $matches[0], $matches);
- if (!isset($matches[0]))
- return array(null, null);
- return $this->contentTypeToArray($matches[2]);
- }
- protected function charsetFromHTML($markup)
- {
- $contentType = $this->contentTypeFromHTML($markup);
- return $contentType[1];
- }
- protected function charsetFromXML($markup)
- {
- $matches;
- // find declaration
- preg_match(
- '@<' . '?xml[^>]+encoding\\s*=\\s*(["|\'])(.*?)\\1@i',
- $markup,
- $matches
- );
- return isset($matches[2])
- ? strtolower($matches[2])
- : null;
- }
- /**
- * Repositions meta[type=charset] at the start of head. Bypasses DOMDocument bug.
- *
- * @link http://code.google.com/p/phpquery/issues/detail?id=80
- * @param $html
- */
- protected function charsetFixHTML($markup)
- {
- $matches = array();
- // find meta tag
- preg_match(
- '@\s* ]+http-equiv\\s*=\\s*(["|\'])Content-Type\\1([^>]+?)>@i',
- $markup,
- $matches,
- PREG_OFFSET_CAPTURE
- );
- if (!isset($matches[0]))
- return;
- $metaContentType = $matches[0][0];
- $markup = substr($markup, 0, $matches[0][1])
- . substr($markup, $matches[0][1] + strlen($metaContentType));
- $headStart = stripos($markup, '');
- $markup = substr($markup, 0, $headStart + 6) . $metaContentType
- . substr($markup, $headStart + 6);
- return $markup;
- }
- protected function charsetAppendToHTML($html, $charset, $xhtml = false)
- {
- // remove existing meta[type=content-type]
- $html = preg_replace('@\s* ]+http-equiv\\s*=\\s*(["|\'])Content-Type\\1([^>]+?)>@i', '', $html);
- $meta = ' ';
- if (strpos($html, ')@s',
- "{$meta}",
- $html
- );
- }
- } else {
- return preg_replace(
- '@)@s',
- '' . $meta,
- $html
- );
- }
- }
- protected function charsetAppendToXML($markup, $charset)
- {
- $declaration = '<' . '?xml version="1.0" encoding="' . $charset . '"?' . '>';
- return $declaration . $markup;
- }
- public static function isDocumentFragmentHTML($markup)
- {
- return stripos($markup, 'documentFragmentCreate($node, $sourceCharset);
- // if ($fake === false)
- // throw new Exception("Error loading documentFragment markup");
- // else
- // $return = array_merge($return,
- // $this->import($fake->root->childNodes)
- // );
- // } else {
- // $return[] = $this->document->importNode($node, true);
- // }
- // }
- // return $return;
- // } else {
- // // string markup
- // $fake = $this->documentFragmentCreate($source, $sourceCharset);
- // if ($fake === false)
- // throw new Exception("Error loading documentFragment markup");
- // else
- // return $this->import($fake->root->childNodes);
- // }
- if (is_array($source) || $source instanceof DOMNODELIST) {
- // dom nodes
- self::debug('Importing nodes to document');
- foreach ($source as $node)
- $return[] = $this->document->importNode($node, true);
- } else {
- // string markup
- $fake = $this->documentFragmentCreate($source, $sourceCharset);
- if ($fake === false)
- throw new Exception("Error loading documentFragment markup");
- else
- return $this->import($fake->root->childNodes);
- }
- return $return;
- }
- /**
- * Creates new document fragment.
- *
- * @param $source
- * @return DOMDocumentWrapper
- */
- protected function documentFragmentCreate($source, $charset = null)
- {
- $fake = new DOMDocumentWrapper();
- $fake->contentType = $this->contentType;
- $fake->isXML = $this->isXML;
- $fake->isHTML = $this->isHTML;
- $fake->isXHTML = $this->isXHTML;
- $fake->root = $fake->document;
- if (!$charset)
- $charset = $this->charset;
- // $fake->documentCreate($this->charset);
- if ($source instanceof DOMNODE && !($source instanceof DOMNODELIST))
- $source = array($source);
- if (is_array($source) || $source instanceof DOMNODELIST) {
- // dom nodes
- // load fake document
- if (!$this->documentFragmentLoadMarkup($fake, $charset))
- return false;
- $nodes = $fake->import($source);
- foreach ($nodes as $node)
- $fake->root->appendChild($node);
- } else {
- // string markup
- $this->documentFragmentLoadMarkup($fake, $charset, $source);
- }
- return $fake;
- }
- /**
- *
- * @param $document DOMDocumentWrapper
- * @param $markup
- * @return $document
- */
- private function documentFragmentLoadMarkup($fragment, $charset, $markup = null)
- {
- // TODO error handling
- // TODO copy doctype
- // tempolary turn off
- $fragment->isDocumentFragment = false;
- if ($fragment->isXML) {
- if ($fragment->isXHTML) {
- // add FAKE element to set default namespace
- $fragment->loadMarkupXML(''
- . ''
- . '' . $markup . ' ');
- $fragment->root = $fragment->document->firstChild->nextSibling;
- } else {
- $fragment->loadMarkupXML('' . $markup . ' ');
- $fragment->root = $fragment->document->firstChild;
- }
- } else {
- $markup2 = phpQuery::$defaultDoctype . ' ';
- if ($markup == null) {
- $markup = "";
- }
- $noBody = strpos($markup, 'loadMarkupHTML($markup2);
- // TODO resolv body tag merging issue
- $fragment->root = $noBody
- ? $fragment->document->firstChild->nextSibling->firstChild->nextSibling
- : $fragment->document->firstChild->nextSibling->firstChild->nextSibling;
- }
- if (!$fragment->root)
- return false;
- $fragment->isDocumentFragment = true;
- return true;
- }
- protected function documentFragmentToMarkup($fragment)
- {
- phpQuery::debug('documentFragmentToMarkup');
- $tmp = $fragment->isDocumentFragment;
- $fragment->isDocumentFragment = false;
- $markup = $fragment->markup();
- if ($fragment->isXML) {
- $markup = substr($markup, 0, strrpos($markup, ''));
- if ($fragment->isXHTML) {
- $markup = substr($markup, strpos($markup, '') + 6);
- }
- } else {
- $markup = substr($markup, strpos($markup, '') + 6);
- $markup = substr($markup, 0, strrpos($markup, ''));
- }
- $fragment->isDocumentFragment = $tmp;
- if (phpQuery::$debug)
- phpQuery::debug('documentFragmentToMarkup: ' . substr($markup, 0, 150));
- return $markup;
- }
- /**
- * Return document markup, starting with optional $nodes as root.
- *
- * @param $nodes DOMNode|DOMNodeList
- * @return string
- */
- public function markup($nodes = null, $innerMarkup = false)
- {
- if (isset($nodes) && count($nodes) == 1 && $nodes[0] instanceof DOMDOCUMENT)
- $nodes = null;
- if (isset($nodes)) {
- $markup = '';
- if (!is_array($nodes) && !($nodes instanceof DOMNODELIST))
- $nodes = array($nodes);
- if ($this->isDocumentFragment && !$innerMarkup)
- foreach ($nodes as $i => $node)
- if ($node->isSameNode($this->root)) {
- // var_dump($node);
- $nodes = array_slice($nodes, 0, $i)
- + phpQuery::DOMNodeListToArray($node->childNodes)
- + array_slice($nodes, $i + 1);
- }
- if ($this->isXML && !$innerMarkup) {
- self::debug("Getting outerXML with charset '{$this->charset}'");
- // we need outerXML, so we can benefit from
- // $node param support in saveXML()
- foreach ($nodes as $node)
- $markup .= $this->document->saveXML($node);
- } else {
- $loop = array();
- if ($innerMarkup)
- foreach ($nodes as $node) {
- if ($node->childNodes)
- foreach ($node->childNodes as $child)
- $loop[] = $child;
- else
- $loop[] = $node;
- }
- else
- $loop = $nodes;
- self::debug("Getting markup, moving selected nodes (" . count($loop) . ") to new DocumentFragment");
- $fake = $this->documentFragmentCreate($loop);
- $markup = $this->documentFragmentToMarkup($fake);
- }
- if ($this->isXHTML) {
- self::debug("Fixing XHTML");
- $markup = self::markupFixXHTML($markup);
- }
- self::debug("Markup: " . substr($markup, 0, 250));
- return $markup;
- } else {
- if ($this->isDocumentFragment) {
- // documentFragment, html only...
- self::debug("Getting markup, DocumentFragment detected");
- // return $this->markup(
- //// $this->document->getElementsByTagName('body')->item(0)
- // $this->document->root, true
- // );
- $markup = $this->documentFragmentToMarkup($this);
- // no need for markupFixXHTML, as it's done thought markup($nodes) method
- return $markup;
- } else {
- self::debug("Getting markup (" . ($this->isXML ? 'XML' : 'HTML') . "), final with charset '{$this->charset}'");
- $markup = $this->isXML
- ? $this->document->saveXML()
- : $this->document->saveHTML();
- if ($this->isXHTML) {
- self::debug("Fixing XHTML");
- $markup = self::markupFixXHTML($markup);
- }
- self::debug("Markup: " . substr($markup, 0, 250));
- return $markup;
- }
- }
- }
- protected static function markupFixXHTML($markup)
- {
- $markup = self::expandEmptyTag('script', $markup);
- $markup = self::expandEmptyTag('select', $markup);
- $markup = self::expandEmptyTag('textarea', $markup);
- return $markup;
- }
- public static function debug($text)
- {
- phpQuery::debug($text);
- }
- /**
- * expandEmptyTag
- *
- * @param $tag
- * @param $xml
- * @return unknown_type
- * @author mjaque at ilkebenson dot com
- * @link http://php.net/manual/en/domdocument.savehtml.php#81256
- */
- public static function expandEmptyTag($tag, $xml)
- {
- $indice = 0;
- while ($indice < strlen($xml)) {
- $pos = strpos($xml, "<$tag ", $indice);
- if ($pos) {
- $posCierre = strpos($xml, ">", $pos);
- if ($xml[$posCierre - 1] == "/") {
- $xml = substr_replace($xml, ">$tag>", $posCierre - 1, 2);
- }
- $indice = $posCierre;
- } else break;
- }
- return $xml;
- }
-}
-
-/**
- * Event handling class.
- *
- * @author Tobiasz Cudnik
- * @package phpQuery
- * @static
- */
-abstract class phpQueryEvents
-{
- /**
- * Trigger a type of event on every matched element.
- *
- * @param DOMNode|phpQueryObject|string $document
- * @param unknown_type $type
- * @param unknown_type $data
- *
- * @TODO exclusive events (with !)
- * @TODO global events (test)
- * @TODO support more than event in $type (space-separated)
- */
- public static function trigger($document, $type, $data = array(), $node = null)
- {
- // trigger: function(type, data, elem, donative, extra) {
- $documentID = phpQuery::getDocumentID($document);
- $namespace = null;
- if (strpos($type, '.') !== false)
- list($name, $namespace) = explode('.', $type);
- else
- $name = $type;
- if (!$node) {
- if (self::issetGlobal($documentID, $type)) {
- $pq = phpQuery::getDocument($documentID);
- // TODO check add($pq->document)
- $pq->find('*')->add($pq->document)
- ->trigger($type, $data);
- }
- } else {
- if (isset($data[0]) && $data[0] instanceof DOMEvent) {
- $event = $data[0];
- $event->relatedTarget = $event->target;
- $event->target = $node;
- $data = array_slice($data, 1);
- } else {
- $event = new DOMEvent(array(
- 'type' => $type,
- 'target' => $node,
- 'timeStamp' => time(),
- ));
- }
- $i = 0;
- while ($node) {
- // TODO whois
- phpQuery::debug("Triggering " . ($i ? "bubbled " : '') . "event '{$type}' on "
- . "node \n"); //.phpQueryObject::whois($node)."\n");
- $event->currentTarget = $node;
- $eventNode = self::getNode($documentID, $node);
- if (isset($eventNode->eventHandlers)) {
- foreach ($eventNode->eventHandlers as $eventType => $handlers) {
- $eventNamespace = null;
- if (strpos($type, '.') !== false)
- list($eventName, $eventNamespace) = explode('.', $eventType);
- else
- $eventName = $eventType;
- if ($name != $eventName)
- continue;
- if ($namespace && $eventNamespace && $namespace != $eventNamespace)
- continue;
- foreach ($handlers as $handler) {
- phpQuery::debug("Calling event handler\n");
- $event->data = $handler['data']
- ? $handler['data']
- : null;
- $params = array_merge(array($event), $data);
- $return = phpQuery::callbackRun($handler['callback'], $params);
- if ($return === false) {
- $event->bubbles = false;
- }
- }
- }
- }
- // to bubble or not to bubble...
- if (!$event->bubbles)
- break;
- $node = $node->parentNode;
- $i++;
- }
- }
- }
- /**
- * Binds a handler to one or more events (like click) for each matched element.
- * Can also bind custom events.
- *
- * @param DOMNode|phpQueryObject|string $document
- * @param unknown_type $type
- * @param unknown_type $data Optional
- * @param unknown_type $callback
- *
- * @TODO support '!' (exclusive) events
- * @TODO support more than event in $type (space-separated)
- * @TODO support binding to global events
- */
- public static function add($document, $node, $type, $data, $callback = null)
- {
- phpQuery::debug("Binding '$type' event");
- $documentID = phpQuery::getDocumentID($document);
- // if (is_null($callback) && is_callable($data)) {
- // $callback = $data;
- // $data = null;
- // }
- $eventNode = self::getNode($documentID, $node);
- if (!$eventNode)
- $eventNode = self::setNode($documentID, $node);
- if (!isset($eventNode->eventHandlers[$type]))
- $eventNode->eventHandlers[$type] = array();
- $eventNode->eventHandlers[$type][] = array(
- 'callback' => $callback,
- 'data' => $data,
- );
- }
- /**
- * Enter description here...
- *
- * @param DOMNode|phpQueryObject|string $document
- * @param unknown_type $type
- * @param unknown_type $callback
- *
- * @TODO namespace events
- * @TODO support more than event in $type (space-separated)
- */
- public static function remove($document, $node, $type = null, $callback = null)
- {
- $documentID = phpQuery::getDocumentID($document);
- $eventNode = self::getNode($documentID, $node);
- if (is_object($eventNode) && isset($eventNode->eventHandlers[$type])) {
- if ($callback) {
- foreach ($eventNode->eventHandlers[$type] as $k => $handler)
- if ($handler['callback'] == $callback)
- unset($eventNode->eventHandlers[$type][$k]);
- } else {
- unset($eventNode->eventHandlers[$type]);
- }
- }
- }
- protected static function getNode($documentID, $node)
- {
- foreach (phpQuery::$documents[$documentID]->eventsNodes as $eventNode) {
- if ($node->isSameNode($eventNode))
- return $eventNode;
- }
- }
- protected static function setNode($documentID, $node)
- {
- phpQuery::$documents[$documentID]->eventsNodes[] = $node;
- return phpQuery::$documents[$documentID]->eventsNodes[count(phpQuery::$documents[$documentID]->eventsNodes) - 1];
- }
- protected static function issetGlobal($documentID, $type)
- {
- return isset(phpQuery::$documents[$documentID])
- ? in_array($type, phpQuery::$documents[$documentID]->eventsGlobal)
- : false;
- }
-}
-
-
-interface ICallbackNamed
-{
- function hasName();
- function getName();
-}
-/**
- * Callback class introduces currying-like pattern.
- *
- * Example:
- * function foo($param1, $param2, $param3) {
- * var_dump($param1, $param2, $param3);
- * }
- * $fooCurried = new Callback('foo',
- * 'param1 is now statically set',
- * new CallbackParam, new CallbackParam
- * );
- * phpQuery::callbackRun($fooCurried,
- * array('param2 value', 'param3 value'
- * );
- *
- * Callback class is supported in all phpQuery methods which accepts callbacks.
- *
- * @link http://code.google.com/p/phpquery/wiki/Callbacks#Param_Structures
- * @author Tobiasz Cudnik
- *
- * @TODO??? return fake forwarding function created via create_function
- * @TODO honor paramStructure
- */
-class Callback
-implements ICallbackNamed
-{
- public $callback = null;
- public $params = null;
- protected $name;
- public function __construct(
- $callback,
- $param1 = null,
- $param2 = null,
- $param3 = null
- ) {
- $params = func_get_args();
- $params = array_slice($params, 1);
- if ($callback instanceof Callback) {
- // TODO implement recurention
- } else {
- $this->callback = $callback;
- $this->params = $params;
- }
- }
- public function getName()
- {
- return 'Callback: ' . $this->name;
- }
- public function hasName()
- {
- return isset($this->name) && $this->name;
- }
- public function setName($name)
- {
- $this->name = $name;
- return $this;
- }
- // TODO test me
- // public function addParams() {
- // $params = func_get_args();
- // return new Callback($this->callback, $this->params+$params);
- // }
-}
-/**
- * Shorthand for new Callback(create_function(...), ...);
- *
- * @author Tobiasz Cudnik
- */
-class CallbackBody extends Callback
-{
- public function __construct(
- $paramList,
- $code,
- $param1 = null,
- $param2 = null,
- $param3 = null
- ) {
- $params = func_get_args();
- $params = array_slice($params, 2);
- $this->callback = create_function($paramList, $code);
- $this->params = $params;
- }
-}
-/**
- * Callback type which on execution returns reference passed during creation.
- *
- * @author Tobiasz Cudnik
- */
-class CallbackReturnReference extends Callback
-implements ICallbackNamed
-{
- protected $reference;
- public function __construct(&$reference, $name = null)
- {
- $this->reference = &$reference;
- $this->callback = array($this, 'callback');
- }
- public function callback()
- {
- return $this->reference;
- }
- public function getName()
- {
- return 'Callback: ' . $this->name;
- }
- public function hasName()
- {
- return isset($this->name) && $this->name;
- }
-}
-/**
- * Callback type which on execution returns value passed during creation.
- *
- * @author Tobiasz Cudnik
- */
-class CallbackReturnValue extends Callback
-implements ICallbackNamed
-{
- protected $value;
- protected $name;
- public function __construct($value, $name = null)
- {
- $this->value = &$value;
- $this->name = $name;
- $this->callback = array($this, 'callback');
- }
- public function callback()
- {
- return $this->value;
- }
- public function __toString()
- {
- return $this->getName();
- }
- public function getName()
- {
- return 'Callback: ' . $this->name;
- }
- public function hasName()
- {
- return isset($this->name) && $this->name;
- }
-}
-/**
- * CallbackParameterToReference can be used when we don't really want a callback,
- * only parameter passed to it. CallbackParameterToReference takes first
- * parameter's value and passes it to reference.
- *
- * @author Tobiasz Cudnik
- */
-class CallbackParameterToReference extends Callback
-{
- /**
- * @param $reference
- * @TODO implement $paramIndex;
- * param index choose which callback param will be passed to reference
- */
- public function __construct(&$reference)
- {
- $this->callback = &$reference;
- }
-}
-//class CallbackReference extends Callback {
-// /**
-// *
-// * @param $reference
-// * @param $paramIndex
-// * @todo implement $paramIndex; param index choose which callback param will be passed to reference
-// */
-// public function __construct(&$reference, $name = null){
-// $this->callback =& $reference;
-// }
-//}
-class CallbackParam
-{
-}
-
-/**
- * Class representing phpQuery objects.
- *
- * @author Tobiasz Cudnik
- * @package phpQuery
- * @method phpQueryObject clone() clone()
- * @method phpQueryObject empty() empty()
- * @method phpQueryObject next() next($selector = null)
- * @method phpQueryObject prev() prev($selector = null)
- * @property Int $length
- */
-class phpQueryObject
-implements Iterator, Countable, ArrayAccess
-{
- public $documentID = null;
- /**
- * DOMDocument class.
- *
- * @var DOMDocument
- */
- public $document = null;
- public $charset = null;
- /**
- *
- * @var DOMDocumentWrapper
- */
- public $documentWrapper = null;
- /**
- * XPath interface.
- *
- * @var DOMXPath
- */
- public $xpath = null;
- /**
- * Stack of selected elements.
- * @TODO refactor to ->nodes
- * @var array
- */
- public $elements = array();
- /**
- * @access private
- */
- protected $elementsBackup = array();
- /**
- * @access private
- */
- protected $previous = null;
- /**
- * @access private
- * @TODO deprecate
- */
- protected $root = array();
- /**
- * Indicated if doument is just a fragment (no tag).
- *
- * Every document is realy a full document, so even documentFragments can
- * be queried against , but getDocument(id)->htmlOuter() will return
- * only contents of .
- *
- * @var bool
- */
- public $documentFragment = true;
- /**
- * Iterator interface helper
- * @access private
- */
- protected $elementsInterator = array();
- /**
- * Iterator interface helper
- * @access private
- */
- protected $valid = false;
- /**
- * Iterator interface helper
- * @access private
- */
- protected $current = null;
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function __construct($documentID)
- {
- // if ($documentID instanceof self)
- // var_dump($documentID->getDocumentID());
- $id = $documentID instanceof self
- ? $documentID->getDocumentID()
- : $documentID;
- // var_dump($id);
- if (!isset(phpQuery::$documents[$id])) {
- // var_dump(phpQuery::$documents);
- throw new Exception("Document with ID '{$id}' isn't loaded. Use phpQuery::newDocument(\$html) or phpQuery::newDocumentFile(\$file) first.");
- }
- $this->documentID = $id;
- $this->documentWrapper = &phpQuery::$documents[$id];
- $this->document = &$this->documentWrapper->document;
- $this->xpath = &$this->documentWrapper->xpath;
- $this->charset = &$this->documentWrapper->charset;
- $this->documentFragment = &$this->documentWrapper->isDocumentFragment;
- // TODO check $this->DOM->documentElement;
- // $this->root = $this->document->documentElement;
- $this->root = &$this->documentWrapper->root;
- // $this->toRoot();
- $this->elements = array($this->root);
- }
- /**
- *
- * @access private
- * @param $attr
- * @return unknown_type
- */
- public function __get($attr)
- {
- switch ($attr) {
- // FIXME doesnt work at all ?
- case 'length':
- return $this->size();
- break;
- default:
- return $this->$attr;
- }
- }
- /**
- * Saves actual object to $var by reference.
- * Useful when need to break chain.
- * @param phpQueryObject $var
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function toReference(&$var)
- {
- return $var = $this;
- }
- public function documentFragment($state = null)
- {
- if ($state) {
- phpQuery::$documents[$this->getDocumentID()]['documentFragment'] = $state;
- return $this;
- }
- return $this->documentFragment;
- }
- /**
- * @access private
- * @TODO documentWrapper
- */
- protected function isRoot($node)
- {
- // return $node instanceof DOMDOCUMENT || $node->tagName == 'html';
- return $node instanceof DOMDOCUMENT
- || ($node instanceof DOMELEMENT && $node->tagName == 'html')
- || $this->root->isSameNode($node);
- }
- /**
- * @access private
- */
- protected function stackIsRoot()
- {
- return $this->size() == 1 && $this->isRoot($this->elements[0]);
- }
- /**
- * Enter description here...
- * NON JQUERY METHOD
- *
- * Watch out, it doesn't creates new instance, can be reverted with end().
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function toRoot()
- {
- $this->elements = array($this->root);
- return $this;
- // return $this->newInstance(array($this->root));
- }
- /**
- * Saves object's DocumentID to $var by reference.
- *
- * $myDocumentId;
- * phpQuery::newDocument('
')
- * ->getDocumentIDRef($myDocumentId)
- * ->find('div')->...
- *
- *
- * @param unknown_type $domId
- * @see phpQuery::newDocument
- * @see phpQuery::newDocumentFile
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function getDocumentIDRef(&$documentID)
- {
- $documentID = $this->getDocumentID();
- return $this;
- }
- /**
- * Returns object with stack set to document root.
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function getDocument()
- {
- return phpQuery::getDocument($this->getDocumentID());
- }
- /**
- *
- * @return DOMDocument
- */
- public function getDOMDocument()
- {
- return $this->document;
- }
- /**
- * Get object's Document ID.
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function getDocumentID()
- {
- return $this->documentID;
- }
- /**
- * Unloads whole document from memory.
- * CAUTION! None further operations will be possible on this document.
- * All objects refering to it will be useless.
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function unloadDocument()
- {
- phpQuery::unloadDocuments($this->getDocumentID());
- }
- public function isHTML()
- {
- return $this->documentWrapper->isHTML;
- }
- public function isXHTML()
- {
- return $this->documentWrapper->isXHTML;
- }
- public function isXML()
- {
- return $this->documentWrapper->isXML;
- }
- /**
- * Enter description here...
- *
- * @link http://docs.jquery.com/Ajax/serialize
- * @return string
- */
- public function serialize()
- {
- return phpQuery::param($this->serializeArray());
- }
- /**
- * Enter description here...
- *
- * @link http://docs.jquery.com/Ajax/serializeArray
- * @return array
- */
- public function serializeArray($submit = null)
- {
- $source = $this->filter('form, input, select, textarea')
- ->find('input, select, textarea')
- ->andSelf()
- ->not('form');
- $return = array();
- // $source->dumpDie();
- foreach ($source as $input) {
- $input = phpQuery::pq($input);
- if ($input->is('[disabled]'))
- continue;
- if (!$input->is('[name]'))
- continue;
- if ($input->is('[type=checkbox]') && !$input->is('[checked]'))
- continue;
- // jquery diff
- if ($submit && $input->is('[type=submit]')) {
- if ($submit instanceof DOMELEMENT && !$input->elements[0]->isSameNode($submit))
- continue;
- else if (is_string($submit) && $input->attr('name') != $submit)
- continue;
- }
- $return[] = array(
- 'name' => $input->attr('name'),
- 'value' => $input->val(),
- );
- }
- return $return;
- }
- /**
- * @access private
- */
- protected function debug($in)
- {
- if (!phpQuery::$debug)
- return;
- print('');
- print_r($in);
- // file debug
- // file_put_contents(dirname(__FILE__).'/phpQuery.log', print_r($in, true)."\n", FILE_APPEND);
- // quite handy debug trace
- // if ( is_array($in))
- // print_r(array_slice(debug_backtrace(), 3));
- print(" \n");
- }
- /**
- * @access private
- */
- protected function isRegexp($pattern)
- {
- return in_array(
- $pattern[mb_strlen($pattern) - 1],
- array('^', '*', '$')
- );
- }
- /**
- * Determines if $char is really a char.
- *
- * @param string $char
- * @return bool
- * @todo rewrite me to charcode range ! ;)
- * @access private
- */
- protected function isChar($char)
- {
- return extension_loaded('mbstring') && phpQuery::$mbstringSupport
- ? mb_eregi('\w', $char)
- : preg_match('@\w@', $char);
- }
- /**
- * @access private
- */
- protected function parseSelector($query)
- {
- // clean spaces
- // TODO include this inside parsing ?
- $query = trim(
- preg_replace(
- '@\s+@',
- ' ',
- preg_replace('@\s*(>|\\+|~)\s*@', '\\1', $query)
- )
- );
- $queries = array(array());
- if (!$query)
- return $queries;
- $return = &$queries[0];
- $specialChars = array('>', ' ');
- // $specialCharsMapping = array('/' => '>');
- $specialCharsMapping = array();
- $strlen = mb_strlen($query);
- $classChars = array('.', '-');
- $pseudoChars = array('-');
- $tagChars = array('*', '|', '-');
- // split multibyte string
- // http://code.google.com/p/phpquery/issues/detail?id=76
- $_query = array();
- for ($i = 0; $i < $strlen; $i++)
- $_query[] = mb_substr($query, $i, 1);
- $query = $_query;
- // it works, but i dont like it...
- $i = 0;
- while ($i < $strlen) {
- $c = $query[$i];
- $tmp = '';
- // TAG
- if ($this->isChar($c) || in_array($c, $tagChars)) {
- while (
- isset($query[$i])
- && ($this->isChar($query[$i]) || in_array($query[$i], $tagChars))
- ) {
- $tmp .= $query[$i];
- $i++;
- }
- $return[] = $tmp;
- // IDs
- } else if ($c == '#') {
- $i++;
- while (isset($query[$i]) && ($this->isChar($query[$i]) || $query[$i] == '-')) {
- $tmp .= $query[$i];
- $i++;
- }
- $return[] = '#' . $tmp;
- // SPECIAL CHARS
- } else if (in_array($c, $specialChars)) {
- $return[] = $c;
- $i++;
- // MAPPED SPECIAL MULTICHARS
- // } else if ( $c.$query[$i+1] == '//') {
- // $return[] = ' ';
- // $i = $i+2;
- // MAPPED SPECIAL CHARS
- } else if (isset($specialCharsMapping[$c])) {
- $return[] = $specialCharsMapping[$c];
- $i++;
- // COMMA
- } else if ($c == ',') {
- $queries[] = array();
- $return = &$queries[count($queries) - 1];
- $i++;
- while (isset($query[$i]) && $query[$i] == ' ')
- $i++;
- // CLASSES
- } else if ($c == '.') {
- while (isset($query[$i]) && ($this->isChar($query[$i]) || in_array($query[$i], $classChars))) {
- $tmp .= $query[$i];
- $i++;
- }
- $return[] = $tmp;
- // ~ General Sibling Selector
- } else if ($c == '~') {
- $spaceAllowed = true;
- $tmp .= $query[$i++];
- while (
- isset($query[$i])
- && ($this->isChar($query[$i])
- || in_array($query[$i], $classChars)
- || $query[$i] == '*'
- || ($query[$i] == ' ' && $spaceAllowed)
- )
- ) {
- if ($query[$i] != ' ')
- $spaceAllowed = false;
- $tmp .= $query[$i];
- $i++;
- }
- $return[] = $tmp;
- // + Adjacent sibling selectors
- } else if ($c == '+') {
- $spaceAllowed = true;
- $tmp .= $query[$i++];
- while (
- isset($query[$i])
- && ($this->isChar($query[$i])
- || in_array($query[$i], $classChars)
- || $query[$i] == '*'
- || ($spaceAllowed && $query[$i] == ' ')
- )
- ) {
- if ($query[$i] != ' ')
- $spaceAllowed = false;
- $tmp .= $query[$i];
- $i++;
- }
- $return[] = $tmp;
- // ATTRS
- } else if ($c == '[') {
- $stack = 1;
- $tmp .= $c;
- while (isset($query[++$i])) {
- $tmp .= $query[$i];
- if ($query[$i] == '[') {
- $stack++;
- } else if ($query[$i] == ']') {
- $stack--;
- if (!$stack)
- break;
- }
- }
- $return[] = $tmp;
- $i++;
- // PSEUDO CLASSES
- } else if ($c == ':') {
- $stack = 1;
- $tmp .= $query[$i++];
- while (isset($query[$i]) && ($this->isChar($query[$i]) || in_array($query[$i], $pseudoChars))) {
- $tmp .= $query[$i];
- $i++;
- }
- // with arguments ?
- if (isset($query[$i]) && $query[$i] == '(') {
- $tmp .= $query[$i];
- $stack = 1;
- while (isset($query[++$i])) {
- $tmp .= $query[$i];
- if ($query[$i] == '(') {
- $stack++;
- } else if ($query[$i] == ')') {
- $stack--;
- if (!$stack)
- break;
- }
- }
- $return[] = $tmp;
- $i++;
- } else {
- $return[] = $tmp;
- }
- } else {
- $i++;
- }
- }
- foreach ($queries as $k => $q) {
- if (isset($q[0])) {
- if (isset($q[0][0]) && $q[0][0] == ':')
- array_unshift($queries[$k], '*');
- if ($q[0] != '>')
- array_unshift($queries[$k], ' ');
- }
- }
- return $queries;
- }
- /**
- * Return matched DOM nodes.
- *
- * @param int $index
- * @return array|DOMElement Single DOMElement or array of DOMElement.
- */
- public function get($index = null, $callback1 = null, $callback2 = null, $callback3 = null)
- {
- $return = isset($index)
- ? (isset($this->elements[$index]) ? $this->elements[$index] : null)
- : $this->elements;
- // pass thou callbacks
- $args = func_get_args();
- $args = array_slice($args, 1);
- foreach ($args as $callback) {
- if (is_array($return))
- foreach ($return as $k => $v)
- $return[$k] = phpQuery::callbackRun($callback, array($v));
- else
- $return = phpQuery::callbackRun($callback, array($return));
- }
- return $return;
- }
- /**
- * Return matched DOM nodes.
- * jQuery difference.
- *
- * @param int $index
- * @return array|string Returns string if $index != null
- * @todo implement callbacks
- * @todo return only arrays ?
- * @todo maybe other name...
- */
- public function getString($index = null, $callback1 = null, $callback2 = null, $callback3 = null)
- {
- if (!is_null($index) && is_int($index))
- $return = $this->eq($index)->text();
- else {
- $return = array();
- for ($i = 0; $i < $this->size(); $i++) {
- $return[] = $this->eq($i)->text();
- }
- }
- // pass thou callbacks
- $args = func_get_args();
- $args = array_slice($args, 1);
- foreach ($args as $callback) {
- $return = phpQuery::callbackRun($callback, array($return));
- }
- return $return;
- }
- /**
- * Return matched DOM nodes.
- * jQuery difference.
- *
- * @param int $index
- * @return array|string Returns string if $index != null
- * @todo implement callbacks
- * @todo return only arrays ?
- * @todo maybe other name...
- */
- public function getStrings($index = null, $callback1 = null, $callback2 = null, $callback3 = null)
- {
- if (!is_null($index) && is_int($index))
- $return = $this->eq($index)->text();
- else {
- $return = array();
- for ($i = 0; $i < $this->size(); $i++) {
- $return[] = $this->eq($i)->text();
- }
- // pass thou callbacks
- $args = func_get_args();
- $args = array_slice($args, 1);
- }
- foreach ($args as $callback) {
- if (is_array($return))
- foreach ($return as $k => $v)
- $return[$k] = phpQuery::callbackRun($callback, array($v));
- else
- $return = phpQuery::callbackRun($callback, array($return));
- }
- return $return;
- }
- /**
- * Returns new instance of actual class.
- *
- * @param array $newStack Optional. Will replace old stack with new and move old one to history.c
- */
- public function newInstance($newStack = null)
- {
- $class = get_class($this);
- // support inheritance by passing old object to overloaded constructor
- $new = $class != 'phpQuery'
- ? new $class($this, $this->getDocumentID())
- : new phpQueryObject($this->getDocumentID());
- $new->previous = $this;
- if (is_null($newStack)) {
- $new->elements = $this->elements;
- if ($this->elementsBackup)
- $this->elements = $this->elementsBackup;
- } else if (is_string($newStack)) {
- $new->elements = phpQuery::pq($newStack, $this->getDocumentID())->stack();
- } else {
- $new->elements = $newStack;
- }
- return $new;
- }
- /**
- * Enter description here...
- *
- * In the future, when PHP will support XLS 2.0, then we would do that this way:
- * contains(tokenize(@class, '\s'), "something")
- * @param unknown_type $class
- * @param unknown_type $node
- * @return boolean
- * @access private
- */
- protected function matchClasses($class, $node)
- {
- // multi-class
- if (mb_strpos($class, '.', 1)) {
- $classes = explode('.', substr($class, 1));
- $classesCount = count($classes);
- $nodeClasses = explode(' ', $node->getAttribute('class'));
- $nodeClassesCount = count($nodeClasses);
- if ($classesCount > $nodeClassesCount)
- return false;
- $diff = count(
- array_diff(
- $classes,
- $nodeClasses
- )
- );
- if (!$diff)
- return true;
- // single-class
- } else {
- return in_array(
- // strip leading dot from class name
- substr($class, 1),
- // get classes for element as array
- explode(' ', $node->getAttribute('class'))
- );
- }
- }
- /**
- * @access private
- */
- protected function runQuery($XQuery, $selector = null, $compare = null)
- {
- if ($compare && !method_exists($this, $compare))
- return false;
- $stack = array();
- if (!$this->elements)
- $this->debug('Stack empty, skipping...');
- // var_dump($this->elements[0]->nodeType);
- // element, document
- foreach ($this->stack(array(1, 9, 13)) as $k => $stackNode) {
- $detachAfter = false;
- // to work on detached nodes we need temporary place them somewhere
- // thats because context xpath queries sucks ;]
- $testNode = $stackNode;
- while ($testNode) {
- if (!$testNode->parentNode && !$this->isRoot($testNode)) {
- $this->root->appendChild($testNode);
- $detachAfter = $testNode;
- break;
- }
- $testNode = isset($testNode->parentNode)
- ? $testNode->parentNode
- : null;
- }
- // XXX tmp ?
- $xpath = $this->documentWrapper->isXHTML
- ? $this->getNodeXpath($stackNode, 'html')
- : $this->getNodeXpath($stackNode);
- // FIXME pseudoclasses-only query, support XML
- $query = $XQuery == '//' && $xpath == '/html[1]'
- ? '//*'
- : $xpath . $XQuery;
- $this->debug("XPATH: {$query}");
- // run query, get elements
- $nodes = $this->xpath->query($query);
- $this->debug("QUERY FETCHED");
- if (!$nodes->length)
- $this->debug('Nothing found');
- $debug = array();
- foreach ($nodes as $node) {
- $matched = false;
- if ($compare) {
- phpQuery::$debug ?
- $this->debug("Found: " . $this->whois($node) . ", comparing with {$compare}()")
- : null;
- $phpQueryDebug = phpQuery::$debug;
- phpQuery::$debug = false;
- // TODO ??? use phpQuery::callbackRun()
- if (call_user_func_array(array($this, $compare), array($selector, $node)))
- $matched = true;
- phpQuery::$debug = $phpQueryDebug;
- } else {
- $matched = true;
- }
- if ($matched) {
- if (phpQuery::$debug)
- $debug[] = $this->whois($node);
- $stack[] = $node;
- }
- }
- if (phpQuery::$debug) {
- $this->debug("Matched " . count($debug) . ": " . implode(', ', $debug));
- }
- if ($detachAfter)
- $this->root->removeChild($detachAfter);
- }
- $this->elements = $stack;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function find($selectors, $context = null, $noHistory = false)
- {
- if (!$noHistory)
- // backup last stack /for end()/
- $this->elementsBackup = $this->elements;
- // allow to define context
- // TODO combine code below with phpQuery::pq() context guessing code
- // as generic function
- if ($context) {
- if (!is_array($context) && $context instanceof DOMELEMENT)
- $this->elements = array($context);
- else if (is_array($context)) {
- $this->elements = array();
- foreach ($context as $c)
- if ($c instanceof DOMELEMENT)
- $this->elements[] = $c;
- } else if ($context instanceof self)
- $this->elements = $context->elements;
- }
- $queries = $this->parseSelector($selectors);
- $this->debug(array('FIND', $selectors, $queries));
- $XQuery = '';
- // remember stack state because of multi-queries
- $oldStack = $this->elements;
- // here we will be keeping found elements
- $stack = array();
- foreach ($queries as $selector) {
- $this->elements = $oldStack;
- $delimiterBefore = false;
- foreach ($selector as $s) {
- // TAG
- $isTag = extension_loaded('mbstring') && phpQuery::$mbstringSupport
- ? mb_ereg_match('^[\w|\||-]+$', $s) || $s == '*'
- : preg_match('@^[\w|\||-]+$@', $s) || $s == '*';
- if ($isTag) {
- if ($this->isXML()) {
- // namespace support
- if (mb_strpos($s, '|') !== false) {
- $ns = $tag = null;
- list($ns, $tag) = explode('|', $s);
- $XQuery .= "$ns:$tag";
- } else if ($s == '*') {
- $XQuery .= "*";
- } else {
- $XQuery .= "*[local-name()='$s']";
- }
- } else {
- $XQuery .= $s;
- }
- // ID
- } else if ($s[0] == '#') {
- if ($delimiterBefore)
- $XQuery .= '*';
- $XQuery .= "[@id='" . substr($s, 1) . "']";
- // ATTRIBUTES
- } else if ($s[0] == '[') {
- if ($delimiterBefore)
- $XQuery .= '*';
- // strip side brackets
- $attr = trim($s, '][');
- $execute = false;
- // attr with specifed value
- if (mb_strpos($s, '=')) {
- $value = null;
- list($attr, $value) = explode('=', $attr);
- $value = trim($value, "'\"");
- if ($this->isRegexp($attr)) {
- // cut regexp character
- $attr = substr($attr, 0, -1);
- $execute = true;
- $XQuery .= "[@{$attr}]";
- } else {
- $XQuery .= "[@{$attr}='{$value}']";
- }
- // attr without specified value
- } else {
- $XQuery .= "[@{$attr}]";
- }
- if ($execute) {
- $this->runQuery($XQuery, $s, 'is');
- $XQuery = '';
- if (!$this->length())
- break;
- }
- // CLASSES
- } else if ($s[0] == '.') {
- // TODO use return $this->find("./self::*[contains(concat(\" \",@class,\" \"), \" $class \")]");
- // thx wizDom ;)
- if ($delimiterBefore)
- $XQuery .= '*';
- $XQuery .= '[@class]';
- $this->runQuery($XQuery, $s, 'matchClasses');
- $XQuery = '';
- if (!$this->length())
- break;
- // ~ General Sibling Selector
- } else if ($s[0] == '~') {
- $this->runQuery($XQuery);
- $XQuery = '';
- $this->elements = $this
- ->siblings(
- substr($s, 1)
- )->elements;
- if (!$this->length())
- break;
- // + Adjacent sibling selectors
- } else if ($s[0] == '+') {
- // TODO /following-sibling::
- $this->runQuery($XQuery);
- $XQuery = '';
- $subSelector = substr($s, 1);
- $subElements = $this->elements;
- $this->elements = array();
- foreach ($subElements as $node) {
- // search first DOMElement sibling
- $test = $node->nextSibling;
- while ($test && !($test instanceof DOMELEMENT))
- $test = $test->nextSibling;
- if ($test && $this->is($subSelector, $test))
- $this->elements[] = $test;
- }
- if (!$this->length())
- break;
- // PSEUDO CLASSES
- } else if ($s[0] == ':') {
- // TODO optimization for :first :last
- if ($XQuery) {
- $this->runQuery($XQuery);
- $XQuery = '';
- }
- if (!$this->length())
- break;
- $this->pseudoClasses($s);
- if (!$this->length())
- break;
- // DIRECT DESCENDANDS
- } else if ($s == '>') {
- $XQuery .= '/';
- $delimiterBefore = 2;
- // ALL DESCENDANDS
- } else if ($s == ' ') {
- $XQuery .= '//';
- $delimiterBefore = 2;
- // ERRORS
- } else {
- phpQuery::debug("Unrecognized token '$s'");
- }
- $delimiterBefore = $delimiterBefore === 2;
- }
- // run query if any
- if ($XQuery && $XQuery != '//') {
- $this->runQuery($XQuery);
- $XQuery = '';
- }
- foreach ($this->elements as $node)
- if (!$this->elementsContainsNode($node, $stack))
- $stack[] = $node;
- }
- $this->elements = $stack;
- return $this->newInstance();
- }
- /**
- * @todo create API for classes with pseudoselectors
- * @access private
- */
- protected function pseudoClasses($class)
- {
- // TODO clean args parsing ?
- $class = ltrim($class, ':');
- $haveArgs = mb_strpos($class, '(');
- if ($haveArgs !== false) {
- $args = substr($class, $haveArgs + 1, -1);
- $class = substr($class, 0, $haveArgs);
- }
- switch ($class) {
- case 'even':
- case 'odd':
- $stack = array();
- foreach ($this->elements as $i => $node) {
- if ($class == 'even' && ($i % 2) == 0)
- $stack[] = $node;
- else if ($class == 'odd' && $i % 2)
- $stack[] = $node;
- }
- $this->elements = $stack;
- break;
- case 'eq':
- $k = intval($args);
- if ($k < 0) {
- $this->elements = array($this->elements[count($this->elements) + $k]);
- } else {
- $this->elements = isset($this->elements[$k])
- ? array($this->elements[$k])
- : array();
- }
- break;
- case 'gt':
- $this->elements = array_slice($this->elements, $args + 1);
- break;
- case 'lt':
- $this->elements = array_slice($this->elements, 0, $args + 1);
- break;
- case 'first':
- if (isset($this->elements[0]))
- $this->elements = array($this->elements[0]);
- break;
- case 'last':
- if ($this->elements)
- $this->elements = array($this->elements[count($this->elements) - 1]);
- break;
- /*case 'parent':
- $stack = array();
- foreach($this->elements as $node) {
- if ( $node->childNodes->length )
- $stack[] = $node;
- }
- $this->elements = $stack;
- break;*/
- case 'contains':
- $text = trim($args, "\"'");
- $stack = array();
- foreach ($this->elements as $node) {
- if (mb_stripos($node->textContent, $text) === false)
- continue;
- $stack[] = $node;
- }
- $this->elements = $stack;
- break;
- case 'not':
- $selector = self::unQuote($args);
- $this->elements = $this->not($selector)->stack();
- break;
- case 'slice':
- // TODO jQuery difference ?
- $args = explode(
- ',',
- str_replace(', ', ',', trim($args, "\"'"))
- );
- $start = $args[0];
- $end = isset($args[1])
- ? $args[1]
- : null;
- if ($end > 0)
- $end = $end - $start;
- $this->elements = array_slice($this->elements, $start, $end);
- break;
- case 'has':
- $selector = trim($args, "\"'");
- $stack = array();
- foreach ($this->stack(1) as $el) {
- if ($this->find($selector, $el, true)->length)
- $stack[] = $el;
- }
- $this->elements = $stack;
- break;
- case 'submit':
- case 'reset':
- $this->elements = phpQuery::merge(
- $this->map(
- array($this, 'is'),
- "input[type=$class]",
- new CallbackParam()
- ),
- $this->map(
- array($this, 'is'),
- "button[type=$class]",
- new CallbackParam()
- )
- );
- break;
- // $stack = array();
- // foreach($this->elements as $node)
- // if ($node->is('input[type=submit]') || $node->is('button[type=submit]'))
- // $stack[] = $el;
- // $this->elements = $stack;
- case 'input':
- $this->elements = $this->map(
- array($this, 'is'),
- 'input',
- new CallbackParam()
- )->elements;
- break;
- case 'password':
- case 'checkbox':
- case 'radio':
- case 'hidden':
- case 'image':
- case 'file':
- $this->elements = $this->map(
- array($this, 'is'),
- "input[type=$class]",
- new CallbackParam()
- )->elements;
- break;
- case 'parent':
- $this->elements = $this->map(
- function ($node) {
- return $node instanceof DOMELEMENT && $node->childNodes->length
- ? $node : null;
- }
- )->elements;
- break;
- case 'empty':
- $this->elements = $this->map(
- function ($node) {
- return $node instanceof DOMELEMENT && $node->childNodes->length
- ? null : $node;
- }
- )->elements;
- break;
- case 'disabled':
- case 'selected':
- case 'checked':
- $this->elements = $this->map(
- array($this, 'is'),
- "[$class]",
- new CallbackParam()
- )->elements;
- break;
- case 'enabled':
- $this->elements = $this->map(
- function ($node) {
- return pq($node)->not(":disabled") ? $node : null;
- }
- )->elements;
- break;
- case 'header':
- $this->elements = $this->map(
- function ($node) {
- $isHeader = isset($node->tagName) && in_array($node->tagName, array(
- "h1", "h2", "h3", "h4", "h5", "h6", "h7"
- ));
- return $isHeader
- ? $node
- : null;
- }
- )->elements;
- // $this->elements = $this->map(
- // create_function('$node', '$node = pq($node);
- // return $node->is("h1")
- // || $node->is("h2")
- // || $node->is("h3")
- // || $node->is("h4")
- // || $node->is("h5")
- // || $node->is("h6")
- // || $node->is("h7")
- // ? $node
- // : null;')
- // )->elements;
- break;
- case 'only-child':
- $this->elements = $this->map(
- function ($node) {
- return pq($node)->siblings()->size() == 0 ? $node : null;
- }
- )->elements;
- break;
- case 'first-child':
- $this->elements = $this->map(
- function ($node) {
- return pq($node)->prevAll()->size() == 0 ? $node : null;
- }
- )->elements;
- break;
- case 'last-child':
- $this->elements = $this->map(
- function ($node) {
- return pq($node)->nextAll()->size() == 0 ? $node : null;
- }
- )->elements;
- break;
- case 'nth-child':
- $param = trim($args, "\"'");
- if (!$param)
- break;
- // nth-child(n+b) to nth-child(1n+b)
- if ($param[0] == 'n')
- $param = '1' . $param;
- // :nth-child(index/even/odd/equation)
- if ($param == 'even' || $param == 'odd')
- $mapped = $this->map(
- function ($node, $param) {
- $index = pq($node)->prevAll()->size() + 1;
- if ($param == "even" && ($index % 2) == 0)
- return $node;
- else if ($param == "odd" && $index % 2 == 1)
- return $node;
- else
- return null;
- },
- new CallbackParam(),
- $param
- );
- else if (mb_strlen($param) > 1 && preg_match('/^(\d*)n([-+]?)(\d*)/', $param) === 1)
- // an+b
- $mapped = $this->map(
- function ($node, $param) {
- $prevs = pq($node)->prevAll()->size();
- $index = 1 + $prevs;
-
- preg_match("/^(\d*)n([-+]?)(\d*)/", $param, $matches);
- $a = intval($matches[1]);
- $b = intval($matches[3]);
- if ($matches[2] === "-") {
- $b = -$b;
- }
-
- if ($a > 0) {
- return ($index - $b) % $a == 0
- ? $node
- : null;
- phpQuery::debug($a . "*" . floor($index / $a) . "+$b-1 == " . ($a * floor($index / $a) + $b - 1) . " ?= $prevs");
- return $a * floor($index / $a) + $b - 1 == $prevs
- ? $node
- : null;
- } else if ($a == 0)
- return $index == $b
- ? $node
- : null;
- else
- // negative value
- return $index <= $b
- ? $node
- : null;
- // if (! $b)
- // return $index%$a == 0
- // ? $node
- // : null;
- // else
- // return ($index-$b)%$a == 0
- // ? $node
- // : null;
- },
- new CallbackParam(),
- $param
- );
- else
- // index
- $mapped = $this->map(
- function ($node, $index) {
- $prevs = pq($node)->prevAll()->size();
- if ($prevs && $prevs == $index - 1)
- return $node;
- else if (!$prevs && $index == 1)
- return $node;
- else
- return null;
- },
- new CallbackParam(),
- $param
- );
- $this->elements = $mapped->elements;
- break;
- default:
- $this->debug("Unknown pseudoclass '{$class}', skipping...");
- }
- }
- /**
- * @access private
- */
- protected function __pseudoClassParam($paramsString)
- {
- // TODO;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function is($selector, $nodes = null)
- {
- phpQuery::debug(array("Is:", $selector));
- if (!$selector)
- return false;
- $oldStack = $this->elements;
- $returnArray = false;
- if ($nodes && is_array($nodes)) {
- $this->elements = $nodes;
- } else if ($nodes)
- $this->elements = array($nodes);
- $this->filter($selector, true);
- $stack = $this->elements;
- $this->elements = $oldStack;
- if ($nodes)
- return $stack ? $stack : null;
- return (bool)count($stack);
- }
- /**
- * Enter description here...
- * jQuery difference.
- *
- * Callback:
- * - $index int
- * - $node DOMNode
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @link http://docs.jquery.com/Traversing/filter
- */
- public function filterCallback($callback, $_skipHistory = false)
- {
- if (!$_skipHistory) {
- $this->elementsBackup = $this->elements;
- $this->debug("Filtering by callback");
- }
- $newStack = array();
- foreach ($this->elements as $index => $node) {
- $result = phpQuery::callbackRun($callback, array($index, $node));
- if (is_null($result) || (!is_null($result) && $result))
- $newStack[] = $node;
- }
- $this->elements = $newStack;
- return $_skipHistory
- ? $this
- : $this->newInstance();
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @link http://docs.jquery.com/Traversing/filter
- */
- public function filter($selectors, $_skipHistory = false)
- {
- if ($selectors instanceof Callback or $selectors instanceof Closure)
- return $this->filterCallback($selectors, $_skipHistory);
- if (!$_skipHistory)
- $this->elementsBackup = $this->elements;
- $notSimpleSelector = array(' ', '>', '~', '+', '/');
- if (!is_array($selectors))
- $selectors = $this->parseSelector($selectors);
- if (!$_skipHistory)
- $this->debug(array("Filtering:", $selectors));
- $finalStack = array();
- foreach ($selectors as $selector) {
- $stack = array();
- if (!$selector)
- break;
- // avoid first space or /
- if (in_array($selector[0], $notSimpleSelector))
- $selector = array_slice($selector, 1);
- // PER NODE selector chunks
- foreach ($this->stack() as $node) {
- $break = false;
- foreach ($selector as $s) {
- if (!($node instanceof DOMELEMENT)) {
- // all besides DOMElement
- if ($s[0] == '[') {
- $attr = trim($s, '[]');
- if (mb_strpos($attr, '=')) {
- list($attr, $val) = explode('=', $attr);
- if ($attr == 'nodeType' && $node->nodeType != $val)
- $break = true;
- }
- } else
- $break = true;
- } else {
- // DOMElement only
- // ID
- if ($s[0] == '#') {
- if ($node->getAttribute('id') != substr($s, 1))
- $break = true;
- // CLASSES
- } else if ($s[0] == '.') {
- if (!$this->matchClasses($s, $node))
- $break = true;
- // ATTRS
- } else if ($s[0] == '[') {
- // strip side brackets
- $attr = trim($s, '[]');
- if (mb_strpos($attr, '=')) {
- list($attr, $val) = explode('=', $attr);
- $val = self::unQuote($val);
- if ($attr == 'nodeType') {
- if ($val != $node->nodeType)
- $break = true;
- } else if ($this->isRegexp($attr)) {
- $val = extension_loaded('mbstring') && phpQuery::$mbstringSupport
- ? quotemeta(trim($val, '"\''))
- : preg_quote(trim($val, '"\''), '@');
- // switch last character
- switch (substr($attr, -1)) {
- // quotemeta used insted of preg_quote
- // http://code.google.com/p/phpquery/issues/detail?id=76
- case '^':
- $pattern = '^' . $val;
- break;
- case '*':
- $pattern = '.*' . $val . '.*';
- break;
- case '$':
- $pattern = '.*' . $val . '$';
- break;
- }
- // cut last character
- $attr = substr($attr, 0, -1);
- $isMatch = extension_loaded('mbstring') && phpQuery::$mbstringSupport
- ? mb_ereg_match($pattern, $node->getAttribute($attr))
- : preg_match("@{$pattern}@", $node->getAttribute($attr));
- if (!$isMatch)
- $break = true;
- } else if ($node->getAttribute($attr) != $val)
- $break = true;
- } else if (!$node->hasAttribute($attr))
- $break = true;
- // PSEUDO CLASSES
- } else if ($s[0] == ':') {
- // skip
- // TAG
- } else if (trim($s)) {
- if ($s != '*') {
- // TODO namespaces
- if (isset($node->tagName)) {
- if ($node->tagName != $s)
- $break = true;
- } else if ($s == 'html' && !$this->isRoot($node))
- $break = true;
- }
- // AVOID NON-SIMPLE SELECTORS
- } else if (in_array($s, $notSimpleSelector)) {
- $break = true;
- $this->debug(array('Skipping non simple selector', $selector));
- }
- }
- if ($break)
- break;
- }
- // if element passed all chunks of selector - add it to new stack
- if (!$break)
- $stack[] = $node;
- }
- $tmpStack = $this->elements;
- $this->elements = $stack;
- // PER ALL NODES selector chunks
- foreach ($selector as $s)
- // PSEUDO CLASSES
- if ($s[0] == ':')
- $this->pseudoClasses($s);
- foreach ($this->elements as $node)
- // XXX it should be merged without duplicates
- // but jQuery doesnt do that
- $finalStack[] = $node;
- $this->elements = $tmpStack;
- }
- $this->elements = $finalStack;
- if ($_skipHistory) {
- return $this;
- } else {
- $this->debug("Stack length after filter(): " . count($finalStack));
- return $this->newInstance();
- }
- }
- /**
- *
- * @param $value
- * @return unknown_type
- * @TODO implement in all methods using passed parameters
- */
- protected static function unQuote($value)
- {
- return $value[0] == '\'' || $value[0] == '"'
- ? substr($value, 1, -1)
- : $value;
- }
- /**
- * Enter description here...
- *
- * @link http://docs.jquery.com/Ajax/load
- * @return phpQuery|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @todo Support $selector
- */
- public function load($url, $data = null, $callback = null)
- {
- if ($data && !is_array($data)) {
- $callback = $data;
- $data = null;
- }
- if (mb_strpos($url, ' ') !== false) {
- $matches = null;
- if (extension_loaded('mbstring') && phpQuery::$mbstringSupport)
- mb_ereg('^([^ ]+) (.*)$', $url, $matches);
- else
- preg_match('^([^ ]+) (.*)$', $url, $matches);
- $url = $matches[1];
- $selector = $matches[2];
- // FIXME this sucks, pass as callback param
- $this->_loadSelector = $selector;
- }
- $ajax = array(
- 'url' => $url,
- 'type' => $data ? 'POST' : 'GET',
- 'data' => $data,
- 'complete' => $callback,
- 'success' => array($this, '__loadSuccess')
- );
- phpQuery::ajax($ajax);
- return $this;
- }
- /**
- * @access private
- * @param $html
- * @return unknown_type
- */
- public function __loadSuccess($html)
- {
- if ($this->_loadSelector) {
- $html = phpQuery::newDocument($html)->find($this->_loadSelector);
- unset($this->_loadSelector);
- }
- foreach ($this->stack(1) as $node) {
- phpQuery::pq($node, $this->getDocumentID())
- ->markup($html);
- }
- }
- /**
- * Enter description here...
- *
- * @return phpQuery|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @todo
- */
- public function css()
- {
- // TODO
- return $this;
- }
- /**
- * @todo
- *
- */
- public function show()
- {
- // TODO
- return $this;
- }
- /**
- * @todo
- *
- */
- public function hide()
- {
- // TODO
- return $this;
- }
- /**
- * Trigger a type of event on every matched element.
- *
- * @param unknown_type $type
- * @param unknown_type $data
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @TODO support more than event in $type (space-separated)
- */
- public function trigger($type, $data = array())
- {
- foreach ($this->elements as $node)
- phpQueryEvents::trigger($this->getDocumentID(), $type, $data, $node);
- return $this;
- }
- /**
- * This particular method triggers all bound event handlers on an element (for a specific event type) WITHOUT executing the browsers default actions.
- *
- * @param unknown_type $type
- * @param unknown_type $data
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @TODO
- */
- public function triggerHandler($type, $data = array())
- {
- // TODO;
- }
- /**
- * Binds a handler to one or more events (like click) for each matched element.
- * Can also bind custom events.
- *
- * @param unknown_type $type
- * @param unknown_type $data Optional
- * @param unknown_type $callback
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @TODO support '!' (exclusive) events
- * @TODO support more than event in $type (space-separated)
- */
- public function bind($type, $data, $callback = null)
- {
- // TODO check if $data is callable, not using is_callable
- if (!isset($callback)) {
- $callback = $data;
- $data = null;
- }
- foreach ($this->elements as $node)
- phpQueryEvents::add($this->getDocumentID(), $node, $type, $data, $callback);
- return $this;
- }
- /**
- * Enter description here...
- *
- * @param unknown_type $type
- * @param unknown_type $callback
- * @return unknown
- * @TODO namespace events
- * @TODO support more than event in $type (space-separated)
- */
- public function unbind($type = null, $callback = null)
- {
- foreach ($this->elements as $node)
- phpQueryEvents::remove($this->getDocumentID(), $node, $type, $callback);
- return $this;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function change($callback = null)
- {
- if ($callback)
- return $this->bind('change', $callback);
- return $this->trigger('change');
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function submit($callback = null)
- {
- if ($callback)
- return $this->bind('submit', $callback);
- return $this->trigger('submit');
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function click($callback = null)
- {
- if ($callback)
- return $this->bind('click', $callback);
- return $this->trigger('click');
- }
- /**
- * Enter description here...
- *
- * @param String|phpQuery
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function wrapAllOld($wrapper)
- {
- $wrapper = pq($wrapper)->_clone();
- if (!$wrapper->length() || !$this->length())
- return $this;
- $wrapper->insertBefore($this->elements[0]);
- $deepest = $wrapper->elements[0];
- while ($deepest->firstChild && $deepest->firstChild instanceof DOMELEMENT)
- $deepest = $deepest->firstChild;
- pq($deepest)->append($this);
- return $this;
- }
- /**
- * Enter description here...
- *
- * TODO testme...
- * @param String|phpQuery
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function wrapAll($wrapper)
- {
- if (!$this->length())
- return $this;
- return phpQuery::pq($wrapper, $this->getDocumentID())
- ->clone()
- ->insertBefore($this->get(0))
- ->map(array($this, '___wrapAllCallback'))
- ->append($this);
- }
- /**
- *
- * @param $node
- * @return unknown_type
- * @access private
- */
- public function ___wrapAllCallback($node)
- {
- $deepest = $node;
- while ($deepest->firstChild && $deepest->firstChild instanceof DOMELEMENT)
- $deepest = $deepest->firstChild;
- return $deepest;
- }
- /**
- * Enter description here...
- * NON JQUERY METHOD
- *
- * @param String|phpQuery
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function wrapAllPHP($codeBefore, $codeAfter)
- {
- return $this
- ->slice(0, 1)
- ->beforePHP($codeBefore)
- ->end()
- ->slice(-1)
- ->afterPHP($codeAfter)
- ->end();
- }
- /**
- * Enter description here...
- *
- * @param String|phpQuery
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function wrap($wrapper)
- {
- foreach ($this->stack() as $node)
- phpQuery::pq($node, $this->getDocumentID())->wrapAll($wrapper);
- return $this;
- }
- /**
- * Enter description here...
- *
- * @param String|phpQuery
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function wrapPHP($codeBefore, $codeAfter)
- {
- foreach ($this->stack() as $node)
- phpQuery::pq($node, $this->getDocumentID())->wrapAllPHP($codeBefore, $codeAfter);
- return $this;
- }
- /**
- * Enter description here...
- *
- * @param String|phpQuery
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function wrapInner($wrapper)
- {
- foreach ($this->stack() as $node)
- phpQuery::pq($node, $this->getDocumentID())->contents()->wrapAll($wrapper);
- return $this;
- }
- /**
- * Enter description here...
- *
- * @param String|phpQuery
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function wrapInnerPHP($codeBefore, $codeAfter)
- {
- foreach ($this->stack(1) as $node)
- phpQuery::pq($node, $this->getDocumentID())->contents()
- ->wrapAllPHP($codeBefore, $codeAfter);
- return $this;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @testme Support for text nodes
- */
- public function contents()
- {
- $stack = array();
- foreach ($this->stack(1) as $el) {
- // FIXME (fixed) http://code.google.com/p/phpquery/issues/detail?id=56
- // if (! isset($el->childNodes))
- // continue;
- foreach ($el->childNodes as $node) {
- $stack[] = $node;
- }
- }
- return $this->newInstance($stack);
- }
- /**
- * Enter description here...
- *
- * jQuery difference.
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function contentsUnwrap()
- {
- foreach ($this->stack(1) as $node) {
- if (!$node->parentNode)
- continue;
- $childNodes = array();
- // any modification in DOM tree breaks childNodes iteration, so cache them first
- foreach ($node->childNodes as $chNode)
- $childNodes[] = $chNode;
- foreach ($childNodes as $chNode)
- // $node->parentNode->appendChild($chNode);
- $node->parentNode->insertBefore($chNode, $node);
- $node->parentNode->removeChild($node);
- }
- return $this;
- }
- /**
- * Enter description here...
- *
- * jQuery difference.
- */
- public function switchWith($markup)
- {
- $markup = pq($markup, $this->getDocumentID());
- $content = null;
- foreach ($this->stack(1) as $node) {
- pq($node)
- ->contents()->toReference($content)->end()
- ->replaceWith($markup->clone()->append($content));
- }
- return $this;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function eq($num)
- {
- $oldStack = $this->elements;
- $this->elementsBackup = $this->elements;
- $this->elements = array();
- if (isset($oldStack[$num]))
- $this->elements[] = $oldStack[$num];
- return $this->newInstance();
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function size()
- {
- return count($this->elements);
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @deprecated Use length as attribute
- */
- public function length()
- {
- return $this->size();
- }
-
- #[\ReturnTypeWillChange]
- public function count()
- {
- return $this->size();
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @todo $level
- */
- public function end($level = 1)
- {
- // $this->elements = array_pop( $this->history );
- // return $this;
- // $this->previous->DOM = $this->DOM;
- // $this->previous->XPath = $this->XPath;
- return $this->previous
- ? $this->previous
- : $this;
- }
- /**
- * Enter description here...
- * Normal use ->clone() .
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @access private
- */
- public function _clone()
- {
- $newStack = array();
- //pr(array('copy... ', $this->whois()));
- //$this->dumpHistory('copy');
- $this->elementsBackup = $this->elements;
- foreach ($this->elements as $node) {
- $newStack[] = $node->cloneNode(true);
- }
- $this->elements = $newStack;
- return $this->newInstance();
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function replaceWithPHP($code)
- {
- return $this->replaceWith(phpQuery::php($code));
- }
- /**
- * Enter description here...
- *
- * @param String|phpQuery $content
- * @link http://docs.jquery.com/Manipulation/replaceWith#content
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function replaceWith($content)
- {
- return $this->after($content)->remove();
- }
- /**
- * Enter description here...
- *
- * @param String $selector
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @todo this works ?
- */
- public function replaceAll($selector)
- {
- foreach (phpQuery::pq($selector, $this->getDocumentID()) as $node)
- phpQuery::pq($node, $this->getDocumentID())
- ->after($this->_clone())
- ->remove();
- return $this;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function remove($selector = null)
- {
- $loop = $selector
- ? $this->filter($selector)->elements
- : $this->elements;
- foreach ($loop as $node) {
- if (!$node->parentNode)
- continue;
- if (isset($node->tagName))
- $this->debug("Removing '{$node->tagName}'");
- $node->parentNode->removeChild($node);
- // Mutation event
- $event = new DOMEvent(array(
- 'target' => $node,
- 'type' => 'DOMNodeRemoved'
- ));
- phpQueryEvents::trigger(
- $this->getDocumentID(),
- $event->type,
- array($event),
- $node
- );
- }
- return $this;
- }
- protected function markupEvents($newMarkup, $oldMarkup, $node)
- {
- if ($node->tagName == 'textarea' && $newMarkup != $oldMarkup) {
- $event = new DOMEvent(array(
- 'target' => $node,
- 'type' => 'change'
- ));
- phpQueryEvents::trigger(
- $this->getDocumentID(),
- $event->type,
- array($event),
- $node
- );
- }
- }
- /**
- * jQuey difference
- *
- * @param $markup
- * @return unknown_type
- * @TODO trigger change event for textarea
- */
- public function markup($markup = null, $callback1 = null, $callback2 = null, $callback3 = null)
- {
- $args = func_get_args();
- if ($this->documentWrapper->isXML)
- return call_user_func_array(array($this, 'xml'), $args);
- else
- return call_user_func_array(array($this, 'html'), $args);
- }
- /**
- * jQuey difference
- *
- * @param $markup
- * @return unknown_type
- */
- public function markupOuter($callback1 = null, $callback2 = null, $callback3 = null)
- {
- $args = func_get_args();
- if ($this->documentWrapper->isXML)
- return call_user_func_array(array($this, 'xmlOuter'), $args);
- else
- return call_user_func_array(array($this, 'htmlOuter'), $args);
- }
- /**
- * Enter description here...
- *
- * @param unknown_type $html
- * @return string|phpQuery|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @TODO force html result
- */
- public function html($html = null, $callback1 = null, $callback2 = null, $callback3 = null)
- {
- if (isset($html)) {
- // INSERT
- $nodes = $this->documentWrapper->import($html);
- $this->empty();
- foreach ($this->stack(1) as $alreadyAdded => $node) {
- // for now, limit events for textarea
- if (($this->isXHTML() || $this->isHTML()) && $node->tagName == 'textarea')
- $oldHtml = pq($node, $this->getDocumentID())->markup();
- foreach ($nodes as $newNode) {
- $node->appendChild(
- $alreadyAdded
- ? $newNode->cloneNode(true)
- : $newNode
- );
- }
- // for now, limit events for textarea
- if (($this->isXHTML() || $this->isHTML()) && $node->tagName == 'textarea')
- $this->markupEvents($html, $oldHtml, $node);
- }
- return $this;
- } else {
- // FETCH
- $return = $this->documentWrapper->markup($this->elements, true);
- $args = func_get_args();
- foreach (array_slice($args, 1) as $callback) {
- $return = phpQuery::callbackRun($callback, array($return));
- }
- return $return;
- }
- }
- /**
- * @TODO force xml result
- */
- public function xml($xml = null, $callback1 = null, $callback2 = null, $callback3 = null)
- {
- $args = func_get_args();
- return call_user_func_array(array($this, 'html'), $args);
- }
- /**
- * Enter description here...
- * @TODO force html result
- *
- * @return String
- */
- public function htmlOuter($callback1 = null, $callback2 = null, $callback3 = null)
- {
- $markup = $this->documentWrapper->markup($this->elements);
- // pass thou callbacks
- $args = func_get_args();
- foreach ($args as $callback) {
- $markup = phpQuery::callbackRun($callback, array($markup));
- }
- return $markup;
- }
- /**
- * @TODO force xml result
- */
- public function xmlOuter($callback1 = null, $callback2 = null, $callback3 = null)
- {
- $args = func_get_args();
- return call_user_func_array(array($this, 'htmlOuter'), $args);
- }
- public function __toString()
- {
- return $this->markupOuter();
- }
- /**
- * Just like html(), but returns markup with VALID (dangerous) PHP tags.
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @todo support returning markup with PHP tags when called without param
- */
- public function php($code = null)
- {
- return $this->markupPHP($code);
- }
- /**
- * Enter description here...
- *
- * @param $code
- * @return unknown_type
- */
- public function markupPHP($code = null)
- {
- return isset($code)
- ? $this->markup(phpQuery::php($code))
- : phpQuery::markupToPHP($this->markup());
- }
- /**
- * Enter description here...
- *
- * @param $code
- * @return unknown_type
- */
- public function markupOuterPHP()
- {
- return phpQuery::markupToPHP($this->markupOuter());
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function children($selector = null)
- {
- $stack = array();
- foreach ($this->stack(1) as $node) {
- // foreach($node->getElementsByTagName('*') as $newNode) {
- foreach ($node->childNodes as $newNode) {
- if ($newNode->nodeType != 1)
- continue;
- if ($selector && !$this->is($selector, $newNode))
- continue;
- if ($this->elementsContainsNode($newNode, $stack))
- continue;
- $stack[] = $newNode;
- }
- }
- $this->elementsBackup = $this->elements;
- $this->elements = $stack;
- return $this->newInstance();
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function ancestors($selector = null)
- {
- return $this->children($selector);
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function append($content)
- {
- return $this->insert($content, __FUNCTION__);
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function appendPHP($content)
- {
- return $this->insert(" ", 'append');
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function appendTo($seletor)
- {
- return $this->insert($seletor, __FUNCTION__);
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function prepend($content)
- {
- return $this->insert($content, __FUNCTION__);
- }
- /**
- * Enter description here...
- *
- * @todo accept many arguments, which are joined, arrays maybe also
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function prependPHP($content)
- {
- return $this->insert(" ", 'prepend');
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function prependTo($seletor)
- {
- return $this->insert($seletor, __FUNCTION__);
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function before($content)
- {
- return $this->insert($content, __FUNCTION__);
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function beforePHP($content)
- {
- return $this->insert(" ", 'before');
- }
- /**
- * Enter description here...
- *
- * @param String|phpQuery
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function insertBefore($seletor)
- {
- return $this->insert($seletor, __FUNCTION__);
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function after($content)
- {
- return $this->insert($content, __FUNCTION__);
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function afterPHP($content)
- {
- return $this->insert(" ", 'after');
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function insertAfter($seletor)
- {
- return $this->insert($seletor, __FUNCTION__);
- }
- /**
- * Internal insert method. Don't use it.
- *
- * @param unknown_type $target
- * @param unknown_type $type
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @access private
- */
- public function insert($target, $type)
- {
- $this->debug("Inserting data with '{$type}'");
- $to = false;
- switch ($type) {
- case 'appendTo':
- case 'prependTo':
- case 'insertBefore':
- case 'insertAfter':
- $to = true;
- }
- switch (gettype($target)) {
- case 'string':
- $insertFrom = $insertTo = array();
- if ($to) {
- // INSERT TO
- $insertFrom = $this->elements;
- if (phpQuery::isMarkup($target)) {
- // $target is new markup, import it
- $insertTo = $this->documentWrapper->import($target);
- // insert into selected element
- } else {
- // $tagret is a selector
- $thisStack = $this->elements;
- $this->toRoot();
- $insertTo = $this->find($target)->elements;
- $this->elements = $thisStack;
- }
- } else {
- // INSERT FROM
- $insertTo = $this->elements;
- $insertFrom = $this->documentWrapper->import($target);
- }
- break;
- case 'object':
- $insertFrom = $insertTo = array();
- // phpQuery
- if ($target instanceof self) {
- if ($to) {
- $insertTo = $target->elements;
- if ($this->documentFragment && $this->stackIsRoot())
- // get all body children
- // $loop = $this->find('body > *')->elements;
- // TODO test it, test it hard...
- // $loop = $this->newInstance($this->root)->find('> *')->elements;
- $loop = $this->root->childNodes;
- else
- $loop = $this->elements;
- // import nodes if needed
- $insertFrom = $this->getDocumentID() == $target->getDocumentID()
- ? $loop
- : $target->documentWrapper->import($loop);
- } else {
- $insertTo = $this->elements;
- if ($target->documentFragment && $target->stackIsRoot())
- // get all body children
- // $loop = $target->find('body > *')->elements;
- $loop = $target->root->childNodes;
- else
- $loop = $target->elements;
- // import nodes if needed
- $insertFrom = $this->getDocumentID() == $target->getDocumentID()
- ? $loop
- : $this->documentWrapper->import($loop);
- }
- // DOMNODE
- } elseif ($target instanceof DOMNODE) {
- // import node if needed
- // if ( $target->ownerDocument != $this->DOM )
- // $target = $this->DOM->importNode($target, true);
- if ($to) {
- $insertTo = array($target);
- if ($this->documentFragment && $this->stackIsRoot())
- // get all body children
- $loop = $this->root->childNodes;
- // $loop = $this->find('body > *')->elements;
- else
- $loop = $this->elements;
- foreach ($loop as $fromNode)
- // import nodes if needed
- $insertFrom[] = !$fromNode->ownerDocument->isSameNode($target->ownerDocument)
- ? $target->ownerDocument->importNode($fromNode, true)
- : $fromNode;
- } else {
- // import node if needed
- if (!$target->ownerDocument->isSameNode($this->document))
- $target = $this->document->importNode($target, true);
- $insertTo = $this->elements;
- $insertFrom[] = $target;
- }
- }
- break;
- }
- phpQuery::debug("From " . count($insertFrom) . "; To " . count($insertTo) . " nodes");
- foreach ($insertTo as $insertNumber => $toNode) {
- // we need static relative elements in some cases
- switch ($type) {
- case 'prependTo':
- case 'prepend':
- $firstChild = $toNode->firstChild;
- break;
- case 'insertAfter':
- case 'after':
- $nextSibling = $toNode->nextSibling;
- break;
- }
- foreach ($insertFrom as $fromNode) {
- // clone if inserted already before
- $insert = $insertNumber
- ? $fromNode->cloneNode(true)
- : $fromNode;
- switch ($type) {
- case 'appendTo':
- case 'append':
- // $toNode->insertBefore(
- // $fromNode,
- // $toNode->lastChild->nextSibling
- // );
- $toNode->appendChild($insert);
- $eventTarget = $insert;
- break;
- case 'prependTo':
- case 'prepend':
- $toNode->insertBefore(
- $insert,
- $firstChild
- );
- break;
- case 'insertBefore':
- case 'before':
- if (!$toNode->parentNode)
- throw new Exception("No parentNode, can't do {$type}()");
- else
- $toNode->parentNode->insertBefore(
- $insert,
- $toNode
- );
- break;
- case 'insertAfter':
- case 'after':
- if (!$toNode->parentNode)
- throw new Exception("No parentNode, can't do {$type}()");
- else
- $toNode->parentNode->insertBefore(
- $insert,
- $nextSibling
- );
- break;
- }
- // Mutation event
- $event = new DOMEvent(array(
- 'target' => $insert,
- 'type' => 'DOMNodeInserted'
- ));
- phpQueryEvents::trigger(
- $this->getDocumentID(),
- $event->type,
- array($event),
- $insert
- );
- }
- }
- return $this;
- }
- /**
- * Enter description here...
- *
- * @return Int
- */
- public function index($subject)
- {
- $index = -1;
- $subject = $subject instanceof phpQueryObject
- ? $subject->elements[0]
- : $subject;
- foreach ($this->newInstance() as $k => $node) {
- if ($node->isSameNode($subject))
- $index = $k;
- }
- return $index;
- }
- /**
- * Enter description here...
- *
- * @param unknown_type $start
- * @param unknown_type $end
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @testme
- */
- public function slice($start, $end = null)
- {
- // $last = count($this->elements)-1;
- // $end = $end
- // ? min($end, $last)
- // : $last;
- // if ($start < 0)
- // $start = $last+$start;
- // if ($start > $last)
- // return array();
- if ($end > 0)
- $end = $end - $start;
- return $this->newInstance(
- array_slice($this->elements, $start, $end)
- );
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function reverse()
- {
- $this->elementsBackup = $this->elements;
- $this->elements = array_reverse($this->elements);
- return $this->newInstance();
- }
- /**
- * Return joined text content.
- * @return String
- */
- public function text($text = null, $callback1 = null, $callback2 = null, $callback3 = null)
- {
- if (isset($text))
- return $this->html(htmlspecialchars($text));
- $args = func_get_args();
- $args = array_slice($args, 1);
- $return = '';
- foreach ($this->elements as $node) {
- $text = $node->textContent;
- if (count($this->elements) > 1 && $text)
- $text .= "\n";
- foreach ($args as $callback) {
- $text = phpQuery::callbackRun($callback, array($text));
- }
- $return .= $text;
- }
- return $return;
- }
- /**
- * @return The text content of each matching element, like
- * text() but returns an array with one entry per matched element.
- * Read only.
- */
- public function texts($attr = null)
- {
- $results = array();
- foreach ($this->elements as $node) {
- $results[] = $node->textContent;
- }
- return $results;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function plugin($class, $file = null)
- {
- phpQuery::plugin($class, $file);
- return $this;
- }
- /**
- * Deprecated, use $pq->plugin() instead.
- *
- * @deprecated
- * @param $class
- * @param $file
- * @return unknown_type
- */
- public static function extend($class, $file = null)
- {
- return $this->plugin($class, $file);
- }
- /**
- *
- * @access private
- * @param $method
- * @param $args
- * @return unknown_type
- */
- public function __call($method, $args)
- {
- $aliasMethods = array('clone', 'empty');
- if (isset(phpQuery::$extendMethods[$method])) {
- array_unshift($args, $this);
- return phpQuery::callbackRun(
- phpQuery::$extendMethods[$method],
- $args
- );
- } else if (isset(phpQuery::$pluginsMethods[$method])) {
- array_unshift($args, $this);
- $class = phpQuery::$pluginsMethods[$method];
- $realClass = "phpQueryObjectPlugin_$class";
- $return = call_user_func_array(
- array($realClass, $method),
- $args
- );
- // XXX deprecate ?
- return is_null($return)
- ? $this
- : $return;
- } else if (in_array($method, $aliasMethods)) {
- return call_user_func_array(array($this, '_' . $method), $args);
- } else
- throw new Exception("Method '{$method}' doesnt exist");
- }
- /**
- * Safe rename of next().
- *
- * Use it ONLY when need to call next() on an iterated object (in same time).
- * Normaly there is no need to do such thing ;)
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @access private
- */
- public function _next($selector = null)
- {
- return $this->newInstance(
- $this->getElementSiblings('nextSibling', $selector, true)
- );
- }
- /**
- * Use prev() and next().
- *
- * @deprecated
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @access private
- */
- public function _prev($selector = null)
- {
- return $this->prev($selector);
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function prev($selector = null)
- {
- return $this->newInstance(
- $this->getElementSiblings('previousSibling', $selector, true)
- );
- }
- /**
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @todo
- */
- public function prevAll($selector = null)
- {
- return $this->newInstance(
- $this->getElementSiblings('previousSibling', $selector)
- );
- }
- /**
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @todo FIXME: returns source elements insted of next siblings
- */
- public function nextAll($selector = null)
- {
- return $this->newInstance(
- $this->getElementSiblings('nextSibling', $selector)
- );
- }
- /**
- * @access private
- */
- protected function getElementSiblings($direction, $selector = null, $limitToOne = false)
- {
- $stack = array();
- $count = 0;
- foreach ($this->stack() as $node) {
- $test = $node;
- while (isset($test->{$direction}) && $test->{$direction}) {
- $test = $test->{$direction};
- if (!$test instanceof DOMELEMENT)
- continue;
- $stack[] = $test;
- if ($limitToOne)
- break;
- }
- }
- if ($selector) {
- $stackOld = $this->elements;
- $this->elements = $stack;
- $stack = $this->filter($selector, true)->stack();
- $this->elements = $stackOld;
- }
- return $stack;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function siblings($selector = null)
- {
- $stack = array();
- $siblings = array_merge(
- $this->getElementSiblings('previousSibling', $selector),
- $this->getElementSiblings('nextSibling', $selector)
- );
- foreach ($siblings as $node) {
- if (!$this->elementsContainsNode($node, $stack))
- $stack[] = $node;
- }
- return $this->newInstance($stack);
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function not($selector = null)
- {
- if (is_string($selector))
- phpQuery::debug(array('not', $selector));
- else
- phpQuery::debug('not');
- $stack = array();
- if ($selector instanceof self || $selector instanceof DOMNODE) {
- foreach ($this->stack() as $node) {
- if ($selector instanceof self) {
- $matchFound = false;
- foreach ($selector->stack() as $notNode) {
- if ($notNode->isSameNode($node))
- $matchFound = true;
- }
- if (!$matchFound)
- $stack[] = $node;
- } else if ($selector instanceof DOMNODE) {
- if (!$selector->isSameNode($node))
- $stack[] = $node;
- } else {
- if (!$this->is($selector))
- $stack[] = $node;
- }
- }
- } else {
- $orgStack = $this->stack();
- $matched = $this->filter($selector, true)->stack();
- // $matched = array();
- // // simulate OR in filter() instead of AND 5y
- // foreach($this->parseSelector($selector) as $s) {
- // $matched = array_merge($matched,
- // $this->filter(array($s))->stack()
- // );
- // }
- foreach ($orgStack as $node)
- if (!$this->elementsContainsNode($node, $matched))
- $stack[] = $node;
- }
- return $this->newInstance($stack);
- }
- /**
- * Enter description here...
- *
- * @param string|phpQueryObject
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function add($selector = null)
- {
- if (!$selector)
- return $this;
- $stack = array();
- $this->elementsBackup = $this->elements;
- $found = phpQuery::pq($selector, $this->getDocumentID());
- $this->merge($found->elements);
- return $this->newInstance();
- }
- /**
- * @access private
- */
- protected function merge()
- {
- foreach (func_get_args() as $nodes)
- foreach ($nodes as $newNode)
- if (!$this->elementsContainsNode($newNode))
- $this->elements[] = $newNode;
- }
- /**
- * @access private
- * TODO refactor to stackContainsNode
- */
- protected function elementsContainsNode($nodeToCheck, $elementsStack = null)
- {
- $loop = !is_null($elementsStack)
- ? $elementsStack
- : $this->elements;
- foreach ($loop as $node) {
- if ($node->isSameNode($nodeToCheck))
- return true;
- }
- return false;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function parent($selector = null)
- {
- $stack = array();
- foreach ($this->elements as $node)
- if ($node->parentNode && !$this->elementsContainsNode($node->parentNode, $stack))
- $stack[] = $node->parentNode;
- $this->elementsBackup = $this->elements;
- $this->elements = $stack;
- if ($selector)
- $this->filter($selector, true);
- return $this->newInstance();
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function parents($selector = null)
- {
- $stack = array();
- if (!$this->elements)
- $this->debug('parents() - stack empty');
- foreach ($this->elements as $node) {
- $test = $node;
- while ($test->parentNode) {
- $test = $test->parentNode;
- if ($this->isRoot($test))
- break;
- if (!$this->elementsContainsNode($test, $stack)) {
- $stack[] = $test;
- continue;
- }
- }
- }
- $this->elementsBackup = $this->elements;
- $this->elements = $stack;
- if ($selector)
- $this->filter($selector, true);
- return $this->newInstance();
- }
- /**
- * Internal stack iterator.
- *
- * @access private
- */
- public function stack($nodeTypes = null)
- {
- if (!isset($nodeTypes))
- return $this->elements;
- if (!is_array($nodeTypes))
- $nodeTypes = array($nodeTypes);
- $return = array();
- foreach ($this->elements as $node) {
- if (in_array($node->nodeType, $nodeTypes))
- $return[] = $node;
- }
- return $return;
- }
- // TODO phpdoc; $oldAttr is result of hasAttribute, before any changes
- protected function attrEvents($attr, $oldAttr, $oldValue, $node)
- {
- // skip events for XML documents
- if (!$this->isXHTML() && !$this->isHTML())
- return;
- $event = null;
- // identify
- $isInputValue = $node->tagName == 'input'
- && (in_array(
- $node->getAttribute('type'),
- array('text', 'password', 'hidden')
- )
- || !$node->getAttribute('type')
- );
- $isRadio = $node->tagName == 'input'
- && $node->getAttribute('type') == 'radio';
- $isCheckbox = $node->tagName == 'input'
- && $node->getAttribute('type') == 'checkbox';
- $isOption = $node->tagName == 'option';
- if ($isInputValue && $attr == 'value' && $oldValue != $node->getAttribute($attr)) {
- $event = new DOMEvent(array(
- 'target' => $node,
- 'type' => 'change'
- ));
- } else if (($isRadio || $isCheckbox) && $attr == 'checked' && (
- // check
- (!$oldAttr && $node->hasAttribute($attr))
- // un-check
- || (!$node->hasAttribute($attr) && $oldAttr)
- )) {
- $event = new DOMEvent(array(
- 'target' => $node,
- 'type' => 'change'
- ));
- } else if ($isOption && $node->parentNode && $attr == 'selected' && (
- // select
- (!$oldAttr && $node->hasAttribute($attr))
- // un-select
- || (!$node->hasAttribute($attr) && $oldAttr)
- )) {
- $event = new DOMEvent(array(
- 'target' => $node->parentNode,
- 'type' => 'change'
- ));
- }
- if ($event) {
- phpQueryEvents::trigger(
- $this->getDocumentID(),
- $event->type,
- array($event),
- $node
- );
- }
- }
- public function attr($attr = null, $value = null)
- {
- foreach ($this->stack(1) as $node) {
- if (!is_null($value)) {
- $loop = $attr == '*'
- ? $this->getNodeAttrs($node)
- : array($attr);
- foreach ($loop as $a) {
- $oldValue = $node->getAttribute($a);
- $oldAttr = $node->hasAttribute($a);
- // TODO raises an error when charset other than UTF-8
- // while document's charset is also not UTF-8
- @$node->setAttribute($a, $value);
- $this->attrEvents($a, $oldAttr, $oldValue, $node);
- }
- } else if ($attr == '*') {
- // jQuery difference
- $return = array();
- foreach ($node->attributes as $n => $v)
- $return[$n] = $v->value;
- return $return;
- } else
- return $node->hasAttribute($attr)
- ? $node->getAttribute($attr)
- : null;
- }
- return is_null($value)
- ? '' : $this;
- }
- /**
- * @return The same attribute of each matching element, like
- * attr() but returns an array with one entry per matched element.
- * Read only.
- */
- public function attrs($attr = null)
- {
- $results = array();
- foreach ($this->stack(1) as $node) {
- $results[] = $node->hasAttribute($attr)
- ? $node->getAttribute($attr)
- : null;
- }
- return $results;
- }
- /**
- * @access private
- */
- protected function getNodeAttrs($node)
- {
- $return = array();
- foreach ($node->attributes as $n => $o)
- $return[] = $n;
- return $return;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @todo check CDATA ???
- */
- public function attrPHP($attr, $code)
- {
- if (!is_null($code)) {
- $value = '<' . '?php ' . $code . ' ?' . '>';
- // TODO tempolary solution
- // http://code.google.com/p/phpquery/issues/detail?id=17
- // if (function_exists('mb_detect_encoding') && mb_detect_encoding($value) == 'ASCII')
- // $value = mb_convert_encoding($value, 'UTF-8', 'HTML-ENTITIES');
- }
- foreach ($this->stack(1) as $node) {
- if (!is_null($code)) {
- // $attrNode = $this->DOM->createAttribute($attr);
- $node->setAttribute($attr, $value);
- // $attrNode->value = $value;
- // $node->appendChild($attrNode);
- } else if ($attr == '*') {
- // jQuery diff
- $return = array();
- foreach ($node->attributes as $n => $v)
- $return[$n] = $v->value;
- return $return;
- } else
- return $node->getAttribute($attr);
- }
- return $this;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function removeAttr($attr)
- {
- foreach ($this->stack(1) as $node) {
- $loop = $attr == '*'
- ? $this->getNodeAttrs($node)
- : array($attr);
- foreach ($loop as $a) {
- $oldValue = $node->getAttribute($a);
- $node->removeAttribute($a);
- $this->attrEvents($a, $oldValue, null, $node);
- }
- }
- return $this;
- }
- /**
- * Return form element value.
- *
- * @return String Fields value.
- */
- public function val($val = null)
- {
- if (!isset($val)) {
- if ($this->eq(0)->is('select')) {
- $selected = $this->eq(0)->find('option[selected=selected]');
- if ($selected->is('[value]'))
- return $selected->attr('value');
- else
- return $selected->text();
- } else if ($this->eq(0)->is('textarea'))
- return $this->eq(0)->markup();
- else
- return $this->eq(0)->attr('value');
- } else {
- $_val = null;
- foreach ($this->stack(1) as $node) {
- $node = pq($node, $this->getDocumentID());
- if (is_array($val) && in_array($node->attr('type'), array('checkbox', 'radio'))) {
- $isChecked = in_array($node->attr('value'), $val)
- || in_array($node->attr('name'), $val);
- if ($isChecked)
- $node->attr('checked', 'checked');
- else
- $node->removeAttr('checked');
- } else if ($node->get(0)->tagName == 'select') {
- if (!isset($_val)) {
- $_val = array();
- if (!is_array($val))
- $_val = array((string)$val);
- else
- foreach ($val as $v)
- $_val[] = $v;
- }
- foreach ($node['option']->stack(1) as $option) {
- $option = pq($option, $this->getDocumentID());
- $selected = false;
- // XXX: workaround for string comparsion, see issue #96
- // http://code.google.com/p/phpquery/issues/detail?id=96
- $selected = is_null($option->attr('value'))
- ? in_array($option->markup(), $_val)
- : in_array($option->attr('value'), $_val);
- // $optionValue = $option->attr('value');
- // $optionText = $option->text();
- // $optionTextLenght = mb_strlen($optionText);
- // foreach($_val as $v)
- // if ($optionValue == $v)
- // $selected = true;
- // else if ($optionText == $v && $optionTextLenght == mb_strlen($v))
- // $selected = true;
- if ($selected)
- $option->attr('selected', 'selected');
- else
- $option->removeAttr('selected');
- }
- } else if ($node->get(0)->tagName == 'textarea')
- $node->markup($val);
- else
- $node->attr('value', $val);
- }
- }
- return $this;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function andSelf()
- {
- if ($this->previous)
- $this->elements = array_merge($this->elements, $this->previous->elements);
- return $this;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function addClass($className)
- {
- if (!$className)
- return $this;
- foreach ($this->stack(1) as $node) {
- if (!$this->is(".$className", $node))
- $node->setAttribute(
- 'class',
- trim($node->getAttribute('class') . ' ' . $className)
- );
- }
- return $this;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function addClassPHP($className)
- {
- foreach ($this->stack(1) as $node) {
- $classes = $node->getAttribute('class');
- $newValue = $classes
- ? $classes . ' <' . '?php ' . $className . ' ?' . '>'
- : '<' . '?php ' . $className . ' ?' . '>';
- $node->setAttribute('class', $newValue);
- }
- return $this;
- }
- /**
- * Enter description here...
- *
- * @param string $className
- * @return bool
- */
- public function hasClass($className)
- {
- foreach ($this->stack(1) as $node) {
- if ($this->is(".$className", $node))
- return true;
- }
- return false;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function removeClass($className)
- {
- foreach ($this->stack(1) as $node) {
- $classes = explode(' ', $node->getAttribute('class'));
- if (in_array($className, $classes)) {
- $classes = array_diff($classes, array($className));
- if ($classes)
- $node->setAttribute('class', implode(' ', $classes));
- else
- $node->removeAttribute('class');
- }
- }
- return $this;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function toggleClass($className)
- {
- foreach ($this->stack(1) as $node) {
- if ($this->is($node, '.' . $className))
- $this->removeClass($className);
- else
- $this->addClass($className);
- }
- return $this;
- }
- /**
- * Proper name without underscore (just ->empty()) also works.
- *
- * Removes all child nodes from the set of matched elements.
- *
- * Example:
- * pq("p")._empty()
- *
- * HTML:
- * Hello, Person and person
- *
- * Result:
- * [
]
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @access private
- */
- public function _empty()
- {
- foreach ($this->stack(1) as $node) {
- // thx to 'dave at dgx dot cz'
- $node->nodeValue = '';
- }
- return $this;
- }
- /**
- * Enter description here...
- *
- * @param array|string $callback Expects $node as first param, $index as second
- * @param array $scope External variables passed to callback. Use compact('varName1', 'varName2'...) and extract($scope)
- * @param array $arg1 Will ba passed as third and futher args to callback.
- * @param array $arg2 Will ba passed as fourth and futher args to callback, and so on...
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function each($callback, $param1 = null, $param2 = null, $param3 = null)
- {
- $paramStructure = null;
- if (func_num_args() > 1) {
- $paramStructure = func_get_args();
- $paramStructure = array_slice($paramStructure, 1);
- }
- foreach ($this->elements as $v)
- phpQuery::callbackRun($callback, array($v), $paramStructure);
- return $this;
- }
- /**
- * Run callback on actual object.
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public function callback($callback, $param1 = null, $param2 = null, $param3 = null)
- {
- $params = func_get_args();
- $params[0] = $this;
- phpQuery::callbackRun($callback, $params);
- return $this;
- }
- /**
- * Enter description here...
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @todo add $scope and $args as in each() ???
- */
- public function map($callback, $param1 = null, $param2 = null, $param3 = null)
- {
- // $stack = array();
- //// foreach($this->newInstance() as $node) {
- // foreach($this->newInstance() as $node) {
- // $result = call_user_func($callback, $node);
- // if ($result)
- // $stack[] = $result;
- // }
- $params = func_get_args();
- array_unshift($params, $this->elements);
- return $this->newInstance(
- call_user_func_array(array('phpQuery', 'map'), $params)
- // phpQuery::map($this->elements, $callback)
- );
- }
- /**
- * Enter description here...
- *
- * @param $key
- * @param $value
- */
- public function data($key, $value = null)
- {
- if (!isset($value)) {
- // TODO? implement specific jQuery behavior od returning parent values
- // is child which we look up doesn't exist
- return phpQuery::data($this->get(0), $key, $value, $this->getDocumentID());
- } else {
- foreach ($this as $node)
- phpQuery::data($node, $key, $value, $this->getDocumentID());
- return $this;
- }
- }
- /**
- * Enter description here...
- *
- * @param $key
- */
- public function removeData($key)
- {
- foreach ($this as $node)
- phpQuery::removeData($node, $key, $this->getDocumentID());
- return $this;
- }
- // INTERFACE IMPLEMENTATIONS
-
- // ITERATOR INTERFACE
- /**
- * @access private
- */
- #[\ReturnTypeWillChange]
- public function rewind()
- {
- $this->debug('iterating foreach');
- // phpQuery::selectDocument($this->getDocumentID());
- $this->elementsBackup = $this->elements;
- $this->elementsInterator = $this->elements;
- $this->valid = isset($this->elements[0])
- ? 1 : 0;
- // $this->elements = $this->valid
- // ? array($this->elements[0])
- // : array();
- $this->current = 0;
- }
- /**
- * @access private
- */
- #[\ReturnTypeWillChange]
- public function current()
- {
- return $this->elementsInterator[$this->current];
- }
- /**
- * @access private
- */
- #[\ReturnTypeWillChange]
- public function key()
- {
- return $this->current;
- }
- /**
- * Double-function method.
- *
- * First: main iterator interface method.
- * Second: Returning next sibling, alias for _next().
- *
- * Proper functionality is choosed automagicaly.
- *
- * @see phpQueryObject::_next()
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- #[\ReturnTypeWillChange]
- public function next($cssSelector = null)
- {
- // if ($cssSelector || $this->valid)
- // return $this->_next($cssSelector);
- $this->valid = isset($this->elementsInterator[$this->current + 1])
- ? true
- : false;
- if (!$this->valid && $this->elementsInterator) {
- $this->elementsInterator = null;
- } else if ($this->valid) {
- $this->current++;
- } else {
- return $this->_next($cssSelector);
- }
- }
- /**
- * @access private
- */
- #[\ReturnTypeWillChange]
- public function valid()
- {
- return $this->valid;
- }
- // ITERATOR INTERFACE END
- // ARRAYACCESS INTERFACE
- /**
- * @access private
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return $this->find($offset)->size() > 0;
- }
- /**
- * @access private
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return $this->find($offset);
- }
- /**
- * @access private
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- // $this->find($offset)->replaceWith($value);
- $this->find($offset)->html($value);
- }
- /**
- * @access private
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- // empty
- throw new Exception("Can't do unset, use array interface only for calling queries and replacing HTML.");
- }
- // ARRAYACCESS INTERFACE END
- /**
- * Returns node's XPath.
- *
- * @param unknown_type $oneNode
- * @return string
- * @TODO use native getNodePath is avaible
- * @access private
- */
- protected function getNodeXpath($oneNode = null, $namespace = null)
- {
- $return = array();
- $loop = $oneNode
- ? array($oneNode)
- : $this->elements;
- // if ($namespace)
- // $namespace .= ':';
- foreach ($loop as $node) {
- if ($node instanceof DOMDOCUMENT) {
- $return[] = '';
- continue;
- }
- $xpath = array();
- while (!($node instanceof DOMDOCUMENT)) {
- $i = 1;
- $sibling = $node;
- while ($sibling->previousSibling) {
- $sibling = $sibling->previousSibling;
- $isElement = $sibling instanceof DOMELEMENT;
- if ($isElement && $sibling->tagName == $node->tagName)
- $i++;
- }
- $xpath[] = $this->isXML()
- ? "*[local-name()='{$node->tagName}'][{$i}]"
- : "{$node->tagName}[{$i}]";
- $node = $node->parentNode;
- }
- $xpath = implode('/', array_reverse($xpath));
- $return[] = '/' . $xpath;
- }
- return $oneNode
- ? $return[0]
- : $return;
- }
- // HELPERS
- public function whois($oneNode = null)
- {
- $return = array();
- $loop = $oneNode
- ? array($oneNode)
- : $this->elements;
- foreach ($loop as $node) {
- if (isset($node->tagName)) {
- $tag = in_array($node->tagName, array('php', 'js'))
- ? strtoupper($node->tagName)
- : $node->tagName;
- $return[] = $tag
- . ($node->getAttribute('id')
- ? '#' . $node->getAttribute('id') : '')
- . ($node->getAttribute('class')
- ? '.' . implode('.', explode(' ', $node->getAttribute('class'))) : '')
- . ($node->getAttribute('name')
- ? '[name="' . $node->getAttribute('name') . '"]' : '')
- . ($node->getAttribute('value') && strpos($node->getAttribute('value'), '<' . '?php') === false
- ? '[value="' . substr(str_replace("\n", '', $node->getAttribute('value')), 0, 15) . '"]' : '')
- . ($node->getAttribute('value') && strpos($node->getAttribute('value'), '<' . '?php') !== false
- ? '[value=PHP]' : '')
- . ($node->getAttribute('selected')
- ? '[selected]' : '')
- . ($node->getAttribute('checked')
- ? '[checked]' : '');
- } else if ($node instanceof DOMTEXT) {
- if (trim($node->textContent))
- $return[] = 'Text:' . substr(str_replace("\n", ' ', $node->textContent), 0, 15);
- } else {
- }
- }
- return $oneNode && isset($return[0])
- ? $return[0]
- : $return;
- }
- /**
- * Dump htmlOuter and preserve chain. Usefull for debugging.
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- *
- */
- public function dump()
- {
- print 'DUMP #' . (phpQuery::$dumpCount++) . ' ';
- $debug = phpQuery::$debug;
- phpQuery::$debug = false;
- // print __FILE__.':'.__LINE__."\n";
- var_dump($this->htmlOuter());
- return $this;
- }
- public function dumpWhois()
- {
- print 'DUMP #' . (phpQuery::$dumpCount++) . ' ';
- $debug = phpQuery::$debug;
- phpQuery::$debug = false;
- // print __FILE__.':'.__LINE__."\n";
- var_dump('whois', $this->whois());
- phpQuery::$debug = $debug;
- return $this;
- }
- public function dumpLength()
- {
- print 'DUMP #' . (phpQuery::$dumpCount++) . ' ';
- $debug = phpQuery::$debug;
- phpQuery::$debug = false;
- // print __FILE__.':'.__LINE__."\n";
- var_dump('length', $this->length());
- phpQuery::$debug = $debug;
- return $this;
- }
- public function dumpTree($html = true, $title = true)
- {
- $output = $title
- ? 'DUMP #' . (phpQuery::$dumpCount++) . " \n" : '';
- $debug = phpQuery::$debug;
- phpQuery::$debug = false;
- foreach ($this->stack() as $node)
- $output .= $this->__dumpTree($node);
- phpQuery::$debug = $debug;
- print $html
- ? nl2br(str_replace(' ', ' ', $output))
- : $output;
- return $this;
- }
- private function __dumpTree($node, $intend = 0)
- {
- $whois = $this->whois($node);
- $return = '';
- if ($whois)
- $return .= str_repeat(' - ', $intend) . $whois . "\n";
- if (isset($node->childNodes))
- foreach ($node->childNodes as $chNode)
- $return .= $this->__dumpTree($chNode, $intend + 1);
- return $return;
- }
- /**
- * Dump htmlOuter and stop script execution. Usefull for debugging.
- *
- */
- public function dumpDie()
- {
- print __FILE__ . ':' . __LINE__;
- var_dump($this->htmlOuter());
- die();
- }
-}
-
-
-// -- Multibyte Compatibility functions ---------------------------------------
-// http://svn.iphonewebdev.com/lace/lib/mb_compat.php
-
-/**
- * mb_internal_encoding()
- *
- * Included for mbstring pseudo-compatability.
- */
-if (!function_exists('mb_internal_encoding')) {
- function mb_internal_encoding($enc)
- {
- return true;
- }
-}
-
-/**
- * mb_regex_encoding()
- *
- * Included for mbstring pseudo-compatability.
- */
-if (!function_exists('mb_regex_encoding')) {
- function mb_regex_encoding($enc)
- {
- return true;
- }
-}
-
-/**
- * mb_strlen()
- *
- * Included for mbstring pseudo-compatability.
- */
-if (!function_exists('mb_strlen')) {
- function mb_strlen($str)
- {
- return strlen($str);
- }
-}
-
-/**
- * mb_strpos()
- *
- * Included for mbstring pseudo-compatability.
- */
-if (!function_exists('mb_strpos')) {
- function mb_strpos($haystack, $needle, $offset = 0)
- {
- return strpos($haystack, $needle, $offset);
- }
-}
-/**
- * mb_stripos()
- *
- * Included for mbstring pseudo-compatability.
- */
-if (!function_exists('mb_stripos')) {
- function mb_stripos($haystack, $needle, $offset = 0)
- {
- return stripos($haystack, $needle, $offset);
- }
-}
-
-/**
- * mb_substr()
- *
- * Included for mbstring pseudo-compatability.
- */
-if (!function_exists('mb_substr')) {
- function mb_substr($str, $start, $length = 0)
- {
- return substr($str, $start, $length);
- }
-}
-
-/**
- * mb_substr_count()
- *
- * Included for mbstring pseudo-compatability.
- */
-if (!function_exists('mb_substr_count')) {
- function mb_substr_count($haystack, $needle)
- {
- return substr_count($haystack, $needle);
- }
-}
-
-
-/**
- * Static namespace for phpQuery functions.
- *
- * @author Tobiasz Cudnik
- * @package phpQuery
- */
-abstract class phpQuery
-{
- /**
- * XXX: Workaround for mbstring problems
- *
- * @var bool
- */
- public static $mbstringSupport = true;
- public static $debug = false;
- public static $documents = array();
- public static $defaultDocumentID = null;
- // public static $defaultDoctype = 'html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"';
- /**
- * Applies only to HTML.
- *
- * @var unknown_type
- */
- public static $defaultDoctype = '';
- public static $defaultCharset = 'UTF-8';
- /**
- * Static namespace for plugins.
- *
- * @var object
- */
- public static $plugins = array();
- /**
- * List of loaded plugins.
- *
- * @var unknown_type
- */
- public static $pluginsLoaded = array();
- public static $pluginsMethods = array();
- public static $pluginsStaticMethods = array();
- public static $extendMethods = array();
- /**
- * @TODO implement
- */
- public static $extendStaticMethods = array();
- /**
- * Hosts allowed for AJAX connections.
- * Dot '.' means $_SERVER['HTTP_HOST'] (if any).
- *
- * @var array
- */
- public static $ajaxAllowedHosts = array(
- '.'
- );
- /**
- * AJAX settings.
- *
- * @var array
- * XXX should it be static or not ?
- */
- public static $ajaxSettings = array(
- 'url' => '', //TODO
- 'global' => true,
- 'type' => "GET",
- 'timeout' => null,
- 'contentType' => "application/x-www-form-urlencoded",
- 'processData' => true,
- // 'async' => true,
- 'data' => null,
- 'username' => null,
- 'password' => null,
- 'accepts' => array(
- 'xml' => "application/xml, text/xml",
- 'html' => "text/html",
- 'script' => "text/javascript, application/javascript",
- 'json' => "application/json, text/javascript",
- 'text' => "text/plain",
- '_default' => "*/*"
- )
- );
- public static $lastModified = null;
- public static $active = 0;
- public static $dumpCount = 0;
- /**
- * Multi-purpose function.
- * Use pq() as shortcut.
- *
- * In below examples, $pq is any result of pq(); function.
- *
- * 1. Import markup into existing document (without any attaching):
- * - Import into selected document:
- * pq('
') // DOESNT accept text nodes at beginning of input string !
- * - Import into document with ID from $pq->getDocumentID():
- * pq('
', $pq->getDocumentID())
- * - Import into same document as DOMNode belongs to:
- * pq('
', DOMNode)
- * - Import into document from phpQuery object:
- * pq('
', $pq)
- *
- * 2. Run query:
- * - Run query on last selected document:
- * pq('div.myClass')
- * - Run query on document with ID from $pq->getDocumentID():
- * pq('div.myClass', $pq->getDocumentID())
- * - Run query on same document as DOMNode belongs to and use node(s)as root for query:
- * pq('div.myClass', DOMNode)
- * - Run query on document from phpQuery object
- * and use object's stack as root node(s) for query:
- * pq('div.myClass', $pq)
- *
- * @param string|DOMNode|DOMNodeList|array $arg1 HTML markup, CSS Selector, DOMNode or array of DOMNodes
- * @param string|phpQueryObject|DOMNode $context DOM ID from $pq->getDocumentID(), phpQuery object (determines also query root) or DOMNode (determines also query root)
- *
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery|false
- * phpQuery object or false in case of error.
- */
- public static function pq($arg1, $context = null)
- {
- if ($arg1 instanceof DOMNODE && !isset($context)) {
- foreach (phpQuery::$documents as $documentWrapper) {
- $compare = $arg1 instanceof DOMDocument
- ? $arg1 : $arg1->ownerDocument;
- if ($documentWrapper->document->isSameNode($compare))
- $context = $documentWrapper->id;
- }
- }
- if (!$context) {
- $domId = self::$defaultDocumentID;
- if (!$domId)
- throw new Exception("Can't use last created DOM, because there isn't any. Use phpQuery::newDocument() first.");
- // } else if (is_object($context) && ($context instanceof PHPQUERY || is_subclass_of($context, 'phpQueryObject')))
- } else if (is_object($context) && $context instanceof phpQueryObject)
- $domId = $context->getDocumentID();
- else if ($context instanceof DOMDOCUMENT) {
- $domId = self::getDocumentID($context);
- if (!$domId) {
- //throw new Exception('Orphaned DOMDocument');
- $domId = self::newDocument($context)->getDocumentID();
- }
- } else if ($context instanceof DOMNODE) {
- $domId = self::getDocumentID($context);
- if (!$domId) {
- throw new Exception('Orphaned DOMNode');
- // $domId = self::newDocument($context->ownerDocument);
- }
- } else
- $domId = $context;
- if ($arg1 instanceof phpQueryObject) {
- // if (is_object($arg1) && (get_class($arg1) == 'phpQueryObject' || $arg1 instanceof PHPQUERY || is_subclass_of($arg1, 'phpQueryObject'))) {
- /**
- * Return $arg1 or import $arg1 stack if document differs:
- * pq(pq('
'))
- */
- if ($arg1->getDocumentID() == $domId)
- return $arg1;
- $class = get_class($arg1);
- // support inheritance by passing old object to overloaded constructor
- $phpQuery = $class != 'phpQuery'
- ? new $class($arg1, $domId)
- : new phpQueryObject($domId);
- $phpQuery->elements = array();
- foreach ($arg1->elements as $node)
- $phpQuery->elements[] = $phpQuery->document->importNode($node, true);
- return $phpQuery;
- } else if ($arg1 instanceof DOMNODE || (is_array($arg1) && isset($arg1[0]) && $arg1[0] instanceof DOMNODE)) {
- /*
- * Wrap DOM nodes with phpQuery object, import into document when needed:
- * pq(array($domNode1, $domNode2))
- */
- $phpQuery = new phpQueryObject($domId);
- if (!($arg1 instanceof DOMNODELIST) && !is_array($arg1))
- $arg1 = array($arg1);
- $phpQuery->elements = array();
- foreach ($arg1 as $node) {
- $sameDocument = $node->ownerDocument instanceof DOMDOCUMENT
- && !$node->ownerDocument->isSameNode($phpQuery->document);
- $phpQuery->elements[] = $sameDocument
- ? $phpQuery->document->importNode($node, true)
- : $node;
- }
- return $phpQuery;
- } else if (self::isMarkup($arg1)) {
- /**
- * Import HTML:
- * pq('
')
- */
- $phpQuery = new phpQueryObject($domId);
- return $phpQuery->newInstance(
- $phpQuery->documentWrapper->import($arg1)
- );
- } else {
- /**
- * Run CSS query:
- * pq('div.myClass')
- */
- $phpQuery = new phpQueryObject($domId);
- // if ($context && ($context instanceof PHPQUERY || is_subclass_of($context, 'phpQueryObject')))
- if ($context && $context instanceof phpQueryObject)
- $phpQuery->elements = $context->elements;
- else if ($context && $context instanceof DOMNODELIST) {
- $phpQuery->elements = array();
- foreach ($context as $node)
- $phpQuery->elements[] = $node;
- } else if ($context && $context instanceof DOMNODE)
- $phpQuery->elements = array($context);
- return $phpQuery->find($arg1);
- }
- }
- /**
- * Sets default document to $id. Document has to be loaded prior
- * to using this method.
- * $id can be retrived via getDocumentID() or getDocumentIDRef().
- *
- * @param unknown_type $id
- */
- public static function selectDocument($id)
- {
- $id = self::getDocumentID($id);
- self::debug("Selecting document '$id' as default one");
- self::$defaultDocumentID = self::getDocumentID($id);
- }
- /**
- * Returns document with id $id or last used as phpQueryObject.
- * $id can be retrived via getDocumentID() or getDocumentIDRef().
- * Chainable.
- *
- * @see phpQuery::selectDocument()
- * @param unknown_type $id
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public static function getDocument($id = null)
- {
- if ($id)
- phpQuery::selectDocument($id);
- else
- $id = phpQuery::$defaultDocumentID;
- return new phpQueryObject($id);
- }
- /**
- * Creates new document from markup.
- * Chainable.
- *
- * @param unknown_type $markup
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public static function newDocument($markup = null, $contentType = null)
- {
- if (!$markup)
- $markup = '';
- $documentID = phpQuery::createDocumentWrapper($markup, $contentType);
- return new phpQueryObject($documentID);
- }
- /**
- * Creates new document from markup.
- * Chainable.
- *
- * @param unknown_type $markup
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public static function newDocumentHTML($markup = null, $charset = null)
- {
- $contentType = $charset
- ? ";charset=$charset"
- : '';
- return self::newDocument($markup, "text/html{$contentType}");
- }
- /**
- * Creates new document from markup.
- * Chainable.
- *
- * @param unknown_type $markup
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public static function newDocumentXML($markup = null, $charset = null)
- {
- $contentType = $charset
- ? ";charset=$charset"
- : '';
- return self::newDocument($markup, "text/xml{$contentType}");
- }
- /**
- * Creates new document from markup.
- * Chainable.
- *
- * @param unknown_type $markup
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public static function newDocumentXHTML($markup = null, $charset = null)
- {
- $contentType = $charset
- ? ";charset=$charset"
- : '';
- return self::newDocument($markup, "application/xhtml+xml{$contentType}");
- }
- /**
- * Creates new document from markup.
- * Chainable.
- *
- * @param unknown_type $markup
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public static function newDocumentPHP($markup = null, $contentType = "text/html")
- {
- // TODO pass charset to phpToMarkup if possible (use DOMDocumentWrapper function)
- $markup = phpQuery::phpToMarkup($markup, self::$defaultCharset);
- return self::newDocument($markup, $contentType);
- }
- public static function phpToMarkup($php, $charset = 'utf-8')
- {
- $regexes = array(
- '@(<(?!\\?)(?:[^>]|\\?>)+\\w+\\s*=\\s*)(\')([^\']*)<' . '?php?(.*?)(?:\\?>)([^\']*)\'@s',
- '@(<(?!\\?)(?:[^>]|\\?>)+\\w+\\s*=\\s*)(")([^"]*)<' . '?php?(.*?)(?:\\?>)([^"]*)"@s',
- );
- foreach ($regexes as $regex)
- while (preg_match($regex, $php, $matches)) {
- $php = preg_replace_callback(
- $regex,
- // create_function('$m, $charset = "'.$charset.'"',
- // 'return $m[1].$m[2]
- // .htmlspecialchars("<"."?php".$m[4]."?".">", ENT_QUOTES|ENT_NOQUOTES, $charset)
- // .$m[5].$m[2];'
- // ),
- array('phpQuery', '_phpToMarkupCallback'),
- $php
- );
- }
- $regex = '@(^|>[^<]*)+?(<\?php(.*?)(\?>))@s';
- //preg_match_all($regex, $php, $matches);
- //var_dump($matches);
- $php = preg_replace($regex, '\\1 ', $php);
- return $php;
- }
- public static function _phpToMarkupCallback($php, $charset = 'utf-8')
- {
- return $m[1] . $m[2]
- . htmlspecialchars("<" . "?php" . $m[4] . "?" . ">", ENT_QUOTES | ENT_NOQUOTES, $charset)
- . $m[5] . $m[2];
- }
- public static function _markupToPHPCallback($m)
- {
- return "<" . "?php " . htmlspecialchars_decode($m[1]) . " ?" . ">";
- }
- /**
- * Converts document markup containing PHP code generated by phpQuery::php()
- * into valid (executable) PHP code syntax.
- *
- * @param string|phpQueryObject $content
- * @return string PHP code.
- */
- public static function markupToPHP($content)
- {
- if ($content instanceof phpQueryObject)
- $content = $content->markupOuter();
- /* ... to */
- $content = preg_replace_callback(
- '@\s*\s* @s',
- // create_function('$m',
- // 'return "<'.'?php ".htmlspecialchars_decode($m[1])." ?'.'>";'
- // ),
- array('phpQuery', '_markupToPHPCallback'),
- $content
- );
- /* extra space added to save highlighters */
- $regexes = array(
- '@(<(?!\\?)(?:[^>]|\\?>)+\\w+\\s*=\\s*)(\')([^\']*)(?:<|%3C)\\?(?:php)?(.*?)(?:\\?(?:>|%3E))([^\']*)\'@s',
- '@(<(?!\\?)(?:[^>]|\\?>)+\\w+\\s*=\\s*)(")([^"]*)(?:<|%3C)\\?(?:php)?(.*?)(?:\\?(?:>|%3E))([^"]*)"@s',
- );
- foreach ($regexes as $regex)
- while (preg_match($regex, $content))
- $content = preg_replace_callback(
- $regex,
- function ($m) {
- return $m[1] . $m[2] . $m[3] . "", " ", "\n", " ", "{", "$", "}", '"', "[", "]"),
- htmlspecialchars_decode($m[4])
- )
- . " ?>" . $m[5] . $m[2];
- },
- $content
- );
- return $content;
- }
- /**
- * Creates new document from file $file.
- * Chainable.
- *
- * @param string $file URLs allowed. See File wrapper page at php.net for more supported sources.
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public static function newDocumentFile($file, $contentType = null)
- {
- $documentID = self::createDocumentWrapper(
- file_get_contents($file),
- $contentType
- );
- return new phpQueryObject($documentID);
- }
- /**
- * Creates new document from markup.
- * Chainable.
- *
- * @param unknown_type $markup
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public static function newDocumentFileHTML($file, $charset = null)
- {
- $contentType = $charset
- ? ";charset=$charset"
- : '';
- return self::newDocumentFile($file, "text/html{$contentType}");
- }
- /**
- * Creates new document from markup.
- * Chainable.
- *
- * @param unknown_type $markup
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public static function newDocumentFileXML($file, $charset = null)
- {
- $contentType = $charset
- ? ";charset=$charset"
- : '';
- return self::newDocumentFile($file, "text/xml{$contentType}");
- }
- /**
- * Creates new document from markup.
- * Chainable.
- *
- * @param unknown_type $markup
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public static function newDocumentFileXHTML($file, $charset = null)
- {
- $contentType = $charset
- ? ";charset=$charset"
- : '';
- return self::newDocumentFile($file, "application/xhtml+xml{$contentType}");
- }
- /**
- * Creates new document from markup.
- * Chainable.
- *
- * @param unknown_type $markup
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- */
- public static function newDocumentFilePHP($file, $contentType = null)
- {
- return self::newDocumentPHP(file_get_contents($file), $contentType);
- }
- /**
- * Reuses existing DOMDocument object.
- * Chainable.
- *
- * @param $document DOMDocument
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @TODO support DOMDocument
- */
- public static function loadDocument($document)
- {
- // TODO
- die('TODO loadDocument');
- }
- /**
- * Enter description here...
- *
- * @param unknown_type $html
- * @param unknown_type $domId
- * @return unknown New DOM ID
- * @todo support PHP tags in input
- * @todo support passing DOMDocument object from self::loadDocument
- */
- protected static function createDocumentWrapper($html, $contentType = null, $documentID = null)
- {
- if (function_exists('domxml_open_mem'))
- throw new Exception("Old PHP4 DOM XML extension detected. phpQuery won't work until this extension is enabled.");
- // $id = $documentID
- // ? $documentID
- // : md5(microtime());
- $document = null;
- if ($html instanceof DOMDOCUMENT) {
- if (self::getDocumentID($html)) {
- // document already exists in phpQuery::$documents, make a copy
- $document = clone $html;
- } else {
- // new document, add it to phpQuery::$documents
- $wrapper = new DOMDocumentWrapper($html, $contentType, $documentID);
- }
- } else {
- $wrapper = new DOMDocumentWrapper($html, $contentType, $documentID);
- }
- // $wrapper->id = $id;
- // bind document
- phpQuery::$documents[$wrapper->id] = $wrapper;
- // remember last loaded document
- phpQuery::selectDocument($wrapper->id);
- return $wrapper->id;
- }
- /**
- * Extend class namespace.
- *
- * @param string|array $target
- * @param array $source
- * @TODO support string $source
- * @return unknown_type
- */
- public static function extend($target, $source)
- {
- switch ($target) {
- case 'phpQueryObject':
- $targetRef = &self::$extendMethods;
- $targetRef2 = &self::$pluginsMethods;
- break;
- case 'phpQuery':
- $targetRef = &self::$extendStaticMethods;
- $targetRef2 = &self::$pluginsStaticMethods;
- break;
- default:
- throw new Exception("Unsupported \$target type");
- }
- if (is_string($source))
- $source = array($source => $source);
- foreach ($source as $method => $callback) {
- if (isset($targetRef[$method])) {
- // throw new Exception
- self::debug("Duplicate method '{$method}', can\'t extend '{$target}'");
- continue;
- }
- if (isset($targetRef2[$method])) {
- // throw new Exception
- self::debug("Duplicate method '{$method}' from plugin '{$targetRef2[$method]}',"
- . " can\'t extend '{$target}'");
- continue;
- }
- $targetRef[$method] = $callback;
- }
- return true;
- }
- /**
- * Extend phpQuery with $class from $file.
- *
- * @param string $class Extending class name. Real class name can be prepended phpQuery_.
- * @param string $file Filename to include. Defaults to "{$class}.php".
- */
- public static function plugin($class, $file = null)
- {
- // TODO $class checked agains phpQuery_$class
- // if (strpos($class, 'phpQuery') === 0)
- // $class = substr($class, 8);
- if (in_array($class, self::$pluginsLoaded))
- return true;
- if (!$file)
- $file = $class . '.php';
- $objectClassExists = class_exists('phpQueryObjectPlugin_' . $class);
- $staticClassExists = class_exists('phpQueryPlugin_' . $class);
- if (!$objectClassExists && !$staticClassExists)
- require_once($file);
- self::$pluginsLoaded[] = $class;
- // static methods
- if (class_exists('phpQueryPlugin_' . $class)) {
- $realClass = 'phpQueryPlugin_' . $class;
- $vars = get_class_vars($realClass);
- $loop = isset($vars['phpQueryMethods'])
- && !is_null($vars['phpQueryMethods'])
- ? $vars['phpQueryMethods']
- : get_class_methods($realClass);
- foreach ($loop as $method) {
- if ($method == '__initialize')
- continue;
- if (!is_callable(array($realClass, $method)))
- continue;
- if (isset(self::$pluginsStaticMethods[$method])) {
- throw new Exception("Duplicate method '{$method}' from plugin '{$c}' conflicts with same method from plugin '" . self::$pluginsStaticMethods[$method] . "'");
- return;
- }
- self::$pluginsStaticMethods[$method] = $class;
- }
- if (method_exists($realClass, '__initialize'))
- call_user_func_array(array($realClass, '__initialize'), array());
- }
- // object methods
- if (class_exists('phpQueryObjectPlugin_' . $class)) {
- $realClass = 'phpQueryObjectPlugin_' . $class;
- $vars = get_class_vars($realClass);
- $loop = isset($vars['phpQueryMethods'])
- && !is_null($vars['phpQueryMethods'])
- ? $vars['phpQueryMethods']
- : get_class_methods($realClass);
- foreach ($loop as $method) {
- if (!is_callable(array($realClass, $method)))
- continue;
- if (isset(self::$pluginsMethods[$method])) {
- throw new Exception("Duplicate method '{$method}' from plugin '{$c}' conflicts with same method from plugin '" . self::$pluginsMethods[$method] . "'");
- continue;
- }
- self::$pluginsMethods[$method] = $class;
- }
- }
- return true;
- }
- /**
- * Unloades all or specified document from memory.
- *
- * @param mixed $documentID @see phpQuery::getDocumentID() for supported types.
- */
- public static function unloadDocuments($id = null)
- {
- if (isset($id)) {
- if ($id = self::getDocumentID($id))
- unset(phpQuery::$documents[$id]);
- } else {
- foreach (phpQuery::$documents as $k => $v) {
- unset(phpQuery::$documents[$k]);
- }
- }
- }
- /**
- * Parses phpQuery object or HTML result against PHP tags and makes them active.
- *
- * @param phpQuery|string $content
- * @deprecated
- * @return string
- */
- public static function unsafePHPTags($content)
- {
- return self::markupToPHP($content);
- }
- public static function DOMNodeListToArray($DOMNodeList)
- {
- $array = array();
- if (!$DOMNodeList)
- return $array;
- foreach ($DOMNodeList as $node)
- $array[] = $node;
- return $array;
- }
- /**
- * Checks if $input is HTML string, which has to start with '<'.
- *
- * @deprecated
- * @param String $input
- * @return Bool
- * @todo still used ?
- */
- public static function isMarkup($input)
- {
- return !is_array($input) && substr(trim($input), 0, 1) == '<';
- }
- public static function debug($text)
- {
- if (self::$debug)
- print var_dump($text);
- }
- /**
- * Make an AJAX request.
- *
- * @param array See $options http://docs.jquery.com/Ajax/jQuery.ajax#toptions
- * Additional options are:
- * 'document' - document for global events, @see phpQuery::getDocumentID()
- * 'referer' - implemented
- * 'requested_with' - TODO; not implemented (X-Requested-With)
- * @return Zend_Http_Client
- * @link http://docs.jquery.com/Ajax/jQuery.ajax
- *
- * @TODO $options['cache']
- * @TODO $options['processData']
- * @TODO $options['xhr']
- * @TODO $options['data'] as string
- * @TODO XHR interface
- */
- public static function ajax($options = array(), $xhr = null)
- {
- $options = array_merge(
- self::$ajaxSettings,
- $options
- );
- $documentID = isset($options['document'])
- ? self::getDocumentID($options['document'])
- : null;
- if ($xhr) {
- // reuse existing XHR object, but clean it up
- $client = $xhr;
- // $client->setParameterPost(null);
- // $client->setParameterGet(null);
- $client->setAuth(false);
- $client->setHeaders("If-Modified-Since", null);
- $client->setHeaders("Referer", null);
- $client->resetParameters();
- } else {
- // create new XHR object
- require_once('Zend/Http/Client.php');
- $client = new Zend_Http_Client();
- $client->setCookieJar();
- }
- if (isset($options['timeout']))
- $client->setConfig(array(
- 'timeout' => $options['timeout'],
- ));
- // 'maxredirects' => 0,
- foreach (self::$ajaxAllowedHosts as $k => $host)
- if ($host == '.' && isset($_SERVER['HTTP_HOST']))
- self::$ajaxAllowedHosts[$k] = $_SERVER['HTTP_HOST'];
- $host = parse_url($options['url'], PHP_URL_HOST);
- if (!in_array($host, self::$ajaxAllowedHosts)) {
- throw new Exception("Request not permitted, host '$host' not present in "
- . "phpQuery::\$ajaxAllowedHosts");
- }
- // JSONP
- $jsre = "/=\\?(&|$)/";
- if (isset($options['dataType']) && $options['dataType'] == 'jsonp') {
- $jsonpCallbackParam = $options['jsonp']
- ? $options['jsonp'] : 'callback';
- if (strtolower($options['type']) == 'get') {
- if (!preg_match($jsre, $options['url'])) {
- $sep = strpos($options['url'], '?')
- ? '&' : '?';
- $options['url'] .= "$sep$jsonpCallbackParam=?";
- }
- } else if ($options['data']) {
- $jsonp = false;
- foreach ($options['data'] as $n => $v) {
- if ($v == '?')
- $jsonp = true;
- }
- if (!$jsonp) {
- $options['data'][$jsonpCallbackParam] = '?';
- }
- }
- $options['dataType'] = 'json';
- }
- if (isset($options['dataType']) && $options['dataType'] == 'json') {
- $jsonpCallback = 'json_' . md5(microtime());
- $jsonpData = $jsonpUrl = false;
- if ($options['data']) {
- foreach ($options['data'] as $n => $v) {
- if ($v == '?')
- $jsonpData = $n;
- }
- }
- if (preg_match($jsre, $options['url']))
- $jsonpUrl = true;
- if ($jsonpData !== false || $jsonpUrl) {
- // remember callback name for httpData()
- $options['_jsonp'] = $jsonpCallback;
- if ($jsonpData !== false)
- $options['data'][$jsonpData] = $jsonpCallback;
- if ($jsonpUrl)
- $options['url'] = preg_replace($jsre, "=$jsonpCallback\\1", $options['url']);
- }
- }
- $client->setUri($options['url']);
- $client->setMethod(strtoupper($options['type']));
- if (isset($options['referer']) && $options['referer'])
- $client->setHeaders('Referer', $options['referer']);
- $client->setHeaders(array(
- // 'content-type' => $options['contentType'],
- 'User-Agent' => 'Mozilla/5.0 (X11; U; Linux x86; en-US; rv:1.9.0.5) Gecko'
- . '/2008122010 Firefox/3.0.5',
- // TODO custom charset
- 'Accept-Charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
- // 'Connection' => 'keep-alive',
- // 'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'Accept-Language' => 'en-us,en;q=0.5',
- ));
- if ($options['username'])
- $client->setAuth($options['username'], $options['password']);
- if (isset($options['ifModified']) && $options['ifModified'])
- $client->setHeaders(
- "If-Modified-Since",
- self::$lastModified
- ? self::$lastModified
- : "Thu, 01 Jan 1970 00:00:00 GMT"
- );
- $client->setHeaders(
- "Accept",
- isset($options['dataType'])
- && isset(self::$ajaxSettings['accepts'][$options['dataType']])
- ? self::$ajaxSettings['accepts'][$options['dataType']] . ", */*"
- : self::$ajaxSettings['accepts']['_default']
- );
- // TODO $options['processData']
- if ($options['data'] instanceof phpQueryObject) {
- $serialized = $options['data']->serializeArray($options['data']);
- $options['data'] = array();
- foreach ($serialized as $r)
- $options['data'][$r['name']] = $r['value'];
- }
- if (strtolower($options['type']) == 'get') {
- $client->setParameterGet($options['data']);
- } else if (strtolower($options['type']) == 'post') {
- $client->setEncType($options['contentType']);
- $client->setParameterPost($options['data']);
- }
- if (self::$active == 0 && $options['global'])
- phpQueryEvents::trigger($documentID, 'ajaxStart');
- self::$active++;
- // beforeSend callback
- if (isset($options['beforeSend']) && $options['beforeSend'])
- phpQuery::callbackRun($options['beforeSend'], array($client));
- // ajaxSend event
- if ($options['global'])
- phpQueryEvents::trigger($documentID, 'ajaxSend', array($client, $options));
- if (phpQuery::$debug) {
- self::debug("{$options['type']}: {$options['url']}\n");
- self::debug("Options: " . var_export($options, true) . " \n");
- // if ($client->getCookieJar())
- // self::debug("Cookies: ".var_export($client->getCookieJar()->getMatchingCookies($options['url']), true)." \n");
- }
- // request
- $response = $client->request();
- if (phpQuery::$debug) {
- self::debug('Status: ' . $response->getStatus() . ' / ' . $response->getMessage());
- self::debug($client->getLastRequest());
- self::debug($response->getHeaders());
- }
- if ($response->isSuccessful()) {
- // XXX tempolary
- self::$lastModified = $response->getHeader('Last-Modified');
- $data = self::httpData($response->getBody(), $options['dataType'], $options);
- if (isset($options['success']) && $options['success'])
- phpQuery::callbackRun($options['success'], array($data, $response->getStatus(), $options));
- if ($options['global'])
- phpQueryEvents::trigger($documentID, 'ajaxSuccess', array($client, $options));
- } else {
- if (isset($options['error']) && $options['error'])
- phpQuery::callbackRun($options['error'], array($client, $response->getStatus(), $response->getMessage()));
- if ($options['global'])
- phpQueryEvents::trigger($documentID, 'ajaxError', array($client, /*$response->getStatus(),*/ $response->getMessage(), $options));
- }
- if (isset($options['complete']) && $options['complete'])
- phpQuery::callbackRun($options['complete'], array($client, $response->getStatus()));
- if ($options['global'])
- phpQueryEvents::trigger($documentID, 'ajaxComplete', array($client, $options));
- if ($options['global'] && !--self::$active)
- phpQueryEvents::trigger($documentID, 'ajaxStop');
- return $client;
- // if (is_null($domId))
- // $domId = self::$defaultDocumentID ? self::$defaultDocumentID : false;
- // return new phpQueryAjaxResponse($response, $domId);
- }
- protected static function httpData($data, $type, $options)
- {
- if (isset($options['dataFilter']) && $options['dataFilter'])
- $data = self::callbackRun($options['dataFilter'], array($data, $type));
- if (is_string($data)) {
- if ($type == "json") {
- if (isset($options['_jsonp']) && $options['_jsonp']) {
- $data = preg_replace('/^\s*\w+\((.*)\)\s*$/s', '$1', $data);
- }
- $data = self::parseJSON($data);
- }
- }
- return $data;
- }
- /**
- * Enter description here...
- *
- * @param array|phpQuery $data
- *
- */
- public static function param($data)
- {
- return http_build_query($data, null, '&');
- }
- public static function get($url, $data = null, $callback = null, $type = null)
- {
- if (!is_array($data)) {
- $callback = $data;
- $data = null;
- }
- // TODO some array_values on this shit
- return phpQuery::ajax(array(
- 'type' => 'GET',
- 'url' => $url,
- 'data' => $data,
- 'success' => $callback,
- 'dataType' => $type,
- ));
- }
- public static function post($url, $data = null, $callback = null, $type = null)
- {
- if (!is_array($data)) {
- $callback = $data;
- $data = null;
- }
- return phpQuery::ajax(array(
- 'type' => 'POST',
- 'url' => $url,
- 'data' => $data,
- 'success' => $callback,
- 'dataType' => $type,
- ));
- }
- public static function getJSON($url, $data = null, $callback = null)
- {
- if (!is_array($data)) {
- $callback = $data;
- $data = null;
- }
- // TODO some array_values on this shit
- return phpQuery::ajax(array(
- 'type' => 'GET',
- 'url' => $url,
- 'data' => $data,
- 'success' => $callback,
- 'dataType' => 'json',
- ));
- }
- public static function ajaxSetup($options)
- {
- self::$ajaxSettings = array_merge(
- self::$ajaxSettings,
- $options
- );
- }
- public static function ajaxAllowHost($host1, $host2 = null, $host3 = null)
- {
- $loop = is_array($host1)
- ? $host1
- : func_get_args();
- foreach ($loop as $host) {
- if ($host && !in_array($host, phpQuery::$ajaxAllowedHosts)) {
- phpQuery::$ajaxAllowedHosts[] = $host;
- }
- }
- }
- public static function ajaxAllowURL($url1, $url2 = null, $url3 = null)
- {
- $loop = is_array($url1)
- ? $url1
- : func_get_args();
- foreach ($loop as $url)
- phpQuery::ajaxAllowHost(parse_url($url, PHP_URL_HOST));
- }
- /**
- * Returns JSON representation of $data.
- *
- * @static
- * @param mixed $data
- * @return string
- */
- public static function toJSON($data)
- {
- if (function_exists('json_encode'))
- return json_encode($data);
- require_once('Zend/Json/Encoder.php');
- return Zend_Json_Encoder::encode($data);
- }
- /**
- * Parses JSON into proper PHP type.
- *
- * @static
- * @param string $json
- * @return mixed
- */
- public static function parseJSON($json)
- {
- if (function_exists('json_decode')) {
- $return = json_decode(trim($json), true);
- // json_decode and UTF8 issues
- if (isset($return))
- return $return;
- }
- require_once('Zend/Json/Decoder.php');
- return Zend_Json_Decoder::decode($json);
- }
- /**
- * Returns source's document ID.
- *
- * @param $source DOMNode|phpQueryObject
- * @return string
- */
- public static function getDocumentID($source)
- {
- if ($source instanceof DOMDOCUMENT) {
- foreach (phpQuery::$documents as $id => $document) {
- if ($source->isSameNode($document->document))
- return $id;
- }
- } else if ($source instanceof DOMNODE) {
- foreach (phpQuery::$documents as $id => $document) {
- if ($source->ownerDocument->isSameNode($document->document))
- return $id;
- }
- } else if ($source instanceof phpQueryObject)
- return $source->getDocumentID();
- else if (is_string($source) && isset(phpQuery::$documents[$source]))
- return $source;
- }
- /**
- * Get DOMDocument object related to $source.
- * Returns null if such document doesn't exist.
- *
- * @param $source DOMNode|phpQueryObject|string
- * @return string
- */
- public static function getDOMDocument($source)
- {
- if ($source instanceof DOMDOCUMENT)
- return $source;
- $source = self::getDocumentID($source);
- return $source
- ? self::$documents[$id]['document']
- : null;
- }
-
- // UTILITIES
- // http://docs.jquery.com/Utilities
-
- /**
- *
- * @return unknown_type
- * @link http://docs.jquery.com/Utilities/jQuery.makeArray
- */
- public static function makeArray($obj)
- {
- $array = array();
- if (is_object($object) && $object instanceof DOMNODELIST) {
- foreach ($object as $value)
- $array[] = $value;
- } else if (is_object($object) && !($object instanceof Iterator)) {
- foreach (get_object_vars($object) as $name => $value)
- $array[0][$name] = $value;
- } else {
- foreach ($object as $name => $value)
- $array[0][$name] = $value;
- }
- return $array;
- }
- public static function inArray($value, $array)
- {
- return in_array($value, $array);
- }
- /**
- *
- * @param $object
- * @param $callback
- * @return unknown_type
- * @link http://docs.jquery.com/Utilities/jQuery.each
- */
- public static function each($object, $callback, $param1 = null, $param2 = null, $param3 = null)
- {
- $paramStructure = null;
- if (func_num_args() > 2) {
- $paramStructure = func_get_args();
- $paramStructure = array_slice($paramStructure, 2);
- }
- if (is_object($object) && !($object instanceof Iterator)) {
- foreach (get_object_vars($object) as $name => $value)
- phpQuery::callbackRun($callback, array($name, $value), $paramStructure);
- } else {
- foreach ($object as $name => $value)
- phpQuery::callbackRun($callback, array($name, $value), $paramStructure);
- }
- }
- /**
- *
- * @link http://docs.jquery.com/Utilities/jQuery.map
- */
- public static function map($array, $callback, $param1 = null, $param2 = null, $param3 = null)
- {
- $result = array();
- $paramStructure = null;
- if (func_num_args() > 2) {
- $paramStructure = func_get_args();
- $paramStructure = array_slice($paramStructure, 2);
- }
- foreach ($array as $v) {
- $vv = phpQuery::callbackRun($callback, array($v), $paramStructure);
- // $callbackArgs = $args;
- // foreach($args as $i => $arg) {
- // $callbackArgs[$i] = $arg instanceof CallbackParam
- // ? $v
- // : $arg;
- // }
- // $vv = call_user_func_array($callback, $callbackArgs);
- if (is_array($vv)) {
- foreach ($vv as $vvv)
- $result[] = $vvv;
- } else if ($vv !== null) {
- $result[] = $vv;
- }
- }
- return $result;
- }
- /**
- *
- * @param $callback Callback
- * @param $params
- * @param $paramStructure
- * @return unknown_type
- */
- public static function callbackRun($callback, $params = array(), $paramStructure = null)
- {
- if (!$callback)
- return;
- if ($callback instanceof CallbackParameterToReference) {
- // TODO support ParamStructure to select which $param push to reference
- if (isset($params[0]))
- $callback->callback = $params[0];
- return true;
- }
- if ($callback instanceof Callback) {
- $paramStructure = $callback->params;
- $callback = $callback->callback;
- }
- if (!$paramStructure)
- return call_user_func_array($callback, $params);
- $p = 0;
- foreach ($paramStructure as $i => $v) {
- $paramStructure[$i] = $v instanceof CallbackParam
- ? $params[$p++]
- : $v;
- }
- return call_user_func_array($callback, $paramStructure);
- }
- /**
- * Merge 2 phpQuery objects.
- * @param array $one
- * @param array $two
- * @protected
- * @todo node lists, phpQueryObject
- */
- public static function merge($one, $two)
- {
- $elements = $one->elements;
- foreach ($two->elements as $node) {
- $exists = false;
- foreach ($elements as $node2) {
- if ($node2->isSameNode($node))
- $exists = true;
- }
- if (!$exists)
- $elements[] = $node;
- }
- return $elements;
- // $one = $one->newInstance();
- // $one->elements = $elements;
- // return $one;
- }
- /**
- *
- * @param $array
- * @param $callback
- * @param $invert
- * @return unknown_type
- * @link http://docs.jquery.com/Utilities/jQuery.grep
- */
- public static function grep($array, $callback, $invert = false)
- {
- $result = array();
- foreach ($array as $k => $v) {
- $r = call_user_func_array($callback, array($v, $k));
- if ($r === !(bool)$invert)
- $result[] = $v;
- }
- return $result;
- }
- public static function unique($array)
- {
- return array_unique($array);
- }
- /**
- *
- * @param $function
- * @return unknown_type
- * @TODO there are problems with non-static methods, second parameter pass it
- * but doesnt verify is method is really callable
- */
- public static function isFunction($function)
- {
- return is_callable($function);
- }
- public static function trim($str)
- {
- return trim($str);
- }
- /* PLUGINS NAMESPACE */
- /**
- *
- * @param $url
- * @param $callback
- * @param $param1
- * @param $param2
- * @param $param3
- * @return phpQueryObject
- */
- public static function browserGet($url, $callback, $param1 = null, $param2 = null, $param3 = null)
- {
- if (self::plugin('WebBrowser')) {
- $params = func_get_args();
- return self::callbackRun(array(self::$plugins, 'browserGet'), $params);
- } else {
- self::debug('WebBrowser plugin not available...');
- }
- }
- /**
- *
- * @param $url
- * @param $data
- * @param $callback
- * @param $param1
- * @param $param2
- * @param $param3
- * @return phpQueryObject
- */
- public static function browserPost($url, $data, $callback, $param1 = null, $param2 = null, $param3 = null)
- {
- if (self::plugin('WebBrowser')) {
- $params = func_get_args();
- return self::callbackRun(array(self::$plugins, 'browserPost'), $params);
- } else {
- self::debug('WebBrowser plugin not available...');
- }
- }
- /**
- *
- * @param $ajaxSettings
- * @param $callback
- * @param $param1
- * @param $param2
- * @param $param3
- * @return phpQueryObject
- */
- public static function browser($ajaxSettings, $callback, $param1 = null, $param2 = null, $param3 = null)
- {
- if (self::plugin('WebBrowser')) {
- $params = func_get_args();
- return self::callbackRun(array(self::$plugins, 'browser'), $params);
- } else {
- self::debug('WebBrowser plugin not available...');
- }
- }
- /**
- *
- * @param $code
- * @return string
- */
- public static function php($code)
- {
- return self::code('php', $code);
- }
- /**
- *
- * @param $type
- * @param $code
- * @return string
- */
- public static function code($type, $code)
- {
- return "<$type>$type>";
- }
-
- public static function __callStatic($method, $params)
- {
- return call_user_func_array(
- array(phpQuery::$plugins, $method),
- $params
- );
- }
- protected static function dataSetupNode($node, $documentID)
- {
- // search are return if alredy exists
- foreach (phpQuery::$documents[$documentID]->dataNodes as $dataNode) {
- if ($node->isSameNode($dataNode))
- return $dataNode;
- }
- // if doesn't, add it
- phpQuery::$documents[$documentID]->dataNodes[] = $node;
- return $node;
- }
- protected static function dataRemoveNode($node, $documentID)
- {
- // search are return if alredy exists
- foreach (phpQuery::$documents[$documentID]->dataNodes as $k => $dataNode) {
- if ($node->isSameNode($dataNode)) {
- unset(self::$documents[$documentID]->dataNodes[$k]);
- unset(self::$documents[$documentID]->data[$dataNode->dataID]);
- }
- }
- }
- public static function data($node, $name, $data, $documentID = null)
- {
- if (!$documentID)
- // TODO check if this works
- $documentID = self::getDocumentID($node);
- $document = phpQuery::$documents[$documentID];
- $node = self::dataSetupNode($node, $documentID);
- if (!isset($node->dataID))
- $node->dataID = ++phpQuery::$documents[$documentID]->uuid;
- $id = $node->dataID;
- if (!isset($document->data[$id]))
- $document->data[$id] = array();
- if (!is_null($data))
- $document->data[$id][$name] = $data;
- if ($name) {
- if (isset($document->data[$id][$name]))
- return $document->data[$id][$name];
- } else
- return $id;
- }
- public static function removeData($node, $name, $documentID)
- {
- if (!$documentID)
- // TODO check if this works
- $documentID = self::getDocumentID($node);
- $document = phpQuery::$documents[$documentID];
- $node = self::dataSetupNode($node, $documentID);
- $id = $node->dataID;
- if ($name) {
- if (isset($document->data[$id][$name]))
- unset($document->data[$id][$name]);
- $name = null;
- foreach ($document->data[$id] as $name)
- break;
- if (!$name)
- self::removeData($node, $name, $documentID);
- } else {
- self::dataRemoveNode($node, $documentID);
- }
- }
-}
-/**
- * Plugins static namespace class.
- *
- * @author Tobiasz Cudnik
- * @package phpQuery
- * @todo move plugin methods here (as statics)
- */
-class phpQueryPlugins
-{
- public function __call($method, $args)
- {
- if (isset(phpQuery::$extendStaticMethods[$method])) {
- $return = call_user_func_array(
- phpQuery::$extendStaticMethods[$method],
- $args
- );
- } else if (isset(phpQuery::$pluginsStaticMethods[$method])) {
- $class = phpQuery::$pluginsStaticMethods[$method];
- $realClass = "phpQueryPlugin_$class";
- $return = call_user_func_array(
- array($realClass, $method),
- $args
- );
- return isset($return)
- ? $return
- : $this;
- } else
- throw new Exception("Method '{$method}' doesnt exist");
- }
-}
-/**
- * Shortcut to phpQuery::pq($arg1, $context)
- * Chainable.
- *
- * @see phpQuery::pq()
- * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
- * @author Tobiasz Cudnik
- * @package phpQuery
- */
-function pq($arg1, $context = null)
-{
- $args = func_get_args();
- return call_user_func_array(
- array('phpQuery', 'pq'),
- $args
- );
-}
-// add plugins dir and Zend framework to include path
-set_include_path(
- get_include_path()
- . PATH_SEPARATOR . dirname(__FILE__) . '/phpQuery/'
- . PATH_SEPARATOR . dirname(__FILE__) . '/phpQuery/plugins/'
-);
-// why ? no __call nor __get for statics in php...
-// XXX __callStatic will be available in PHP 5.3
-phpQuery::$plugins = new phpQueryPlugins();
-// include bootstrap file (personal library config)
-if (file_exists(dirname(__FILE__) . '/phpQuery/bootstrap.php'))
- require_once dirname(__FILE__) . '/phpQuery/bootstrap.php';
diff --git a/vendor/jaeger/querylist/.github/FUNDING.yml b/vendor/jaeger/querylist/.github/FUNDING.yml
deleted file mode 100644
index c53fd16..0000000
--- a/vendor/jaeger/querylist/.github/FUNDING.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-# These are supported funding model platforms
-
-github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
-patreon: # Replace with a single Patreon username
-open_collective: querylist # Replace with a single Open Collective username
-ko_fi: # Replace with a single Ko-fi username
-tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
-community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
-liberapay: # Replace with a single Liberapay username
-issuehunt: # Replace with a single IssueHunt username
-otechie: # Replace with a single Otechie username
-custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/vendor/jaeger/querylist/.gitignore b/vendor/jaeger/querylist/.gitignore
deleted file mode 100644
index e2ee195..0000000
--- a/vendor/jaeger/querylist/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-/vendor/
-.idea/
-composer.lock
-.DS_Store
-*.cache
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/README-ZH.md b/vendor/jaeger/querylist/README-ZH.md
deleted file mode 100644
index ec34971..0000000
--- a/vendor/jaeger/querylist/README-ZH.md
+++ /dev/null
@@ -1,309 +0,0 @@
-
-
-
-
-
-
-# QueryList 简介
-`QueryList`是一套简洁、优雅、可扩展的PHP采集工具(爬虫),基于phpQuery。
-
-## 特性
-- 拥有与jQuery完全相同的CSS3 DOM选择器
-- 拥有与jQuery完全相同的DOM操作API
-- 拥有通用的列表采集方案
-- 拥有强大的HTTP请求套件,轻松实现如:模拟登陆、伪造浏览器、HTTP代理等意复杂的网络请求
-- 拥有乱码解决方案
-- 拥有强大的内容过滤功能,可使用jQuey选择器来过滤内容
-- 拥有高度的模块化设计,扩展性强
-- 拥有富有表现力的API
-- 拥有高质量文档
-- 拥有丰富的插件
-- 拥有专业的问答社区和交流群
-
-通过插件可以轻松实现诸如:
-- 多线程采集
-- 采集JavaScript动态渲染的页面 (PhantomJS/headless WebKit)
-- 图片本地化
-- 模拟浏览器行为,如:提交Form表单
-- 网络爬虫
-- .....
-
-## 环境要求
-- PHP >= 7.1
-
-> 如果你的PHP版本还停留在PHP5,或者不会使用Composer,你可以选择使用QueryList3,QueryList3支持php5.3以及手动安装。
-QueryList3 文档:http://v3.querylist.cc
-
-## 安装
-通过Composer安装:
-```
-composer require jaeger/querylist
-```
-
-## 使用
-
-#### 元素操作
-- 采集「昵图网」所有图片地址
-
-```php
-QueryList::get('http://www.nipic.com')->find('img')->attrs('src');
-```
-- 采集百度搜索结果
-
-```php
-$ql = QueryList::get('http://www.baidu.com/s?wd=QueryList');
-
-$ql->find('title')->text(); // 获取网站标题
-$ql->find('meta[name=keywords]')->content; // 获取网站头部关键词
-
-$ql->find('h3>a')->texts(); //获取搜索结果标题列表
-$ql->find('h3>a')->attrs('href'); //获取搜索结果链接列表
-
-$ql->find('img')->src; //获取第一张图片的链接地址
-$ql->find('img:eq(1)')->src; //获取第二张图片的链接地址
-$ql->find('img')->eq(2)->src; //获取第三张图片的链接地址
-// 遍历所有图片
-$ql->find('img')->map(function($img){
- echo $img->alt; //打印图片的alt属性
-});
-```
-- 更多用法
-
-```php
-$ql->find('#head')->append('追加内容
')->find('div')->htmls();
-$ql->find('.two')->children('img')->attrs('alt'); //获取class为two元素下的所有img孩子节点
-//遍历class为two元素下的所有孩子节点
-$data = $ql->find('.two')->children()->map(function ($item){
- //用is判断节点类型
- if($item->is('a')){
- return $item->text();
- }elseif($item->is('img'))
- {
- return $item->alt;
- }
-});
-
-$ql->find('a')->attr('href', 'newVal')->removeClass('className')->html('newHtml')->...
-$ql->find('div > p')->add('div > ul')->filter(':has(a)')->find('p:first')->nextAll()->andSelf()->...
-$ql->find('div.old')->replaceWith( $ql->find('div.new')->clone())->appendTo('.trash')->prepend('Deleted')->...
-```
-#### 列表采集
-采集百度搜索结果列表的标题和链接:
-```php
-$data = QueryList::get('http://www.baidu.com/s?wd=QueryList')
- // 设置采集规则
- ->rules([
- 'title'=>array('h3','text'),
- 'link'=>array('h3>a','href')
- ])
- ->query()->getData();
-
-print_r($data->all());
-```
-采集结果:
-```
-Array
-(
- [0] => Array
- (
- [title] => QueryList|基于phpQuery的无比强大的PHP采集工具
- [link] => http://www.baidu.com/link?url=GU_YbDT2IHk4ns1tjG2I8_vjmH0SCJEAPuuZN
- )
- [1] => Array
- (
- [title] => PHP 用QueryList抓取网页内容 - wb145230 - 博客园
- [link] => http://www.baidu.com/link?url=zn0DXBnrvIF2ibRVW34KcRVFG1_bCdZvqvwIhUqiXaS
- )
- [2] => Array
- (
- [title] => 介绍- QueryList指导文档
- [link] => http://www.baidu.com/link?url=pSypvMovqS4v2sWeQo5fDBJ4EoYhXYi0Lxx
- )
- //...
-)
-```
-#### 编码转换
-```php
-// 输出编码:UTF-8,输入编码:GB2312
-QueryList::get('https://top.etao.com')->encoding('UTF-8','GB2312')->find('a')->texts();
-
-// 输出编码:UTF-8,输入编码:自动识别
-QueryList::get('https://top.etao.com')->encoding('UTF-8')->find('a')->texts();
-```
-
-#### HTTP网络操作(GuzzleHttp)
-- 携带cookie登录新浪微博
-```php
-//采集新浪微博需要登录才能访问的页面
-$ql = QueryList::get('http://weibo.com','param1=testvalue & params2=somevalue',[
- 'headers' => [
- //填写从浏览器获取到的cookie
- 'Cookie' => 'SINAGLOBAL=546064; wb_cmtLike_2112031=1; wvr=6;....'
- ]
-]);
-//echo $ql->getHtml();
-echo $ql->find('title')->text();
-//输出: 我的首页 微博-随时随地发现新鲜事
-```
-- 使用Http代理
-```php
-$urlParams = ['param1' => 'testvalue','params2' => 'somevalue'];
-$opts = [
- // 设置http代理
- 'proxy' => 'http://222.141.11.17:8118',
- //设置超时时间,单位:秒
- 'timeout' => 30,
- // 伪造http头
- 'headers' => [
- 'Referer' => 'https://querylist.cc/',
- 'User-Agent' => 'testing/1.0',
- 'Accept' => 'application/json',
- 'X-Foo' => ['Bar', 'Baz'],
- 'Cookie' => 'abc=111;xxx=222'
- ]
-];
-$ql->get('http://httpbin.org/get',$urlParams,$opts);
-// echo $ql->getHtml();
-```
-
-- 模拟登录
-```php
-// 用post登录
-$ql = QueryList::post('http://xxxx.com/login',[
- 'username' => 'admin',
- 'password' => '123456'
-])->get('http://xxx.com/admin');
-//采集需要登录才能访问的页面
-$ql->get('http://xxx.com/admin/page');
-//echo $ql->getHtml();
-```
-
-#### Form表单操作
-模拟登陆GitHub
-```php
-// 获取QueryList实例
-$ql = QueryList::getInstance();
-//获取到登录表单
-$form = $ql->get('https://github.com/login')->find('form');
-
-//填写GitHub用户名和密码
-$form->find('input[name=login]')->val('your github username or email');
-$form->find('input[name=password]')->val('your github password');
-
-//序列化表单数据
-$fromData = $form->serializeArray();
-$postData = [];
-foreach ($fromData as $item) {
- $postData[$item['name']] = $item['value'];
-}
-
-//提交登录表单
-$actionUrl = 'https://github.com'.$form->attr('action');
-$ql->post($actionUrl,$postData);
-//判断登录是否成功
-// echo $ql->getHtml();
-$userName = $ql->find('.header-nav-current-user>.css-truncate-target')->text();
-if($userName)
-{
- echo '登录成功!欢迎你:'.$userName;
-}else{
- echo '登录失败!';
-}
-```
-#### Bind功能扩展
-自定义扩展一个`myHttp`方法:
-```php
-$ql = QueryList::getInstance();
-
-//绑定一个myHttp方法到QueryList对象
-$ql->bind('myHttp',function ($url){
- // $this 为当前的QueryList对象
- $html = file_get_contents($url);
- $this->setHtml($html);
- return $this;
-});
-
-//然后就可以通过注册的名字来调用
-$data = $ql->myHttp('https://toutiao.io')->find('h3 a')->texts();
-print_r($data->all());
-```
-或者把实现体封装到class,然后这样绑定:
-```php
-$ql->bind('myHttp',function ($url){
- return new MyHttp($this,$url);
-});
-```
-
-#### 插件使用
-- 使用PhantomJS插件采集JavaScript动态渲染的页面:
-
-```php
-// 安装时设置PhantomJS二进制文件路径
-$ql = QueryList::use(PhantomJs::class,'/usr/local/bin/phantomjs');
-
-// 采集今日头条手机版
-$data = $ql->browser('https://m.toutiao.com')->find('p')->texts();
-print_r($data->all());
-
-// 使用HTTP代理
-$ql->browser('https://m.toutiao.com',false,[
- '--proxy' => '192.168.1.42:8080',
- '--proxy-type' => 'http'
-])
-```
-
-- 使用CURL多线程插件,多线程采集GitHub排行榜:
-
-```php
-$ql = QueryList::use(CurlMulti::class);
-$ql->curlMulti([
- 'https://github.com/trending/php',
- 'https://github.com/trending/go',
- //.....more urls
-])
- // 每个任务成功完成调用此回调
- ->success(function (QueryList $ql,CurlMulti $curl,$r){
- echo "Current url:{$r['info']['url']} \r\n";
- $data = $ql->find('h3 a')->texts();
- print_r($data->all());
-})
- // 每个任务失败回调
-->error(function ($errorInfo,CurlMulti $curl){
- echo "Current url:{$errorInfo['info']['url']} \r\n";
- print_r($errorInfo['error']);
-})
-->start([
- // 最大并发数
- 'maxThread' => 10,
- // 错误重试次数
- 'maxTry' => 3,
-]);
-
-```
-
-## 插件
-- [jae-jae/QueryList-PhantomJS](https://github.com/jae-jae/QueryList-PhantomJS): 使用PhantomJS采集JavaScript动态渲染的页面
-- [jae-jae/QueryList-CurlMulti](https://github.com/jae-jae/QueryList-CurlMulti) : Curl多线程采集
-- [jae-jae/QueryList-AbsoluteUrl](https://github.com/jae-jae/QueryList-AbsoluteUrl) : 转换URL相对路径到绝对路径
-- [jae-jae/QueryList-Rule-Google](https://github.com/jae-jae/QueryList-Rule-Google) : 谷歌搜索引擎
-- [jae-jae/QueryList-Rule-Baidu](https://github.com/jae-jae/QueryList-Rule-Baidu) : 百度搜索引擎
-
-
-查看更多的QueryList插件和基于QueryList的产品:[QueryList社区力量](https://github.com/jae-jae/QueryList-Community)
-
-## 贡献
-欢迎为QueryList贡献代码。关于贡献插件可以查看:[QueryList插件贡献说明](https://github.com/jae-jae/QueryList-Community/blob/master/CONTRIBUTING.md)
-
-## 寻求帮助?
-- QueryList主页: [http://querylist.cc](http://querylist.cc/)
-- QueryList文档: [http://doc.querylist.cc](http://doc.querylist.cc/)
-- QueryList问答:[http://wenda.querylist.cc](http://wenda.querylist.cc/)
-- QueryList交流QQ群:123266961
-- GitHub:https://github.com/jae-jae/QueryList
-- Git@OSC:http://git.oschina.net/jae/QueryList
-
-## Author
-Jaeger
-
-## Lisence
-QueryList is licensed under the license of MIT. See the LICENSE for more details.
diff --git a/vendor/jaeger/querylist/README.md b/vendor/jaeger/querylist/README.md
deleted file mode 100644
index 5ec559f..0000000
--- a/vendor/jaeger/querylist/README.md
+++ /dev/null
@@ -1,304 +0,0 @@
-
-
-
-
-
-
-# QueryList
-`QueryList` is a simple, elegant, extensible PHP Web Scraper (crawler/spider) ,based on phpQuery.
-
-[API Documentation](https://github.com/jae-jae/QueryList/wiki)
-
-[中文文档](README-ZH.md)
-
-## Features
-- Have the same CSS3 DOM selector as jQuery
-- Have the same DOM manipulation API as jQuery
-- Have a generic list crawling program
-- Have a strong HTTP request suite, easy to achieve such as: simulated landing, forged browser, HTTP proxy and other complex network requests
-- Have a messy code solution
-- Have powerful content filtering, you can use the jQuey selector to filter content
-- Has a high degree of modular design, scalability and strong
-- Have an expressive API
-- Has a wealth of plug-ins
-
-Through plug-ins you can easily implement things like:
-- Multithreaded crawl
-- Crawl JavaScript dynamic rendering page (PhantomJS/headless WebKit)
-- Image downloads to local
-- Simulate browser behavior such as submitting Form forms
-- Web crawler
-- .....
-
-## Requirements
-- PHP >= 7.1
-
-## Installation
-By Composer installation:
-```
-composer require jaeger/querylist
-```
-
-## Usage
-
-#### DOM Traversal and Manipulation
-- Crawl「GitHub」all picture links
-
-```php
-QueryList::get('https://github.com')->find('img')->attrs('src');
-```
-- Crawl Google search results
-
-```php
-$ql = QueryList::get('https://www.google.co.jp/search?q=QueryList');
-
-$ql->find('title')->text(); //The page title
-$ql->find('meta[name=keywords]')->content; //The page keywords
-
-$ql->find('h3>a')->texts(); //Get a list of search results titles
-$ql->find('h3>a')->attrs('href'); //Get a list of search results links
-
-$ql->find('img')->src; //Gets the link address of the first image
-$ql->find('img:eq(1)')->src; //Gets the link address of the second image
-$ql->find('img')->eq(2)->src; //Gets the link address of the third image
-// Loop all the images
-$ql->find('img')->map(function($img){
- echo $img->alt; //Print the alt attribute of the image
-});
-```
-- More usage
-
-```php
-$ql->find('#head')->append('Append content
')->find('div')->htmls();
-$ql->find('.two')->children('img')->attrs('alt'); // Get the class is the "two" element under all img child nodes
-// Loop class is the "two" element under all child nodes
-$data = $ql->find('.two')->children()->map(function ($item){
- // Use "is" to determine the node type
- if($item->is('a')){
- return $item->text();
- }elseif($item->is('img'))
- {
- return $item->alt;
- }
-});
-
-$ql->find('a')->attr('href', 'newVal')->removeClass('className')->html('newHtml')->...
-$ql->find('div > p')->add('div > ul')->filter(':has(a)')->find('p:first')->nextAll()->andSelf()->...
-$ql->find('div.old')->replaceWith( $ql->find('div.new')->clone())->appendTo('.trash')->prepend('Deleted')->...
-```
-#### List crawl
-Crawl the title and link of the Google search results list:
-```php
-$data = QueryList::get('https://www.google.co.jp/search?q=QueryList')
- // Set the crawl rules
- ->rules([
- 'title'=>array('h3','text'),
- 'link'=>array('h3>a','href')
- ])
- ->query()->getData();
-
-print_r($data->all());
-```
- Results:
-```
-Array
-(
- [0] => Array
- (
- [title] => Angular - QueryList
- [link] => https://angular.io/api/core/QueryList
- )
- [1] => Array
- (
- [title] => QueryList | @angular/core - Angularリファレンス - Web Creative Park
- [link] => http://www.webcreativepark.net/angular/querylist/
- )
- [2] => Array
- (
- [title] => QueryListにQueryを追加したり、追加されたことを感知する | TIPS ...
- [link] => http://www.webcreativepark.net/angular/querylist_query_add_subscribe/
- )
- //...
-)
-```
-#### Encode convert
-```php
-// Out charset :UTF-8
-// In charset :GB2312
-QueryList::get('https://top.etao.com')->encoding('UTF-8','GB2312')->find('a')->texts();
-
-// Out charset:UTF-8
-// In charset:Automatic Identification
-QueryList::get('https://top.etao.com')->encoding('UTF-8')->find('a')->texts();
-```
-
-#### HTTP Client (GuzzleHttp)
-- Carry cookie login GitHub
-```php
-//Crawl GitHub content
-$ql = QueryList::get('https://github.com','param1=testvalue & params2=somevalue',[
- 'headers' => [
- // Fill in the cookie from the browser
- 'Cookie' => 'SINAGLOBAL=546064; wb_cmtLike_2112031=1; wvr=6;....'
- ]
-]);
-//echo $ql->getHtml();
-$userName = $ql->find('.header-nav-current-user>.css-truncate-target')->text();
-echo $userName;
-```
-- Use the Http proxy
-```php
-$urlParams = ['param1' => 'testvalue','params2' => 'somevalue'];
-$opts = [
- // Set the http proxy
- 'proxy' => 'http://222.141.11.17:8118',
- //Set the timeout time in seconds
- 'timeout' => 30,
- // Fake HTTP headers
- 'headers' => [
- 'Referer' => 'https://querylist.cc/',
- 'User-Agent' => 'testing/1.0',
- 'Accept' => 'application/json',
- 'X-Foo' => ['Bar', 'Baz'],
- 'Cookie' => 'abc=111;xxx=222'
- ]
-];
-$ql->get('http://httpbin.org/get',$urlParams,$opts);
-// echo $ql->getHtml();
-```
-
-- Analog login
-```php
-// Post login
-$ql = QueryList::post('http://xxxx.com/login',[
- 'username' => 'admin',
- 'password' => '123456'
-])->get('http://xxx.com/admin');
-// Crawl pages that need to be logged in to access
-$ql->get('http://xxx.com/admin/page');
-//echo $ql->getHtml();
-```
-
-#### Submit forms
-Login GitHub
-```php
-// Get the QueryList instance
-$ql = QueryList::getInstance();
-// Get the login form
-$form = $ql->get('https://github.com/login')->find('form');
-
-// Fill in the GitHub username and password
-$form->find('input[name=login]')->val('your github username or email');
-$form->find('input[name=password]')->val('your github password');
-
-// Serialize the form data
-$fromData = $form->serializeArray();
-$postData = [];
-foreach ($fromData as $item) {
- $postData[$item['name']] = $item['value'];
-}
-
-// Submit the login form
-$actionUrl = 'https://github.com'.$form->attr('action');
-$ql->post($actionUrl,$postData);
-// To determine whether the login is successful
-// echo $ql->getHtml();
-$userName = $ql->find('.header-nav-current-user>.css-truncate-target')->text();
-if($userName)
-{
- echo 'Login successful ! Welcome:'.$userName;
-}else{
- echo 'Login failed !';
-}
-```
-#### Bind function extension
-Customize the extension of a `myHttp` method:
-```php
-$ql = QueryList::getInstance();
-
-//Bind a `myHttp` method to the QueryList object
-$ql->bind('myHttp',function ($url){
- // $this is the current QueryList object
- $html = file_get_contents($url);
- $this->setHtml($html);
- return $this;
-});
-
-// And then you can call by the name of the binding
-$data = $ql->myHttp('https://toutiao.io')->find('h3 a')->texts();
-print_r($data->all());
-```
-Or package to class, and then bind:
-```php
-$ql->bind('myHttp',function ($url){
- return new MyHttp($this,$url);
-});
-```
-
-#### Plugin used
-- Use the PhantomJS plugin to crawl JavaScript dynamically rendered pages:
-
-```php
-// Set the PhantomJS binary file path during installation
-$ql = QueryList::use(PhantomJs::class,'/usr/local/bin/phantomjs');
-
-// Crawl「500px」all picture links
-$data = $ql->browser('https://500px.com/editors')->find('img')->attrs('src');
-print_r($data->all());
-
-// Use the HTTP proxy
-$ql->browser('https://500px.com/editors',false,[
- '--proxy' => '192.168.1.42:8080',
- '--proxy-type' => 'http'
-])
-```
-
-- Using the CURL multithreading plug-in, multi-threaded crawling GitHub trending :
-
-```php
-$ql = QueryList::use(CurlMulti::class);
-$ql->curlMulti([
- 'https://github.com/trending/php',
- 'https://github.com/trending/go',
- //.....more urls
-])
- // Called if task is success
- ->success(function (QueryList $ql,CurlMulti $curl,$r){
- echo "Current url:{$r['info']['url']} \r\n";
- $data = $ql->find('h3 a')->texts();
- print_r($data->all());
-})
- // Task fail callback
-->error(function ($errorInfo,CurlMulti $curl){
- echo "Current url:{$errorInfo['info']['url']} \r\n";
- print_r($errorInfo['error']);
-})
-->start([
- // Maximum number of threads
- 'maxThread' => 10,
- // Number of error retries
- 'maxTry' => 3,
-]);
-
-```
-
-## Plugins
-- [jae-jae/QueryList-PhantomJS](https://github.com/jae-jae/QueryList-PhantomJS):Use PhantomJS to crawl Javascript dynamically rendered page.
-- [jae-jae/QueryList-CurlMulti](https://github.com/jae-jae/QueryList-CurlMulti) : Curl multi threading.
-- [jae-jae/QueryList-AbsoluteUrl](https://github.com/jae-jae/QueryList-AbsoluteUrl) : Converting relative urls to absolute.
-- [jae-jae/QueryList-Rule-Google](https://github.com/jae-jae/QueryList-Rule-Google) : Google searcher.
-- [jae-jae/QueryList-Rule-Baidu](https://github.com/jae-jae/QueryList-Rule-Baidu) : Baidu searcher.
-
-
-View more QueryList plugins and QueryList-based products: [QueryList Community](https://github.com/jae-jae/QueryList-Community)
-
-## Contributing
-Welcome to contribute code for the QueryList。About Contributing Plugins can be viewed:[QueryList Plugin Contributing Guide](https://github.com/jae-jae/QueryList-Community/blob/master/CONTRIBUTING.md)
-
-## Author
-Jaeger
-
-If this library is useful for you, say thanks [buying me a beer :beer:](https://www.paypal.me/jaepay)!
-
-## Lisence
-QueryList is licensed under the license of MIT. See the LICENSE for more details.
diff --git a/vendor/jaeger/querylist/composer.json b/vendor/jaeger/querylist/composer.json
deleted file mode 100644
index e1bcefe..0000000
--- a/vendor/jaeger/querylist/composer.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "jaeger/querylist",
- "description": "Simple, elegant, extensible PHP Web Scraper (crawler/spider),Use the css3 dom selector,Based on phpQuery! 简洁、优雅、可扩展的PHP采集工具(爬虫),基于phpQuery。",
- "keywords":["QueryList","phpQuery","spider"],
- "homepage": "http://querylist.cc",
- "require": {
- "PHP":">=7.1",
- "jaeger/phpquery-single": "^1",
- "jaeger/g-http": "^1.1",
- "ext-dom": "*",
- "tightenco/collect": ">5.0"
- },
- "suggest":{
-
- },
- "license": "MIT",
- "authors": [
- {
- "name": "Jaeger",
- "email": "JaegerCode@gmail.com"
- }
- ],
- "autoload":{
- "psr-4":{
- "QL\\":"src"
- }
- },
- "autoload-dev": {
- "psr-4": {
- "Tests\\": "tests/"
- }
- },
- "require-dev": {
- "symfony/var-dumper": "^3.3",
- "phpunit/phpunit": "^8.5"
- },
- "scripts": {
- "test": "./vendor/bin/phpunit"
- }
-}
diff --git a/vendor/jaeger/querylist/logo.png b/vendor/jaeger/querylist/logo.png
deleted file mode 100644
index a29b3e6..0000000
Binary files a/vendor/jaeger/querylist/logo.png and /dev/null differ
diff --git a/vendor/jaeger/querylist/phpunit.xml b/vendor/jaeger/querylist/phpunit.xml
deleted file mode 100644
index ba72a84..0000000
--- a/vendor/jaeger/querylist/phpunit.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
- ./tests
-
-
-
-
-
- src
-
-
-
-
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Config.php b/vendor/jaeger/querylist/src/Config.php
deleted file mode 100644
index b2ababb..0000000
--- a/vendor/jaeger/querylist/src/Config.php
+++ /dev/null
@@ -1,94 +0,0 @@
-
- * Date: 2017/9/22
- */
-
-namespace QL;
-use Closure;
-use Tightenco\Collect\Support\Collection;
-
-class Config
-{
- protected static $instance = null;
-
- protected $plugins;
- protected $binds;
-
- /**
- * Config constructor.
- */
- public function __construct()
- {
- $this->plugins = new Collection();
- $this->binds = new Collection();
- }
-
-
- /**
- * Get the Config instance
- *
- * @return null|Config
- */
- public static function getInstance()
- {
- self::$instance || self::$instance = new self();
- return self::$instance;
- }
-
- /**
- * Global installation plugin
- *
- * @param $plugins
- * @param array ...$opt
- * @return $this
- */
- public function use($plugins,...$opt)
- {
- if(is_string($plugins)){
- $this->plugins->push([$plugins,$opt]);
- }else{
- $this->plugins = $this->plugins->merge($plugins);
- }
- return $this;
- }
-
- /**
- * Global binding custom method
- *
- * @param string $name
- * @param Closure $provider
- * @return $this
- */
- public function bind(string $name, Closure $provider)
- {
- $this->binds[$name] = $provider;
- return $this;
- }
-
- public function bootstrap(QueryList $queryList)
- {
- $this->installPlugins($queryList);
- $this->installBind($queryList);
- }
-
- protected function installPlugins(QueryList $queryList)
- {
- $this->plugins->each(function($plugin) use($queryList){
- if(is_string($plugin)){
- $queryList->use($plugin);
- }else{
- $queryList->use($plugin[0],...$plugin[1]);
- }
- });
- }
-
- protected function installBind(QueryList $queryList)
- {
- $this->binds->each(function ($provider,$name) use($queryList){
- $queryList->bind($name,$provider);
- });
- }
-
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Contracts/PluginContract.php b/vendor/jaeger/querylist/src/Contracts/PluginContract.php
deleted file mode 100644
index 8bbd498..0000000
--- a/vendor/jaeger/querylist/src/Contracts/PluginContract.php
+++ /dev/null
@@ -1,15 +0,0 @@
-
- * Date: 2017/9/22
- */
-
-namespace QL\Contracts;
-
-use QL\QueryList;
-
-interface PluginContract
-{
- public static function install(QueryList $queryList,...$opt);
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Contracts/ServiceProviderContract.php b/vendor/jaeger/querylist/src/Contracts/ServiceProviderContract.php
deleted file mode 100644
index 1bdf28b..0000000
--- a/vendor/jaeger/querylist/src/Contracts/ServiceProviderContract.php
+++ /dev/null
@@ -1,15 +0,0 @@
-
- * Date: 2017/9/20
- */
-
-namespace QL\Contracts;
-
-use QL\Kernel;
-
-interface ServiceProviderContract
-{
- public function register(Kernel $kernel);
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Dom/Dom.php b/vendor/jaeger/querylist/src/Dom/Dom.php
deleted file mode 100644
index 38f71a1..0000000
--- a/vendor/jaeger/querylist/src/Dom/Dom.php
+++ /dev/null
@@ -1,30 +0,0 @@
-
- * Date: 2017/9/19
- */
-
-namespace QL\Dom;
-
-use phpQueryObject;
-
-class Dom
-{
-
- protected $document;
-
- /**
- * Dom constructor.
- */
- public function __construct(phpQueryObject $document)
- {
- $this->document = $document;
- }
-
- public function find($selector)
- {
- $elements = $this->document->find($selector);
- return new Elements($elements);
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Dom/Elements.php b/vendor/jaeger/querylist/src/Dom/Elements.php
deleted file mode 100644
index 943e3ce..0000000
--- a/vendor/jaeger/querylist/src/Dom/Elements.php
+++ /dev/null
@@ -1,260 +0,0 @@
-
- * Date: 2017/9/19
- */
-
-namespace QL\Dom;
-
-use phpDocumentor\Reflection\Types\Null_;
-use phpQueryObject;
-use Tightenco\Collect\Support\Collection;
-
-/**
- * Class Elements
- * @package QL\Dom
- *
- * @method Elements toReference(&$var)
- * @method Elements documentFragment($state = null)
- * @method Elements toRoot()
- * @method Elements getDocumentIDRef(&$documentID)
- * @method Elements getDocument()
- * @method \DOMDocument getDOMDocument()
- * @method Elements getDocumentID()
- * @method Elements unloadDocument()
- * @method bool isHTML()
- * @method bool isXHTML()
- * @method bool isXML()
- * @method string serialize()
- * @method array serializeArray($submit = null)
- * @method \DOMElement|\DOMElement[] get($index = null, $callback1 = null, $callback2 = null, $callback3 = null)
- * @method string|array getString($index = null, $callback1 = null, $callback2 = null, $callback3 = null)
- * @method string|array getStrings($index = null, $callback1 = null, $callback2 = null, $callback3 = null)
- * @method Elements newInstance($newStack = null)
- * @method Elements find($selectors, $context = null, $noHistory = false)
- * @method Elements|bool is($selector, $nodes = null)
- * @method Elements filterCallback($callback, $_skipHistory = false)
- * @method Elements filter($selectors, $_skipHistory = false)
- * @method Elements load($url, $data = null, $callback = null)
- * @method Elements trigger($type, $data = [])
- * @method Elements triggerHandler($type, $data = [])
- * @method Elements bind($type, $data, $callback = null)
- * @method Elements unbind($type = null, $callback = null)
- * @method Elements change($callback = null)
- * @method Elements submit($callback = null)
- * @method Elements click($callback = null)
- * @method Elements wrapAllOld($wrapper)
- * @method Elements wrapAll($wrapper)
- * @method Elements wrapAllPHP($codeBefore, $codeAfter)
- * @method Elements wrap($wrapper)
- * @method Elements wrapPHP($codeBefore, $codeAfter)
- * @method Elements wrapInner($wrapper)
- * @method Elements wrapInnerPHP($codeBefore, $codeAfter)
- * @method Elements contents()
- * @method Elements contentsUnwrap()
- * @method Elements switchWith($markup)
- * @method Elements eq($num)
- * @method Elements size()
- * @method Elements length()
- * @method int count()
- * @method Elements end($level = 1)
- * @method Elements _clone()
- * @method Elements replaceWithPHP($code)
- * @method Elements replaceWith($content)
- * @method Elements replaceAll($selector)
- * @method Elements remove($selector = null)
- * @method Elements|string markup($markup = null, $callback1 = null, $callback2 = null, $callback3 = null)
- * @method string markupOuter($callback1 = null, $callback2 = null, $callback3 = null)
- * @method Elements|string html($html = null, $callback1 = null, $callback2 = null, $callback3 = null)
- * @method Elements|string xml($xml = null, $callback1 = null, $callback2 = null, $callback3 = null)
- * @method string htmlOuter($callback1 = null, $callback2 = null, $callback3 = null)
- * @method string xmlOuter($callback1 = null, $callback2 = null, $callback3 = null)
- * @method Elements php($code)
- * @method string markupPHP($code)
- * @method string markupOuterPHP()
- * @method Elements children($selector)
- * @method Elements ancestors($selector)
- * @method Elements append($content)
- * @method Elements appendPHP($content)
- * @method Elements appendTo($seletor)
- * @method Elements prepend($content)
- * @method Elements prependPHP($content)
- * @method Elements prependTo($seletor)
- * @method Elements before($content)
- * @method Elements beforePHP($content)
- * @method Elements insertBefore($seletor)
- * @method Elements after($content)
- * @method Elements afterPHP($content)
- * @method Elements insertAfter($seletor)
- * @method Elements insert($target, $type)
- * @method int index($subject)
- * @method Elements slice($start, $end = null)
- * @method Elements reverse()
- * @method Elements|string text($text = null, $callback1 = null, $callback2 = null, $callback3 = null)
- * @method Elements plugin($class, $file = null)
- * @method Elements _next($selector = null)
- * @method Elements _prev($selector = null)
- * @method Elements prev($selector = null)
- * @method Elements prevAll($selector = null)
- * @method Elements nextAll($selector = null)
- * @method Elements siblings($selector = null)
- * @method Elements not($selector = null)
- * @method Elements add($selector = null)
- * @method Elements parent($selector = null)
- * @method Elements parents($selector = null)
- * @method Elements stack($nodeTypes = null)
- * @method Elements|string attr($attr = null, $value = null)
- * @method Elements attrPHP($attr, $code)
- * @method Elements removeAttr($attr)
- * @method Elements|string val($val = null)
- * @method Elements andSelf()
- * @method Elements addClass($className)
- * @method Elements addClassPHP($className)
- * @method bool hasClass($className)
- * @method Elements removeClass($className)
- * @method Elements toggleClass($className)
- * @method Elements _empty()
- * @method Elements callback($callback, $param1 = null, $param2 = null, $param3 = null)
- * @method string data($key, $value = null)
- * @method Elements removeData($key)
- * @method void rewind()
- * @method Elements current()
- * @method int key()
- * @method Elements next($cssSelector = null)
- * @method bool valid()
- * @method bool offsetExists($offset)
- * @method Elements offsetGet($offset)
- * @method void offsetSet($offset, $value)
- * @method string whois($oneNode)
- * @method Elements dump()
- * @method Elements dumpWhois()
- * @method Elements dumpLength()
- * @method Elements dumpTree($html, $title)
- * @method dumpDie()
- */
-class Elements
-{
- /**
- * @var phpQueryObject
- */
- protected $elements;
-
- /**
- * Elements constructor.
- * @param $elements
- */
- public function __construct(phpQueryObject $elements)
- {
- $this->elements = $elements;
- }
-
- public function __get($name)
- {
- return property_exists($this->elements, $name) ? $this->elements->$name : $this->elements->attr($name);
- }
-
- public function __call($name, $arguments)
- {
- $obj = call_user_func_array([$this->elements, $name], $arguments);
- if ($obj instanceof phpQueryObject) {
- $obj = new self($obj);
- } else if (is_string($obj)) {
- $obj = trim($obj);
- }
- return $obj;
- }
-
- /**
- * Iterating elements
- *
- * @param callable $callback
- *
- * @return $this
- */
- public function each(callable $callback)
- {
- foreach ($this->elements as $key => $element) {
- $break = $callback(new self(pq($element)), $key);
- if ($break === false) {
- break;
- }
- }
-
- return $this;
- }
-
- /**
- * Iterating elements
- *
- * @param $callback
- * @return \Illuminate\Support\Collection|\Tightenco\Collect\Support\Collection
- */
- public function map($callback)
- {
- $collection = new Collection();
- $this->elements->each(function ($dom) use (& $collection, $callback) {
- $collection->push($callback(new self(pq($dom))));
- });
- return $collection;
- }
-
- /**
- * Gets the attributes of all the elements
- *
- * @param string $attr HTML attribute name
- * @return \Illuminate\Support\Collection|\Tightenco\Collect\Support\Collection
- */
- public function attrs($attr)
- {
- return $this->map(function ($item) use ($attr) {
- return $item->attr($attr);
- });
- }
-
- /**
- * Gets the text of all the elements
- *
- * @return \Illuminate\Support\Collection|\Tightenco\Collect\Support\Collection
- */
- public function texts()
- {
- return $this->map(function ($item) {
- return trim($item->text());
- });
- }
-
- /**
- * Gets the html of all the elements
- *
- * @return \Illuminate\Support\Collection|\Tightenco\Collect\Support\Collection
- */
- public function htmls()
- {
- return $this->map(function ($item) {
- return trim($item->html());
- });
- }
-
- /**
- * Gets the htmlOuter of all the elements
- *
- * @return \Illuminate\Support\Collection|\Tightenco\Collect\Support\Collection
- */
- public function htmlOuters()
- {
- return $this->map(function ($item) {
- return trim($item->htmlOuter());
- });
- }
-
-
- /**
- * @return phpQueryObject
- */
- public function getElements(): phpQueryObject
- {
- return $this->elements;
- }
-
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Dom/Query.php b/vendor/jaeger/querylist/src/Dom/Query.php
deleted file mode 100644
index 869a0cc..0000000
--- a/vendor/jaeger/querylist/src/Dom/Query.php
+++ /dev/null
@@ -1,322 +0,0 @@
-
- * Date: 2017/9/21
- */
-
-namespace QL\Dom;
-
-use Tightenco\Collect\Support\Collection;
-use phpQuery;
-use phpQueryObject;
-use QL\QueryList;
-use Closure;
-
-class Query
-{
- protected $html;
- /**
- * @var \phpQueryObject
- */
- protected $document;
- protected $rules;
- protected $range = null;
- protected $ql;
- /**
- * @var Collection
- */
- protected $data;
-
-
- public function __construct(QueryList $ql)
- {
- $this->ql = $ql;
- }
-
- /**
- * @param bool $rel
- * @return String
- */
- public function getHtml($rel = true)
- {
- return $rel ? $this->document->htmlOuter() : $this->html;
- }
-
- /**
- * @param $html
- * @param null $charset
- * @return QueryList
- */
- public function setHtml($html, $charset = null)
- {
- $this->html = value($html);
- $this->destroyDocument();
- $this->document = phpQuery::newDocumentHTML($this->html, $charset);
- return $this->ql;
- }
-
- /**
- * Get crawl results
- *
- * @param Closure|null $callback
- * @return Collection|static
- */
- public function getData(Closure $callback = null)
- {
- return $this->handleData($this->data, $callback);
- }
-
- /**
- * @param Collection $data
- */
- public function setData(Collection $data)
- {
- $this->data = $data;
- }
-
-
- /**
- * Searches for all elements that match the specified expression.
- *
- * @param $selector A string containing a selector expression to match elements against.
- * @return Elements
- */
- public function find($selector)
- {
- return (new Dom($this->document))->find($selector);
- }
-
- /**
- * Set crawl rule
- *
- * $rules = [
- * 'rule_name1' => ['selector','HTML attribute | text | html','Tag filter list','callback'],
- * 'rule_name2' => ['selector','HTML attribute | text | html','Tag filter list','callback'],
- * // ...
- * ]
- *
- * @param array $rules
- * @return QueryList
- */
- public function rules(array $rules)
- {
- $this->rules = $rules;
- return $this->ql;
- }
-
-
- /**
- * Set the slice area for crawl list
- *
- * @param $selector
- * @return QueryList
- */
- public function range($selector)
- {
- $this->range = $selector;
- return $this->ql;
- }
-
- /**
- * Remove HTML head,try to solve the garbled
- *
- * @return QueryList
- */
- public function removeHead()
- {
- $html = preg_replace('/(|).+<\/head>/is', '', $this->html);
- $this->setHtml($html);
- return $this->ql;
- }
-
- /**
- * Execute the query rule
- *
- * @param Closure|null $callback
- * @return QueryList
- */
- public function query(Closure $callback = null)
- {
- $this->data = $this->getList();
- $this->data = $this->handleData($this->data, $callback);
- return $this->ql;
- }
-
- public function handleData(Collection $data, $callback)
- {
- if (is_callable($callback)) {
- if (empty($this->range)) {
- $data = new Collection($callback($data->all(), null));
- } else {
- $data = $data->map($callback);
- }
- }
-
- return $data;
- }
-
- protected function getList()
- {
- $data = [];
- if (empty($this->range)) {
- foreach ($this->rules as $key => $reg_value) {
- $rule = $this->parseRule($reg_value);
- $contentElements = $this->document->find($rule['selector']);
- $data[$key] = $this->extractContent($contentElements, $key, $rule);
- }
- } else {
- $rangeElements = $this->document->find($this->range);
- $i = 0;
- foreach ($rangeElements as $element) {
- foreach ($this->rules as $key => $reg_value) {
- $rule = $this->parseRule($reg_value);
- $contentElements = pq($element)->find($rule['selector']);
- $data[$i][$key] = $this->extractContent($contentElements, $key, $rule);
- }
- $i++;
- }
- }
-
- return new Collection($data);
- }
-
- protected function extractContent(phpQueryObject $pqObj, $ruleName, $rule)
- {
- switch ($rule['attr']) {
- case 'text':
- $content = $this->allowTags($pqObj->html(), $rule['filter_tags']);
- break;
- case 'texts':
- $content = (new Elements($pqObj))->map(function (Elements $element) use ($rule) {
- return $this->allowTags($element->html(), $rule['filter_tags']);
- })->all();
- break;
- case 'html':
- $content = $this->stripTags($pqObj->html(), $rule['filter_tags']);
- break;
- case 'htmls':
- $content = (new Elements($pqObj))->map(function (Elements $element) use ($rule) {
- return $this->stripTags($element->html(), $rule['filter_tags']);
- })->all();
- break;
- case 'htmlOuter':
- $content = $this->stripTags($pqObj->htmlOuter(), $rule['filter_tags']);
- break;
- case 'htmlOuters':
- $content = (new Elements($pqObj))->map(function (Elements $element) use ($rule) {
- return $this->stripTags($element->htmlOuter(), $rule['filter_tags']);
- })->all();
- break;
- default:
- if(preg_match('/attr\((.+)\)/', $rule['attr'], $arr)) {
- $content = $pqObj->attr($arr[1]);
- } elseif (preg_match('/attrs\((.+)\)/', $rule['attr'], $arr)) {
- $content = (new Elements($pqObj))->attrs($arr[1])->all();
- } else {
- $content = $pqObj->attr($rule['attr']);
- }
- break;
- }
-
- if (is_callable($rule['handle_callback'])) {
- $content = call_user_func($rule['handle_callback'], $content, $ruleName);
- }
-
- return $content;
- }
-
- protected function parseRule($rule)
- {
- $result = [];
- $result['selector'] = $rule[0];
- $result['attr'] = $rule[1];
- $result['filter_tags'] = $rule[2] ?? '';
- $result['handle_callback'] = $rule[3] ?? null;
-
- return $result;
- }
-
- /**
- * 去除特定的html标签
- * @param string $html
- * @param string $tags_str 多个标签名之间用空格隔开
- * @return string
- */
- protected function stripTags($html, $tags_str)
- {
- $tagsArr = $this->tag($tags_str);
- $html = $this->removeTags($html, $tagsArr[1]);
- $p = array();
- foreach ($tagsArr[0] as $tag) {
- $p[] = "/(<(?:\/" . $tag . "|" . $tag . ")[^>]*>)/i";
- }
- $html = preg_replace($p, "", trim($html));
- return $html;
- }
-
- /**
- * 保留特定的html标签
- * @param string $html
- * @param string $tags_str 多个标签名之间用空格隔开
- * @return string
- */
- protected function allowTags($html, $tags_str)
- {
- $tagsArr = $this->tag($tags_str);
- $html = $this->removeTags($html, $tagsArr[1]);
- $allow = '';
- foreach ($tagsArr[0] as $tag) {
- $allow .= "<$tag> ";
- }
- return strip_tags(trim($html), $allow);
- }
-
- protected function tag($tags_str)
- {
- $tagArr = preg_split("/\s+/", $tags_str, -1, PREG_SPLIT_NO_EMPTY);
- $tags = array(array(), array());
- foreach ($tagArr as $tag) {
- if (preg_match('/-(.+)/', $tag, $arr)) {
- array_push($tags[1], $arr[1]);
- } else {
- array_push($tags[0], $tag);
- }
- }
- return $tags;
- }
-
- /**
- * 移除特定的html标签
- * @param string $html
- * @param array $tags 标签数组
- * @return string
- */
- protected function removeTags($html, $tags)
- {
- $tag_str = '';
- if (count($tags)) {
- foreach ($tags as $tag) {
- $tag_str .= $tag_str ? ',' . $tag : $tag;
- }
-// phpQuery::$defaultCharset = $this->inputEncoding?$this->inputEncoding:$this->htmlEncoding;
- $doc = phpQuery::newDocumentHTML($html);
- pq($doc)->find($tag_str)->remove();
- $html = pq($doc)->htmlOuter();
- $doc->unloadDocument();
- }
- return $html;
- }
-
- protected function destroyDocument()
- {
- if ($this->document instanceof phpQueryObject) {
- $this->document->unloadDocument();
- }
- }
-
- public function __destruct()
- {
- $this->destroyDocument();
- }
-}
diff --git a/vendor/jaeger/querylist/src/Exceptions/ServiceNotFoundException.php b/vendor/jaeger/querylist/src/Exceptions/ServiceNotFoundException.php
deleted file mode 100644
index a8924ad..0000000
--- a/vendor/jaeger/querylist/src/Exceptions/ServiceNotFoundException.php
+++ /dev/null
@@ -1,15 +0,0 @@
-
- * Date: 2017/9/21
- */
-
-namespace QL\Exceptions;
-
-use Exception;
-
-class ServiceNotFoundException extends Exception
-{
-
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Kernel.php b/vendor/jaeger/querylist/src/Kernel.php
deleted file mode 100644
index 085c21d..0000000
--- a/vendor/jaeger/querylist/src/Kernel.php
+++ /dev/null
@@ -1,74 +0,0 @@
-
- * Date: 2017/9/21
- */
-
-namespace QL;
-
-use QL\Contracts\ServiceProviderContract;
-use QL\Exceptions\ServiceNotFoundException;
-use QL\Providers\EncodeServiceProvider;
-use Closure;
-use QL\Providers\HttpServiceProvider;
-use QL\Providers\PluginServiceProvider;
-use QL\Providers\SystemServiceProvider;
-use Tightenco\Collect\Support\Collection;
-
-class Kernel
-{
- protected $providers = [
- SystemServiceProvider::class,
- HttpServiceProvider::class,
- EncodeServiceProvider::class,
- PluginServiceProvider::class
- ];
-
- protected $binds;
- protected $ql;
-
- /**
- * Kernel constructor.
- * @param $ql
- */
- public function __construct(QueryList $ql)
- {
- $this->ql = $ql;
- $this->binds = new Collection();
- }
-
- public function bootstrap()
- {
- //注册服务提供者
- $this->registerProviders();
- return $this;
- }
-
- public function registerProviders()
- {
- foreach ($this->providers as $provider) {
- $this->register(new $provider());
- }
- }
-
- public function bind(string $name,Closure $provider)
- {
- $this->binds[$name] = $provider;
- }
-
- public function getService(string $name)
- {
- if(!$this->binds->offsetExists($name)){
- throw new ServiceNotFoundException("Service: {$name} not found!");
- }
- return $this->binds[$name];
- }
-
- private function register(ServiceProviderContract $instance)
- {
- $instance->register($this);
- }
-
-
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Providers/EncodeServiceProvider.php b/vendor/jaeger/querylist/src/Providers/EncodeServiceProvider.php
deleted file mode 100644
index e8fd739..0000000
--- a/vendor/jaeger/querylist/src/Providers/EncodeServiceProvider.php
+++ /dev/null
@@ -1,22 +0,0 @@
-
- * Date: 2017/9/20
- */
-
-namespace QL\Providers;
-
-use QL\Contracts\ServiceProviderContract;
-use QL\Kernel;
-use QL\Services\EncodeService;
-
-class EncodeServiceProvider implements ServiceProviderContract
-{
- public function register(Kernel $kernel)
- {
- $kernel->bind('encoding',function (string $outputEncoding,string $inputEncoding = null){
- return EncodeService::convert($this,$outputEncoding,$inputEncoding);
- });
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Providers/HttpServiceProvider.php b/vendor/jaeger/querylist/src/Providers/HttpServiceProvider.php
deleted file mode 100644
index 2b3145f..0000000
--- a/vendor/jaeger/querylist/src/Providers/HttpServiceProvider.php
+++ /dev/null
@@ -1,40 +0,0 @@
-
- * Date: 2017/9/22
- */
-
-namespace QL\Providers;
-
-
-use QL\Contracts\ServiceProviderContract;
-use QL\Kernel;
-use QL\Services\HttpService;
-use QL\Services\MultiRequestService;
-
-class HttpServiceProvider implements ServiceProviderContract
-{
- public function register(Kernel $kernel)
- {
- $kernel->bind('get',function (...$args){
- return HttpService::get($this,...$args);
- });
-
- $kernel->bind('post',function (...$args){
- return HttpService::post($this,...$args);
- });
-
- $kernel->bind('postJson',function (...$args){
- return HttpService::postJson($this,...$args);
- });
-
- $kernel->bind('multiGet',function (...$args){
- return new MultiRequestService($this,'get',...$args);
- });
-
- $kernel->bind('multiPost',function (...$args){
- return new MultiRequestService($this,'post',...$args);
- });
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Providers/PluginServiceProvider.php b/vendor/jaeger/querylist/src/Providers/PluginServiceProvider.php
deleted file mode 100644
index 867b2ec..0000000
--- a/vendor/jaeger/querylist/src/Providers/PluginServiceProvider.php
+++ /dev/null
@@ -1,23 +0,0 @@
-
- * Date: 2017/9/22
- */
-
-namespace QL\Providers;
-
-use QL\Contracts\ServiceProviderContract;
-use QL\Kernel;
-use QL\Services\PluginService;
-
-class PluginServiceProvider implements ServiceProviderContract
-{
- public function register(Kernel $kernel)
- {
- $kernel->bind('use',function ($plugins,...$opt){
- return PluginService::install($this,$plugins,...$opt);
- });
- }
-
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Providers/SystemServiceProvider.php b/vendor/jaeger/querylist/src/Providers/SystemServiceProvider.php
deleted file mode 100644
index 76d60d2..0000000
--- a/vendor/jaeger/querylist/src/Providers/SystemServiceProvider.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
- * Date: 2017/9/22
- */
-
-namespace QL\Providers;
-
-use QL\Contracts\ServiceProviderContract;
-use QL\Kernel;
-use Closure;
-
-class SystemServiceProvider implements ServiceProviderContract
-{
- public function register(Kernel $kernel)
- {
- $kernel->bind('html',function (...$args){
- $this->setHtml(...$args);
- return $this;
- });
-
- $kernel->bind('queryData',function (Closure $callback = null){
- return $this->query()->getData($callback)->all();
- });
-
- $kernel->bind('pipe',function (Closure $callback = null){
- return $callback($this);
- });
-
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/QueryList.php b/vendor/jaeger/querylist/src/QueryList.php
deleted file mode 100644
index 4fc1c6c..0000000
--- a/vendor/jaeger/querylist/src/QueryList.php
+++ /dev/null
@@ -1,133 +0,0 @@
-query = new Query($this);
- $this->kernel = (new Kernel($this))->bootstrap();
- Config::getInstance()->bootstrap($this);
- }
-
- public function __call($name, $arguments)
- {
- if(method_exists($this->query,$name)){
- $result = $this->query->$name(...$arguments);
- }else{
- $result = $this->kernel->getService($name)->call($this,...$arguments);
- }
- return $result;
- }
-
- public static function __callStatic($name, $arguments)
- {
- $instance = new self();
- return $instance->$name(...$arguments);
- }
-
- public function __destruct()
- {
- $this->destruct();
- }
-
- /**
- * Get the QueryList single instance
- *
- * @return QueryList
- */
- public static function getInstance()
- {
- self::$instance || self::$instance = new self();
- return self::$instance;
- }
-
- /**
- * Get the Config instance
- * @return null|Config
- */
- public static function config()
- {
- return Config::getInstance();
- }
-
- /**
- * Destruction of resources
- */
- public function destruct()
- {
- unset($this->query);
- unset($this->kernel);
- }
-
- /**
- * Destroy all documents
- */
- public static function destructDocuments()
- {
- phpQuery::$documents = [];
- }
-
- /**
- * Bind a custom method to the QueryList object
- *
- * @param string $name Invoking the name
- * @param Closure $provide Called method
- * @return $this
- */
- public function bind(string $name,Closure $provide)
- {
- $this->kernel->bind($name,$provide);
- return $this;
- }
-
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Services/EncodeService.php b/vendor/jaeger/querylist/src/Services/EncodeService.php
deleted file mode 100644
index 704d8b8..0000000
--- a/vendor/jaeger/querylist/src/Services/EncodeService.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
- * Date: 2017/9/20
- * 编码转换服务
- */
-
-namespace QL\Services;
-
-use QL\QueryList;
-
-class EncodeService
-{
- public static function convert(QueryList $ql,string $outputEncoding,string $inputEncoding = null)
- {
- $html = $ql->getHtml();
- $inputEncoding || $inputEncoding = self::detect($html);
- $html = iconv($inputEncoding,$outputEncoding.'//IGNORE',$html);
- $ql->setHtml($html);
- return $ql;
- }
-
- /**
- * Attempts to detect the encoding
- * @param $string
- * @return bool|false|mixed|string
- */
- public static function detect($string)
- {
- $charset=mb_detect_encoding($string, array('ASCII', 'GB2312', 'GBK', 'UTF-8'),true);
- if(strtolower($charset)=='cp936')
- $charset='GBK';
- return $charset;
- }
-
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Services/HttpService.php b/vendor/jaeger/querylist/src/Services/HttpService.php
deleted file mode 100644
index 0d2cdec..0000000
--- a/vendor/jaeger/querylist/src/Services/HttpService.php
+++ /dev/null
@@ -1,59 +0,0 @@
-
- * Date: 2017/9/22
- */
-
-namespace QL\Services;
-
-use GuzzleHttp\Cookie\CookieJar;
-use Jaeger\GHttp;
-use QL\QueryList;
-
-class HttpService
-{
- protected static $cookieJar = null;
-
- public static function getCookieJar()
- {
- if(self::$cookieJar == null)
- {
- self::$cookieJar = new CookieJar();
- }
- return self::$cookieJar;
- }
-
- public static function get(QueryList $ql,$url,$args = null,$otherArgs = [])
- {
- $otherArgs = array_merge([
- 'cookies' => self::getCookieJar(),
- 'verify' => false
- ],$otherArgs);
- $html = GHttp::get($url,$args,$otherArgs);
- $ql->setHtml($html);
- return $ql;
- }
-
- public static function post(QueryList $ql,$url,$args = null,$otherArgs = [])
- {
- $otherArgs = array_merge([
- 'cookies' => self::getCookieJar(),
- 'verify' => false
- ],$otherArgs);
- $html = GHttp::post($url,$args,$otherArgs);
- $ql->setHtml($html);
- return $ql;
- }
-
- public static function postJson(QueryList $ql,$url,$args = null,$otherArgs = [])
- {
- $otherArgs = array_merge([
- 'cookies' => self::getCookieJar(),
- 'verify' => false
- ],$otherArgs);
- $html = GHttp::postJson($url,$args,$otherArgs);
- $ql->setHtml($html);
- return $ql;
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Services/MultiRequestService.php b/vendor/jaeger/querylist/src/Services/MultiRequestService.php
deleted file mode 100644
index 803ee80..0000000
--- a/vendor/jaeger/querylist/src/Services/MultiRequestService.php
+++ /dev/null
@@ -1,66 +0,0 @@
-
- * Date: 18/12/10
- * Time: 下午7:05
- */
-
-namespace QL\Services;
-
-
-use Jaeger\GHttp;
-use Closure;
-use GuzzleHttp\Psr7\Response;
-use QL\QueryList;
-use GuzzleHttp\Exception\RequestException;
-
-/**
- * Class MultiRequestService
- * @package QL\Services
- *
- * @method MultiRequestService withHeaders($headers)
- * @method MultiRequestService withOptions($options)
- * @method MultiRequestService concurrency($concurrency)
- */
-class MultiRequestService
-{
- protected $ql;
- protected $multiRequest;
- protected $method;
-
- public function __construct(QueryList $ql,$method,$urls)
- {
- $this->ql = $ql;
- $this->method = $method;
- $this->multiRequest = GHttp::multiRequest($urls);
- }
-
- public function __call($name, $arguments)
- {
- $this->multiRequest = $this->multiRequest->$name(...$arguments);
- return $this;
- }
-
- public function success(Closure $success)
- {
- $this->multiRequest = $this->multiRequest->success(function(Response $response, $index) use($success){
- $this->ql->setHtml((String)$response->getBody());
- $success($this->ql,$response, $index);
- });
- return $this;
- }
-
- public function error(Closure $error)
- {
- $this->multiRequest = $this->multiRequest->error(function(RequestException $reason, $index) use($error){
- $error($this->ql,$reason, $index);
- });
- return $this;
- }
-
- public function send()
- {
- $this->multiRequest->{$this->method}();
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/src/Services/PluginService.php b/vendor/jaeger/querylist/src/Services/PluginService.php
deleted file mode 100644
index 1afef3a..0000000
--- a/vendor/jaeger/querylist/src/Services/PluginService.php
+++ /dev/null
@@ -1,26 +0,0 @@
-
- * Date: 2017/9/22
- */
-
-namespace QL\Services;
-
-use QL\QueryList;
-
-class PluginService
-{
- public static function install(QueryList $queryList, $plugins, ...$opt)
- {
- if(is_array($plugins))
- {
- foreach ($plugins as $plugin) {
- $plugin::install($queryList);
- }
- }else{
- $plugins::install($queryList,...$opt);
- }
- return $queryList;
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/tests/Dom/FindTest.php b/vendor/jaeger/querylist/tests/Dom/FindTest.php
deleted file mode 100644
index 024df21..0000000
--- a/vendor/jaeger/querylist/tests/Dom/FindTest.php
+++ /dev/null
@@ -1,71 +0,0 @@
-html = $this->getSnippet('snippet-1');
- $this->ql = QueryList::html($this->html);
- }
-
- /**
- * @test
- */
- public function find_first_dom_attr()
- {
- $img = [];
- $img[] = $this->ql->find('img')->attr('src');
- $img[] = $this->ql->find('img')->src;
- $img[] = $this->ql->find('img:eq(0)')->src;
- $img[] = $this->ql->find('img')->eq(0)->src;
-
- $alt = $this->ql->find('img')->alt;
- $abc = $this->ql->find('img')->abc;
-
- $this->assertCount(1,array_unique($img));
- $this->assertEquals($alt,'这是图片');
- $this->assertEquals($abc,'这是一个自定义属性');
-
- }
-
- /**
- * @test
- */
- public function find_second_dom_attr()
- {
-
- $img2 = [];
- $img2[] = $this->ql->find('img')->eq(1)->alt;
- $img2[] = $this->ql->find('img:eq(1)')->alt;
- $img2[] = $this->ql->find('.second_pic')->alt;
-
- $this->assertCount(1,array_unique($img2));
-
- }
-
- /**
- * @test
- */
- public function find_dom_all_attr()
- {
- $imgAttr = $this->ql->find('img:eq(0)')->attr('*');
- $linkAttr = $this->ql->find('a:eq(1)')->attr('*');
- $this->assertCount(3,$imgAttr);
- $this->assertCount(1,$linkAttr);
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/tests/Dom/RulesTest.php b/vendor/jaeger/querylist/tests/Dom/RulesTest.php
deleted file mode 100644
index 7c555ca..0000000
--- a/vendor/jaeger/querylist/tests/Dom/RulesTest.php
+++ /dev/null
@@ -1,43 +0,0 @@
-
- * Date: 18/12/12
- * Time: 下午12:25
- */
-
-namespace Tests\Dom;
-
-
-use QL\QueryList;
-use Tests\TestCaseBase;
-use Tightenco\Collect\Support\Collection;
-
-class RulesTest extends TestCaseBase
-{
- protected $html;
- protected $ql;
-
- protected function setUp(): void
- {
- $this->html = $this->getSnippet('snippet-2');
- $this->ql = QueryList::html($this->html);
- }
-
- /**
- * @test
- */
- public function get_data_by_rules()
- {
- $rules = [
- 'a' => ['a','text'],
- 'img_src' => ['img','src'],
- 'img_alt' => ['img','alt']
- ];
- $range = 'ul>li';
- $data = QueryList::rules($rules)->range($range)->html($this->html)->query()->getData();
- $this->assertInstanceOf(Collection::class,$data);
- $this->assertCount(3,$data);
- $this->assertEquals('http://querylist.com/2.jpg',$data[1]['img_src']);
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/tests/Feature/HttpTest.php b/vendor/jaeger/querylist/tests/Feature/HttpTest.php
deleted file mode 100644
index 0d723ed..0000000
--- a/vendor/jaeger/querylist/tests/Feature/HttpTest.php
+++ /dev/null
@@ -1,103 +0,0 @@
-urls = [
- 'http://httpbin.org/get?name=php',
- 'http://httpbin.org/get?name=golang',
- 'http://httpbin.org/get?name=c++',
- 'http://httpbin.org/get?name=java'
- ];
- }
-
- /**
- * @test
- */
- public function can_post_json_data()
- {
- $mock = new MockHandler([new Response()]);
- $data = [
- 'name' => 'foo'
- ];
- QueryList::postJson('http://foo.com',$data,[
- 'handler' => $mock
- ]);
- $this->assertEquals((string)$mock->getLastRequest()->getBody(),json_encode($data));
- }
-
- /**
- * @test
- */
- public function concurrent_requests_base_use()
- {
- $urls = $this->urls;
- QueryList::getInstance()
- ->multiGet($urls)
- ->success(function(QueryList $ql,Response $response, $index) use($urls){
- $body = json_decode((string)$response->getBody(),true);
- $this->assertEquals($urls[$index],$body['url']);
- })->send();
- }
-
- /**
- * @test
- */
- public function concurrent_requests_advanced_use()
- {
- $ua = 'QueryList/4.0';
-
- $errorUrl = 'http://web-site-not-exist.com';
- $urls = array_merge($this->urls,[$errorUrl]);
-
- QueryList::rules([])
- ->multiGet($urls)
- ->concurrency(2)
- ->withOptions([
- 'timeout' => 60
- ])
- ->withHeaders([
- 'User-Agent' => $ua
- ])
- ->success(function (QueryList $ql, Response $response, $index) use($ua){
- $body = json_decode((string)$response->getBody(),true);
- $this->assertEquals($ua,$body['headers']['User-Agent']);
- })
- ->error(function (QueryList $ql, $reason, $index) use($urls,$errorUrl){
- $this->assertEquals($urls[$index],$errorUrl);
- })
- ->send();
- }
-
- /**
- * @test
- */
- public function request_with_cache()
- {
- $url = $this->urls[0];
- $data = QueryList::get($url,null,[
- 'cache' => sys_get_temp_dir(),
- 'cache_ttl' => 600
- ])->getHtml();
- $data = json_decode($data,true);
- $this->assertEquals($url,$data['url']);
-
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/tests/Feature/InstanceTest.php b/vendor/jaeger/querylist/tests/Feature/InstanceTest.php
deleted file mode 100644
index a659060..0000000
--- a/vendor/jaeger/querylist/tests/Feature/InstanceTest.php
+++ /dev/null
@@ -1,48 +0,0 @@
-html = $this->getSnippet('snippet-1');
- }
- /**
- * @test
- */
- public function singleton_instance_mode()
- {
- $ql = QueryList::getInstance()->html($this->html);
- $ql2 = QueryList::getInstance();
- $this->assertEquals($ql->getHtml(),$ql2->getHtml());
-
-
- }
-
- /**
- * @test
- */
- public function get_new_object()
- {
- $ql = (new QueryList())->html($this->html);
- $ql2 = (new QueryList())->html('');
- $this->assertNotEquals($ql->getHtml(),$ql2->getHtml());
-
- $ql = QueryList::range('')->html($this->html);
- $ql2 = QueryList::range('')->html('');
- $this->assertNotEquals($ql->getHtml(),$ql2->getHtml());
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/tests/Feature/MethodTest.php b/vendor/jaeger/querylist/tests/Feature/MethodTest.php
deleted file mode 100644
index ca10cf9..0000000
--- a/vendor/jaeger/querylist/tests/Feature/MethodTest.php
+++ /dev/null
@@ -1,36 +0,0 @@
-html = $this->getSnippet('snippet-1');
- }
-
- /**
- * @test
- */
- public function pipe()
- {
- $html = $this->html;
- $qlHtml = QueryList::pipe(function(QueryList $ql) use($html){
- $ql->setHtml($html);
- return $ql;
- })->getHtml(false);
- $this->assertEquals($html,$qlHtml);
- }
-}
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/tests/TestCaseBase.php b/vendor/jaeger/querylist/tests/TestCaseBase.php
deleted file mode 100644
index c88d73e..0000000
--- a/vendor/jaeger/querylist/tests/TestCaseBase.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
- 其它的一些 文本
-
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/tests/assets/snippet-2.html b/vendor/jaeger/querylist/tests/assets/snippet-2.html
deleted file mode 100644
index 88ae3f0..0000000
--- a/vendor/jaeger/querylist/tests/assets/snippet-2.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
\ No newline at end of file
diff --git a/vendor/jaeger/querylist/tests/bootstrap.php b/vendor/jaeger/querylist/tests/bootstrap.php
deleted file mode 100644
index eace7af..0000000
--- a/vendor/jaeger/querylist/tests/bootstrap.php
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-## Introduction
-
-> This project is a fork of the excellent [opis/closure: 3.x](https://github.com/opis/closure) package. At Laravel, we decided to fork this package as the upcoming version [4.x](https://github.com/opis/closure) is a complete rewrite on top of the [FFI extension](https://www.php.net/manual/en/book.ffi.php). As Laravel is a web framework, and FFI is not enabled by default in web requests, this fork allows us to keep using the `3.x` series while adding support for new PHP versions.
-
-Laravel Serializable Closure provides an easy and secure way to **serialize closures in PHP**.
-
-## Official Documentation
-
-### Installation
-
-> **Requires [PHP 7.4+](https://php.net/releases/)**
-
-First, install Laravel Serializable Closure via the [Composer](https://getcomposer.org/) package manager:
-
-```bash
-composer require laravel/serializable-closure
-```
-
-### Usage
-
-You may serialize a closure this way:
-
-```php
-use Laravel\SerializableClosure\SerializableClosure;
-
-$closure = fn () => 'james';
-
-// Recommended
-SerializableClosure::setSecretKey('secret');
-
-$serialized = serialize(new SerializableClosure($closure));
-$closure = unserialize($serialized)->getClosure();
-
-echo $closure(); // james;
-```
-
-### Caveats
-
-1. Creating **anonymous classes** within closures is not supported.
-2. Using attributes within closures is not supported.
-3. Serializing closures on REPL environments such as Laravel Tinker is not supported.
-
-## Contributing
-
-Thank you for considering contributing to Serializable Closure! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
-
-## Code of Conduct
-
-In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
-
-## Security Vulnerabilities
-
-Please review [our security policy](https://github.com/laravel/serializable-closure/security/policy) on how to report security vulnerabilities.
-
-## License
-
-Serializable Closure is open-sourced software licensed under the [MIT license](LICENSE.md).
diff --git a/vendor/laravel/serializable-closure/composer.json b/vendor/laravel/serializable-closure/composer.json
deleted file mode 100644
index 7142366..0000000
--- a/vendor/laravel/serializable-closure/composer.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "name": "laravel/serializable-closure",
- "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.",
- "keywords": ["laravel", "Serializable", "closure"],
- "license": "MIT",
- "support": {
- "issues": "https://github.com/laravel/serializable-closure/issues",
- "source": "https://github.com/laravel/serializable-closure"
- },
- "authors": [
- {
- "name": "Taylor Otwell",
- "email": "taylor@laravel.com"
- },
- {
- "name": "Nuno Maduro",
- "email": "nuno@laravel.com"
- }
- ],
- "require": {
- "php": "^7.3|^8.0"
- },
- "require-dev": {
- "nesbot/carbon": "^2.61",
- "pestphp/pest": "^1.21.3",
- "phpstan/phpstan": "^1.8.2",
- "symfony/var-dumper": "^5.4.11"
- },
- "autoload": {
- "psr-4": {
- "Laravel\\SerializableClosure\\": "src/"
- }
- },
- "autoload-dev": {
- "psr-4": {
- "Tests\\": "tests/"
- }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.x-dev"
- }
- },
- "config": {
- "sort-packages": true,
- "allow-plugins": {
- "pestphp/pest-plugin": true
- }
- },
- "minimum-stability": "dev",
- "prefer-stable": true
-}
diff --git a/vendor/laravel/serializable-closure/src/Contracts/Serializable.php b/vendor/laravel/serializable-closure/src/Contracts/Serializable.php
deleted file mode 100644
index 1a62922..0000000
--- a/vendor/laravel/serializable-closure/src/Contracts/Serializable.php
+++ /dev/null
@@ -1,20 +0,0 @@
-serializable = Serializers\Signed::$signer
- ? new Serializers\Signed($closure)
- : new Serializers\Native($closure);
- }
-
- /**
- * Resolve the closure with the given arguments.
- *
- * @return mixed
- */
- public function __invoke()
- {
- if (\PHP_VERSION_ID < 70400) {
- throw new PhpVersionNotSupportedException();
- }
-
- return call_user_func_array($this->serializable, func_get_args());
- }
-
- /**
- * Gets the closure.
- *
- * @return \Closure
- */
- public function getClosure()
- {
- if (\PHP_VERSION_ID < 70400) {
- throw new PhpVersionNotSupportedException();
- }
-
- return $this->serializable->getClosure();
- }
-
- /**
- * Create a new unsigned serializable closure instance.
- *
- * @param Closure $closure
- * @return \Laravel\SerializableClosure\UnsignedSerializableClosure
- */
- public static function unsigned(Closure $closure)
- {
- return new UnsignedSerializableClosure($closure);
- }
-
- /**
- * Sets the serializable closure secret key.
- *
- * @param string|null $secret
- * @return void
- */
- public static function setSecretKey($secret)
- {
- Serializers\Signed::$signer = $secret
- ? new Hmac($secret)
- : null;
- }
-
- /**
- * Sets the serializable closure secret key.
- *
- * @param \Closure|null $transformer
- * @return void
- */
- public static function transformUseVariablesUsing($transformer)
- {
- Serializers\Native::$transformUseVariables = $transformer;
- }
-
- /**
- * Sets the serializable closure secret key.
- *
- * @param \Closure|null $resolver
- * @return void
- */
- public static function resolveUseVariablesUsing($resolver)
- {
- Serializers\Native::$resolveUseVariables = $resolver;
- }
-
- /**
- * Get the serializable representation of the closure.
- *
- * @return array
- */
- public function __serialize()
- {
- return [
- 'serializable' => $this->serializable,
- ];
- }
-
- /**
- * Restore the closure after serialization.
- *
- * @param array $data
- * @return void
- *
- * @throws \Laravel\SerializableClosure\Exceptions\InvalidSignatureException
- */
- public function __unserialize($data)
- {
- if (Signed::$signer && ! $data['serializable'] instanceof Signed) {
- throw new InvalidSignatureException();
- }
-
- $this->serializable = $data['serializable'];
- }
-}
diff --git a/vendor/laravel/serializable-closure/src/Serializers/Native.php b/vendor/laravel/serializable-closure/src/Serializers/Native.php
deleted file mode 100644
index 4a04b98..0000000
--- a/vendor/laravel/serializable-closure/src/Serializers/Native.php
+++ /dev/null
@@ -1,514 +0,0 @@
-closure = $closure;
- }
-
- /**
- * Resolve the closure with the given arguments.
- *
- * @return mixed
- */
- public function __invoke()
- {
- return call_user_func_array($this->closure, func_get_args());
- }
-
- /**
- * Gets the closure.
- *
- * @return \Closure
- */
- public function getClosure()
- {
- return $this->closure;
- }
-
- /**
- * Get the serializable representation of the closure.
- *
- * @return array
- */
- public function __serialize()
- {
- if ($this->scope === null) {
- $this->scope = new ClosureScope();
- $this->scope->toSerialize++;
- }
-
- $this->scope->serializations++;
-
- $scope = $object = null;
- $reflector = $this->getReflector();
-
- if ($reflector->isBindingRequired()) {
- $object = $reflector->getClosureThis();
-
- static::wrapClosures($object, $this->scope);
- }
-
- if ($scope = $reflector->getClosureScopeClass()) {
- $scope = $scope->name;
- }
-
- $this->reference = spl_object_hash($this->closure);
-
- $this->scope[$this->closure] = $this;
-
- $use = $reflector->getUseVariables();
-
- if (static::$transformUseVariables) {
- $use = call_user_func(static::$transformUseVariables, $reflector->getUseVariables());
- }
-
- $code = $reflector->getCode();
-
- $this->mapByReference($use);
-
- $data = [
- 'use' => $use,
- 'function' => $code,
- 'scope' => $scope,
- 'this' => $object,
- 'self' => $this->reference,
- ];
-
- if (! --$this->scope->serializations && ! --$this->scope->toSerialize) {
- $this->scope = null;
- }
-
- return $data;
- }
-
- /**
- * Restore the closure after serialization.
- *
- * @param array $data
- * @return void
- */
- public function __unserialize($data)
- {
- ClosureStream::register();
-
- $this->code = $data;
- unset($data);
-
- $this->code['objects'] = [];
-
- if ($this->code['use']) {
- $this->scope = new ClosureScope();
-
- if (static::$resolveUseVariables) {
- $this->code['use'] = call_user_func(static::$resolveUseVariables, $this->code['use']);
- }
-
- $this->mapPointers($this->code['use']);
-
- extract($this->code['use'], EXTR_OVERWRITE | EXTR_REFS);
-
- $this->scope = null;
- }
-
- $this->closure = include ClosureStream::STREAM_PROTO.'://'.$this->code['function'];
-
- if ($this->code['this'] === $this) {
- $this->code['this'] = null;
- }
-
- $this->closure = $this->closure->bindTo($this->code['this'], $this->code['scope']);
-
- if (! empty($this->code['objects'])) {
- foreach ($this->code['objects'] as $item) {
- $item['property']->setValue($item['instance'], $item['object']->getClosure());
- }
- }
-
- $this->code = $this->code['function'];
- }
-
- /**
- * Ensures the given closures are serializable.
- *
- * @param mixed $data
- * @param \Laravel\SerializableClosure\Support\ClosureScope $storage
- * @return void
- */
- public static function wrapClosures(&$data, $storage)
- {
- if ($data instanceof Closure) {
- $data = new static($data);
- } elseif (is_array($data)) {
- if (isset($data[self::ARRAY_RECURSIVE_KEY])) {
- return;
- }
-
- $data[self::ARRAY_RECURSIVE_KEY] = true;
-
- foreach ($data as $key => &$value) {
- if ($key === self::ARRAY_RECURSIVE_KEY) {
- continue;
- }
- static::wrapClosures($value, $storage);
- }
-
- unset($value);
- unset($data[self::ARRAY_RECURSIVE_KEY]);
- } elseif ($data instanceof \stdClass) {
- if (isset($storage[$data])) {
- $data = $storage[$data];
-
- return;
- }
-
- $data = $storage[$data] = clone $data;
-
- foreach ($data as &$value) {
- static::wrapClosures($value, $storage);
- }
-
- unset($value);
- } elseif (is_object($data) && ! $data instanceof static && ! $data instanceof UnitEnum) {
- if (isset($storage[$data])) {
- $data = $storage[$data];
-
- return;
- }
-
- $instance = $data;
- $reflection = new ReflectionObject($instance);
-
- if (! $reflection->isUserDefined()) {
- $storage[$instance] = $data;
-
- return;
- }
-
- $storage[$instance] = $data = $reflection->newInstanceWithoutConstructor();
-
- do {
- if (! $reflection->isUserDefined()) {
- break;
- }
-
- foreach ($reflection->getProperties() as $property) {
- if ($property->isStatic() || ! $property->getDeclaringClass()->isUserDefined()) {
- continue;
- }
-
- $property->setAccessible(true);
-
- if (PHP_VERSION >= 7.4 && ! $property->isInitialized($instance)) {
- continue;
- }
-
- $value = $property->getValue($instance);
-
- if (is_array($value) || is_object($value)) {
- static::wrapClosures($value, $storage);
- }
-
- $property->setValue($data, $value);
- }
- } while ($reflection = $reflection->getParentClass());
- }
- }
-
- /**
- * Gets the closure's reflector.
- *
- * @return \Laravel\SerializableClosure\Support\ReflectionClosure
- */
- public function getReflector()
- {
- if ($this->reflector === null) {
- $this->code = null;
- $this->reflector = new ReflectionClosure($this->closure);
- }
-
- return $this->reflector;
- }
-
- /**
- * Internal method used to map closure pointers.
- *
- * @param mixed $data
- * @return void
- */
- protected function mapPointers(&$data)
- {
- $scope = $this->scope;
-
- if ($data instanceof static) {
- $data = &$data->closure;
- } elseif (is_array($data)) {
- if (isset($data[self::ARRAY_RECURSIVE_KEY])) {
- return;
- }
-
- $data[self::ARRAY_RECURSIVE_KEY] = true;
-
- foreach ($data as $key => &$value) {
- if ($key === self::ARRAY_RECURSIVE_KEY) {
- continue;
- } elseif ($value instanceof static) {
- $data[$key] = &$value->closure;
- } elseif ($value instanceof SelfReference && $value->hash === $this->code['self']) {
- $data[$key] = &$this->closure;
- } else {
- $this->mapPointers($value);
- }
- }
-
- unset($value);
- unset($data[self::ARRAY_RECURSIVE_KEY]);
- } elseif ($data instanceof \stdClass) {
- if (isset($scope[$data])) {
- return;
- }
-
- $scope[$data] = true;
-
- foreach ($data as $key => &$value) {
- if ($value instanceof SelfReference && $value->hash === $this->code['self']) {
- $data->{$key} = &$this->closure;
- } elseif (is_array($value) || is_object($value)) {
- $this->mapPointers($value);
- }
- }
-
- unset($value);
- } elseif (is_object($data) && ! ($data instanceof Closure)) {
- if (isset($scope[$data])) {
- return;
- }
-
- $scope[$data] = true;
- $reflection = new ReflectionObject($data);
-
- do {
- if (! $reflection->isUserDefined()) {
- break;
- }
-
- foreach ($reflection->getProperties() as $property) {
- if ($property->isStatic() || ! $property->getDeclaringClass()->isUserDefined()) {
- continue;
- }
-
- $property->setAccessible(true);
-
- if (PHP_VERSION >= 7.4 && ! $property->isInitialized($data)) {
- continue;
- }
-
- $item = $property->getValue($data);
-
- if ($item instanceof SerializableClosure || $item instanceof UnsignedSerializableClosure || ($item instanceof SelfReference && $item->hash === $this->code['self'])) {
- $this->code['objects'][] = [
- 'instance' => $data,
- 'property' => $property,
- 'object' => $item instanceof SelfReference ? $this : $item,
- ];
- } elseif (is_array($item) || is_object($item)) {
- $this->mapPointers($item);
- $property->setValue($data, $item);
- }
- }
- } while ($reflection = $reflection->getParentClass());
- }
- }
-
- /**
- * Internal method used to map closures by reference.
- *
- * @param mixed $data
- * @return void
- */
- protected function mapByReference(&$data)
- {
- if ($data instanceof Closure) {
- if ($data === $this->closure) {
- $data = new SelfReference($this->reference);
-
- return;
- }
-
- if (isset($this->scope[$data])) {
- $data = $this->scope[$data];
-
- return;
- }
-
- $instance = new static($data);
-
- $instance->scope = $this->scope;
-
- $data = $this->scope[$data] = $instance;
- } elseif (is_array($data)) {
- if (isset($data[self::ARRAY_RECURSIVE_KEY])) {
- return;
- }
-
- $data[self::ARRAY_RECURSIVE_KEY] = true;
-
- foreach ($data as $key => &$value) {
- if ($key === self::ARRAY_RECURSIVE_KEY) {
- continue;
- }
-
- $this->mapByReference($value);
- }
-
- unset($value);
- unset($data[self::ARRAY_RECURSIVE_KEY]);
- } elseif ($data instanceof \stdClass) {
- if (isset($this->scope[$data])) {
- $data = $this->scope[$data];
-
- return;
- }
-
- $instance = $data;
- $this->scope[$instance] = $data = clone $data;
-
- foreach ($data as &$value) {
- $this->mapByReference($value);
- }
-
- unset($value);
- } elseif (is_object($data) && ! $data instanceof SerializableClosure && ! $data instanceof UnsignedSerializableClosure) {
- if (isset($this->scope[$data])) {
- $data = $this->scope[$data];
-
- return;
- }
-
- $instance = $data;
-
- if ($data instanceof DateTimeInterface) {
- $this->scope[$instance] = $data;
-
- return;
- }
-
- if ($data instanceof UnitEnum) {
- $this->scope[$instance] = $data;
-
- return;
- }
-
- $reflection = new ReflectionObject($data);
-
- if (! $reflection->isUserDefined()) {
- $this->scope[$instance] = $data;
-
- return;
- }
-
- $this->scope[$instance] = $data = $reflection->newInstanceWithoutConstructor();
-
- do {
- if (! $reflection->isUserDefined()) {
- break;
- }
-
- foreach ($reflection->getProperties() as $property) {
- if ($property->isStatic() || ! $property->getDeclaringClass()->isUserDefined()) {
- continue;
- }
-
- $property->setAccessible(true);
-
- if (PHP_VERSION >= 7.4 && ! $property->isInitialized($instance)) {
- continue;
- }
-
- $value = $property->getValue($instance);
-
- if (is_array($value) || is_object($value)) {
- $this->mapByReference($value);
- }
-
- $property->setValue($data, $value);
- }
- } while ($reflection = $reflection->getParentClass());
- }
- }
-}
diff --git a/vendor/laravel/serializable-closure/src/Serializers/Signed.php b/vendor/laravel/serializable-closure/src/Serializers/Signed.php
deleted file mode 100644
index 391d20d..0000000
--- a/vendor/laravel/serializable-closure/src/Serializers/Signed.php
+++ /dev/null
@@ -1,91 +0,0 @@
-closure = $closure;
- }
-
- /**
- * Resolve the closure with the given arguments.
- *
- * @return mixed
- */
- public function __invoke()
- {
- return call_user_func_array($this->closure, func_get_args());
- }
-
- /**
- * Gets the closure.
- *
- * @return \Closure
- */
- public function getClosure()
- {
- return $this->closure;
- }
-
- /**
- * Get the serializable representation of the closure.
- *
- * @return array
- */
- public function __serialize()
- {
- if (! static::$signer) {
- throw new MissingSecretKeyException();
- }
-
- return static::$signer->sign(
- serialize(new Native($this->closure))
- );
- }
-
- /**
- * Restore the closure after serialization.
- *
- * @param array $signature
- * @return void
- *
- * @throws \Laravel\SerializableClosure\Exceptions\InvalidSignatureException
- */
- public function __unserialize($signature)
- {
- if (static::$signer && ! static::$signer->verify($signature)) {
- throw new InvalidSignatureException();
- }
-
- /** @var \Laravel\SerializableClosure\Contracts\Serializable $serializable */
- $serializable = unserialize($signature['serializable']);
-
- $this->closure = $serializable->getClosure();
- }
-}
diff --git a/vendor/laravel/serializable-closure/src/Signers/Hmac.php b/vendor/laravel/serializable-closure/src/Signers/Hmac.php
deleted file mode 100644
index d94b0a2..0000000
--- a/vendor/laravel/serializable-closure/src/Signers/Hmac.php
+++ /dev/null
@@ -1,53 +0,0 @@
-secret = $secret;
- }
-
- /**
- * Sign the given serializable.
- *
- * @param string $serialized
- * @return array
- */
- public function sign($serialized)
- {
- return [
- 'serializable' => $serialized,
- 'hash' => base64_encode(hash_hmac('sha256', $serialized, $this->secret, true)),
- ];
- }
-
- /**
- * Verify the given signature.
- *
- * @param array $signature
- * @return bool
- */
- public function verify($signature)
- {
- return hash_equals(base64_encode(
- hash_hmac('sha256', $signature['serializable'], $this->secret, true)
- ), $signature['hash']);
- }
-}
diff --git a/vendor/laravel/serializable-closure/src/Support/ClosureScope.php b/vendor/laravel/serializable-closure/src/Support/ClosureScope.php
deleted file mode 100644
index 64ca19a..0000000
--- a/vendor/laravel/serializable-closure/src/Support/ClosureScope.php
+++ /dev/null
@@ -1,22 +0,0 @@
-content = "length = strlen($this->content);
-
- return true;
- }
-
- /**
- * Read from stream.
- *
- * @param int $count
- * @return string
- */
- public function stream_read($count)
- {
- $value = substr($this->content, $this->pointer, $count);
-
- $this->pointer += $count;
-
- return $value;
- }
-
- /**
- * Tests for end-of-file on a file pointer.
- *
- * @return bool
- */
- public function stream_eof()
- {
- return $this->pointer >= $this->length;
- }
-
- /**
- * Change stream options.
- *
- * @param int $option
- * @param int $arg1
- * @param int $arg2
- * @return bool
- */
- public function stream_set_option($option, $arg1, $arg2)
- {
- return false;
- }
-
- /**
- * Retrieve information about a file resource.
- *
- * @return array|bool
- */
- public function stream_stat()
- {
- $stat = stat(__FILE__);
- // @phpstan-ignore-next-line
- $stat[7] = $stat['size'] = $this->length;
-
- return $stat;
- }
-
- /**
- * Retrieve information about a file.
- *
- * @param string $path
- * @param int $flags
- * @return array|bool
- */
- public function url_stat($path, $flags)
- {
- $stat = stat(__FILE__);
- // @phpstan-ignore-next-line
- $stat[7] = $stat['size'] = $this->length;
-
- return $stat;
- }
-
- /**
- * Seeks to specific location in a stream.
- *
- * @param int $offset
- * @param int $whence
- * @return bool
- */
- public function stream_seek($offset, $whence = SEEK_SET)
- {
- $crt = $this->pointer;
-
- switch ($whence) {
- case SEEK_SET:
- $this->pointer = $offset;
- break;
- case SEEK_CUR:
- $this->pointer += $offset;
- break;
- case SEEK_END:
- $this->pointer = $this->length + $offset;
- break;
- }
-
- if ($this->pointer < 0 || $this->pointer >= $this->length) {
- $this->pointer = $crt;
-
- return false;
- }
-
- return true;
- }
-
- /**
- * Retrieve the current position of a stream.
- *
- * @return int
- */
- public function stream_tell()
- {
- return $this->pointer;
- }
-
- /**
- * Registers the stream.
- *
- * @return void
- */
- public static function register()
- {
- if (! static::$isRegistered) {
- static::$isRegistered = stream_wrapper_register(static::STREAM_PROTO, __CLASS__);
- }
- }
-}
diff --git a/vendor/laravel/serializable-closure/src/Support/ReflectionClosure.php b/vendor/laravel/serializable-closure/src/Support/ReflectionClosure.php
deleted file mode 100644
index a0d3707..0000000
--- a/vendor/laravel/serializable-closure/src/Support/ReflectionClosure.php
+++ /dev/null
@@ -1,1195 +0,0 @@
-isStaticClosure === null) {
- $this->isStaticClosure = strtolower(substr($this->getCode(), 0, 6)) === 'static';
- }
-
- return $this->isStaticClosure;
- }
-
- /**
- * Checks if the closure is a "short closure".
- *
- * @return bool
- */
- public function isShortClosure()
- {
- if ($this->isShortClosure === null) {
- $code = $this->getCode();
-
- if ($this->isStatic()) {
- $code = substr($code, 6);
- }
-
- $this->isShortClosure = strtolower(substr(trim($code), 0, 2)) === 'fn';
- }
-
- return $this->isShortClosure;
- }
-
- /**
- * Get the closure's code.
- *
- * @return string
- */
- public function getCode()
- {
- if ($this->code !== null) {
- return $this->code;
- }
-
- $fileName = $this->getFileName();
- $line = $this->getStartLine() - 1;
-
- $className = null;
-
- if (null !== $className = $this->getClosureScopeClass()) {
- $className = '\\'.trim($className->getName(), '\\');
- }
-
- $builtin_types = self::getBuiltinTypes();
- $class_keywords = ['self', 'static', 'parent'];
-
- $ns = $this->getClosureNamespaceName();
- $nsf = $ns == '' ? '' : ($ns[0] == '\\' ? $ns : '\\'.$ns);
-
- $_file = var_export($fileName, true);
- $_dir = var_export(dirname($fileName), true);
- $_namespace = var_export($ns, true);
- $_class = var_export(trim($className ?: '', '\\'), true);
- $_function = $ns.($ns == '' ? '' : '\\').'{closure}';
- $_method = ($className == '' ? '' : trim($className, '\\').'::').$_function;
- $_function = var_export($_function, true);
- $_method = var_export($_method, true);
- $_trait = null;
-
- $tokens = $this->getTokens();
- $state = $lastState = 'start';
- $inside_structure = false;
- $isFirstClassCallable = false;
- $isShortClosure = false;
-
- $inside_structure_mark = 0;
- $open = 0;
- $code = '';
- $id_start = $id_start_ci = $id_name = $context = '';
- $classes = $functions = $constants = null;
- $use = [];
- $lineAdd = 0;
- $isUsingScope = false;
- $isUsingThisObject = false;
-
- for ($i = 0, $l = count($tokens); $i < $l; $i++) {
- $token = $tokens[$i];
-
- switch ($state) {
- case 'start':
- if ($token[0] === T_FUNCTION || $token[0] === T_STATIC) {
- $code .= $token[1];
-
- $state = $token[0] === T_FUNCTION ? 'function' : 'static';
- } elseif ($token[0] === T_FN) {
- $isShortClosure = true;
- $code .= $token[1];
- $state = 'closure_args';
- } elseif ($token[0] === T_PUBLIC || $token[0] === T_PROTECTED || $token[0] === T_PRIVATE) {
- $code = '';
- $isFirstClassCallable = true;
- }
- break;
- case 'static':
- if ($token[0] === T_WHITESPACE || $token[0] === T_COMMENT || $token[0] === T_FUNCTION) {
- $code .= $token[1];
- if ($token[0] === T_FUNCTION) {
- $state = 'function';
- }
- } elseif ($token[0] === T_FN) {
- $isShortClosure = true;
- $code .= $token[1];
- $state = 'closure_args';
- } else {
- $code = '';
- $state = 'start';
- }
- break;
- case 'function':
- switch ($token[0]) {
- case T_STRING:
- if ($isFirstClassCallable) {
- $state = 'closure_args';
- break;
- }
-
- $code = '';
- $state = 'named_function';
- break;
- case '(':
- $code .= '(';
- $state = 'closure_args';
- break;
- default:
- $code .= is_array($token) ? $token[1] : $token;
- }
- break;
- case 'named_function':
- if ($token[0] === T_FUNCTION || $token[0] === T_STATIC) {
- $code = $token[1];
- $state = $token[0] === T_FUNCTION ? 'function' : 'static';
- } elseif ($token[0] === T_FN) {
- $isShortClosure = true;
- $code .= $token[1];
- $state = 'closure_args';
- }
- break;
- case 'closure_args':
- switch ($token[0]) {
- case T_NAME_QUALIFIED:
- [$id_start, $id_start_ci, $id_name] = $this->parseNameQualified($token[1]);
- $context = 'args';
- $state = 'id_name';
- $lastState = 'closure_args';
- break;
- case T_NS_SEPARATOR:
- case T_STRING:
- $id_start = $token[1];
- $id_start_ci = strtolower($id_start);
- $id_name = '';
- $context = 'args';
- $state = 'id_name';
- $lastState = 'closure_args';
- break;
- case T_USE:
- $code .= $token[1];
- $state = 'use';
- break;
- case T_DOUBLE_ARROW:
- $code .= $token[1];
- if ($isShortClosure) {
- $state = 'closure';
- }
- break;
- case ':':
- $code .= ':';
- $state = 'return';
- break;
- case '{':
- $code .= '{';
- $state = 'closure';
- $open++;
- break;
- default:
- $code .= is_array($token) ? $token[1] : $token;
- }
- break;
- case 'use':
- switch ($token[0]) {
- case T_VARIABLE:
- $use[] = substr($token[1], 1);
- $code .= $token[1];
- break;
- case '{':
- $code .= '{';
- $state = 'closure';
- $open++;
- break;
- case ':':
- $code .= ':';
- $state = 'return';
- break;
- default:
- $code .= is_array($token) ? $token[1] : $token;
- break;
- }
- break;
- case 'return':
- switch ($token[0]) {
- case T_WHITESPACE:
- case T_COMMENT:
- case T_DOC_COMMENT:
- $code .= $token[1];
- break;
- case T_NS_SEPARATOR:
- case T_STRING:
- $id_start = $token[1];
- $id_start_ci = strtolower($id_start);
- $id_name = '';
- $context = 'return_type';
- $state = 'id_name';
- $lastState = 'return';
- break 2;
- case T_NAME_QUALIFIED:
- [$id_start, $id_start_ci, $id_name] = $this->parseNameQualified($token[1]);
- $context = 'return_type';
- $state = 'id_name';
- $lastState = 'return';
- break 2;
- case T_DOUBLE_ARROW:
- $code .= $token[1];
- if ($isShortClosure) {
- $state = 'closure';
- }
- break;
- case '{':
- $code .= '{';
- $state = 'closure';
- $open++;
- break;
- default:
- $code .= is_array($token) ? $token[1] : $token;
- break;
- }
- break;
- case 'closure':
- switch ($token[0]) {
- case T_CURLY_OPEN:
- case T_DOLLAR_OPEN_CURLY_BRACES:
- case '{':
- $code .= is_array($token) ? $token[1] : $token;
- $open++;
- break;
- case '}':
- $code .= '}';
- if (--$open === 0 && ! $isShortClosure) {
- break 3;
- } elseif ($inside_structure) {
- $inside_structure = ! ($open === $inside_structure_mark);
- }
- break;
- case '(':
- case '[':
- $code .= $token[0];
- if ($isShortClosure) {
- $open++;
- }
- break;
- case ')':
- case ']':
- if ($isShortClosure) {
- if ($open === 0) {
- break 3;
- }
- $open--;
- }
- $code .= $token[0];
- break;
- case ',':
- case ';':
- if ($isShortClosure && $open === 0) {
- break 3;
- }
- $code .= $token[0];
- break;
- case T_LINE:
- $code .= $token[2] - $line + $lineAdd;
- break;
- case T_FILE:
- $code .= $_file;
- break;
- case T_DIR:
- $code .= $_dir;
- break;
- case T_NS_C:
- $code .= $_namespace;
- break;
- case T_CLASS_C:
- $code .= $inside_structure ? $token[1] : $_class;
- break;
- case T_FUNC_C:
- $code .= $inside_structure ? $token[1] : $_function;
- break;
- case T_METHOD_C:
- $code .= $inside_structure ? $token[1] : $_method;
- break;
- case T_COMMENT:
- if (substr($token[1], 0, 8) === '#trackme') {
- $timestamp = time();
- $code .= '/**'.PHP_EOL;
- $code .= '* Date : '.date(DATE_W3C, $timestamp).PHP_EOL;
- $code .= '* Timestamp : '.$timestamp.PHP_EOL;
- $code .= '* Line : '.($line + 1).PHP_EOL;
- $code .= '* File : '.$_file.PHP_EOL.'*/'.PHP_EOL;
- $lineAdd += 5;
- } else {
- $code .= $token[1];
- }
- break;
- case T_VARIABLE:
- if ($token[1] == '$this' && ! $inside_structure) {
- $isUsingThisObject = true;
- }
- $code .= $token[1];
- break;
- case T_STATIC:
- case T_NS_SEPARATOR:
- case T_STRING:
- $id_start = $token[1];
- $id_start_ci = strtolower($id_start);
- $id_name = '';
- $context = 'root';
- $state = 'id_name';
- $lastState = 'closure';
- break 2;
- case T_NAME_QUALIFIED:
- [$id_start, $id_start_ci, $id_name] = $this->parseNameQualified($token[1]);
- $context = 'root';
- $state = 'id_name';
- $lastState = 'closure';
- break 2;
- case T_NEW:
- $code .= $token[1];
- $context = 'new';
- $state = 'id_start';
- $lastState = 'closure';
- break 2;
- case T_USE:
- $code .= $token[1];
- $context = 'use';
- $state = 'id_start';
- $lastState = 'closure';
- break;
- case T_INSTANCEOF:
- case T_INSTEADOF:
- $code .= $token[1];
- $context = 'instanceof';
- $state = 'id_start';
- $lastState = 'closure';
- break;
- case T_OBJECT_OPERATOR:
- case T_NULLSAFE_OBJECT_OPERATOR:
- case T_DOUBLE_COLON:
- $code .= $token[1];
- $lastState = 'closure';
- $state = 'ignore_next';
- break;
- case T_FUNCTION:
- $code .= $token[1];
- $state = 'closure_args';
- if (! $inside_structure) {
- $inside_structure = true;
- $inside_structure_mark = $open;
- }
- break;
- case T_TRAIT_C:
- if ($_trait === null) {
- $startLine = $this->getStartLine();
- $endLine = $this->getEndLine();
- $structures = $this->getStructures();
-
- $_trait = '';
-
- foreach ($structures as &$struct) {
- if ($struct['type'] === 'trait' &&
- $struct['start'] <= $startLine &&
- $struct['end'] >= $endLine
- ) {
- $_trait = ($ns == '' ? '' : $ns.'\\').$struct['name'];
- break;
- }
- }
-
- $_trait = var_export($_trait, true);
- }
-
- $code .= $_trait;
- break;
- default:
- $code .= is_array($token) ? $token[1] : $token;
- }
- break;
- case 'ignore_next':
- switch ($token[0]) {
- case T_WHITESPACE:
- case T_COMMENT:
- case T_DOC_COMMENT:
- $code .= $token[1];
- break;
- case T_CLASS:
- case T_NEW:
- case T_STATIC:
- case T_VARIABLE:
- case T_STRING:
- case T_CLASS_C:
- case T_FILE:
- case T_DIR:
- case T_METHOD_C:
- case T_FUNC_C:
- case T_FUNCTION:
- case T_INSTANCEOF:
- case T_LINE:
- case T_NS_C:
- case T_TRAIT_C:
- case T_USE:
- $code .= $token[1];
- $state = $lastState;
- break;
- default:
- $state = $lastState;
- $i--;
- }
- break;
- case 'id_start':
- switch ($token[0]) {
- case T_WHITESPACE:
- case T_COMMENT:
- case T_DOC_COMMENT:
- $code .= $token[1];
- break;
- case T_NS_SEPARATOR:
- case T_NAME_FULLY_QUALIFIED:
- case T_STRING:
- case T_STATIC:
- $id_start = $token[1];
- $id_start_ci = strtolower($id_start);
- $id_name = '';
- $state = 'id_name';
- break 2;
- case T_NAME_QUALIFIED:
- [$id_start, $id_start_ci, $id_name] = $this->parseNameQualified($token[1]);
- $state = 'id_name';
- break 2;
- case T_VARIABLE:
- $code .= $token[1];
- $state = $lastState;
- break;
- case T_CLASS:
- $code .= $token[1];
- $state = 'anonymous';
- break;
- default:
- $i--; //reprocess last
- $state = 'id_name';
- }
- break;
- case 'id_name':
- switch ($token[0]) {
- // named arguments...
- case ':':
- if ($lastState === 'closure' && $context === 'root') {
- $state = 'ignore_next';
- $lastState = 'closure';
- $code .= $id_start.$token;
- }
-
- break;
- case T_NAME_QUALIFIED:
- case T_NS_SEPARATOR:
- case T_STRING:
- case T_WHITESPACE:
- case T_COMMENT:
- case T_DOC_COMMENT:
- $id_name .= $token[1];
- break;
- case '(':
- if ($isShortClosure) {
- $open++;
- }
- if ($context === 'new' || false !== strpos($id_name, '\\')) {
- if ($id_start_ci === 'self' || $id_start_ci === 'static') {
- if (! $inside_structure) {
- $isUsingScope = true;
- }
- } elseif ($id_start !== '\\' && ! in_array($id_start_ci, $class_keywords)) {
- if ($classes === null) {
- $classes = $this->getClasses();
- }
- if (isset($classes[$id_start_ci])) {
- $id_start = $classes[$id_start_ci];
- }
- if ($id_start[0] !== '\\') {
- $id_start = $nsf.'\\'.$id_start;
- }
- }
- } else {
- if ($id_start !== '\\') {
- if ($functions === null) {
- $functions = $this->getFunctions();
- }
- if (isset($functions[$id_start_ci])) {
- $id_start = $functions[$id_start_ci];
- } elseif ($nsf !== '\\' && function_exists($nsf.'\\'.$id_start)) {
- $id_start = $nsf.'\\'.$id_start;
- // Cache it to functions array
- $functions[$id_start_ci] = $id_start;
- }
- }
- }
- $code .= $id_start.$id_name.'(';
- $state = $lastState;
- break;
- case T_VARIABLE:
- case T_DOUBLE_COLON:
- if ($id_start !== '\\') {
- if ($id_start_ci === 'self' || $id_start_ci === 'parent') {
- if (! $inside_structure) {
- $isUsingScope = true;
- }
- } elseif ($id_start_ci === 'static') {
- if (! $inside_structure) {
- $isUsingScope = $token[0] === T_DOUBLE_COLON;
- }
- } elseif (! (\PHP_MAJOR_VERSION >= 7 && in_array($id_start_ci, $builtin_types))) {
- if ($classes === null) {
- $classes = $this->getClasses();
- }
- if (isset($classes[$id_start_ci])) {
- $id_start = $classes[$id_start_ci];
- }
- if ($id_start[0] !== '\\') {
- $id_start = $nsf.'\\'.$id_start;
- }
- }
- }
-
- $code .= $id_start.$id_name.$token[1];
- $state = $token[0] === T_DOUBLE_COLON ? 'ignore_next' : $lastState;
- break;
- default:
- if ($id_start !== '\\' && ! defined($id_start)) {
- if ($constants === null) {
- $constants = $this->getConstants();
- }
- if (isset($constants[$id_start])) {
- $id_start = $constants[$id_start];
- } elseif ($context === 'new') {
- if (in_array($id_start_ci, $class_keywords)) {
- if (! $inside_structure) {
- $isUsingScope = true;
- }
- } else {
- if ($classes === null) {
- $classes = $this->getClasses();
- }
- if (isset($classes[$id_start_ci])) {
- $id_start = $classes[$id_start_ci];
- }
- if ($id_start[0] !== '\\') {
- $id_start = $nsf.'\\'.$id_start;
- }
- }
- } elseif ($context === 'use' ||
- $context === 'instanceof' ||
- $context === 'args' ||
- $context === 'return_type' ||
- $context === 'extends' ||
- $context === 'root'
- ) {
- if (in_array($id_start_ci, $class_keywords)) {
- if (! $inside_structure && ! $id_start_ci === 'static') {
- $isUsingScope = true;
- }
- } elseif (! (\PHP_MAJOR_VERSION >= 7 && in_array($id_start_ci, $builtin_types))) {
- if ($classes === null) {
- $classes = $this->getClasses();
- }
- if (isset($classes[$id_start_ci])) {
- $id_start = $classes[$id_start_ci];
- }
- if ($id_start[0] !== '\\') {
- $id_start = $nsf.'\\'.$id_start;
- }
- }
- }
- }
- $code .= $id_start.$id_name;
- $state = $lastState;
- $i--; //reprocess last token
- }
- break;
- case 'anonymous':
- switch ($token[0]) {
- case T_NS_SEPARATOR:
- case T_STRING:
- $id_start = $token[1];
- $id_start_ci = strtolower($id_start);
- $id_name = '';
- $state = 'id_name';
- $context = 'extends';
- $lastState = 'anonymous';
- break;
- case '{':
- $state = 'closure';
- if (! $inside_structure) {
- $inside_structure = true;
- $inside_structure_mark = $open;
- }
- $i--;
- break;
- default:
- $code .= is_array($token) ? $token[1] : $token;
- }
- break;
- }
- }
-
- if ($isShortClosure) {
- $this->useVariables = $this->getStaticVariables();
- } else {
- $this->useVariables = empty($use) ? $use : array_intersect_key($this->getStaticVariables(), array_flip($use));
- }
-
- $this->isShortClosure = $isShortClosure;
- $this->isBindingRequired = $isUsingThisObject;
- $this->isScopeRequired = $isUsingScope;
-
- if (PHP_VERSION_ID >= 80100) {
- $attributesCode = array_map(function ($attribute) {
- $arguments = $attribute->getArguments();
-
- $name = $attribute->getName();
- $arguments = implode(', ', array_map(function ($argument, $key) {
- $argument = sprintf("'%s'", str_replace("'", "\\'", $argument));
-
- if (is_string($key)) {
- $argument = sprintf('%s: %s', $key, $argument);
- }
-
- return $argument;
- }, $arguments, array_keys($arguments)));
-
- return "#[$name($arguments)]";
- }, $this->getAttributes());
-
- if (! empty($attributesCode)) {
- $code = implode("\n", array_merge($attributesCode, [$code]));
- }
- }
-
- $this->code = $code;
-
- return $this->code;
- }
-
- /**
- * Get PHP native built in types.
- *
- * @return array
- */
- protected static function getBuiltinTypes()
- {
- // PHP 8.1
- if (PHP_VERSION_ID >= 80100) {
- return ['array', 'callable', 'string', 'int', 'bool', 'float', 'iterable', 'void', 'object', 'mixed', 'false', 'null', 'never'];
- }
-
- // PHP 8
- if (\PHP_MAJOR_VERSION === 8) {
- return ['array', 'callable', 'string', 'int', 'bool', 'float', 'iterable', 'void', 'object', 'mixed', 'false', 'null'];
- }
-
- // PHP 7
- switch (\PHP_MINOR_VERSION) {
- case 0:
- return ['array', 'callable', 'string', 'int', 'bool', 'float'];
- case 1:
- return ['array', 'callable', 'string', 'int', 'bool', 'float', 'iterable', 'void'];
- default:
- return ['array', 'callable', 'string', 'int', 'bool', 'float', 'iterable', 'void', 'object'];
- }
- }
-
- /**
- * Gets the use variables by the closure.
- *
- * @return array
- */
- public function getUseVariables()
- {
- if ($this->useVariables !== null) {
- return $this->useVariables;
- }
-
- $tokens = $this->getTokens();
- $use = [];
- $state = 'start';
-
- foreach ($tokens as &$token) {
- $is_array = is_array($token);
-
- switch ($state) {
- case 'start':
- if ($is_array && $token[0] === T_USE) {
- $state = 'use';
- }
- break;
- case 'use':
- if ($is_array) {
- if ($token[0] === T_VARIABLE) {
- $use[] = substr($token[1], 1);
- }
- } elseif ($token == ')') {
- break 2;
- }
- break;
- }
- }
-
- $this->useVariables = empty($use) ? $use : array_intersect_key($this->getStaticVariables(), array_flip($use));
-
- return $this->useVariables;
- }
-
- /**
- * Checks if binding is required.
- *
- * @return bool
- */
- public function isBindingRequired()
- {
- if ($this->isBindingRequired === null) {
- $this->getCode();
- }
-
- return $this->isBindingRequired;
- }
-
- /**
- * Checks if access to the scope is required.
- *
- * @return bool
- */
- public function isScopeRequired()
- {
- if ($this->isScopeRequired === null) {
- $this->getCode();
- }
-
- return $this->isScopeRequired;
- }
-
- /**
- * The the hash of the current file name.
- *
- * @return string
- */
- protected function getHashedFileName()
- {
- if ($this->hashedName === null) {
- $this->hashedName = sha1($this->getFileName());
- }
-
- return $this->hashedName;
- }
-
- /**
- * Get the file tokens.
- *
- * @return array
- */
- protected function getFileTokens()
- {
- $key = $this->getHashedFileName();
-
- if (! isset(static::$files[$key])) {
- static::$files[$key] = token_get_all(file_get_contents($this->getFileName()));
- }
-
- return static::$files[$key];
- }
-
- /**
- * Get the tokens.
- *
- * @return array
- */
- protected function getTokens()
- {
- if ($this->tokens === null) {
- $tokens = $this->getFileTokens();
- $startLine = $this->getStartLine();
- $endLine = $this->getEndLine();
- $results = [];
- $start = false;
-
- foreach ($tokens as &$token) {
- if (! is_array($token)) {
- if ($start) {
- $results[] = $token;
- }
-
- continue;
- }
-
- $line = $token[2];
-
- if ($line <= $endLine) {
- if ($line >= $startLine) {
- $start = true;
- $results[] = $token;
- }
-
- continue;
- }
-
- break;
- }
-
- $this->tokens = $results;
- }
-
- return $this->tokens;
- }
-
- /**
- * Get the classes.
- *
- * @return array
- */
- protected function getClasses()
- {
- $key = $this->getHashedFileName();
-
- if (! isset(static::$classes[$key])) {
- $this->fetchItems();
- }
-
- return static::$classes[$key];
- }
-
- /**
- * Get the functions.
- *
- * @return array
- */
- protected function getFunctions()
- {
- $key = $this->getHashedFileName();
-
- if (! isset(static::$functions[$key])) {
- $this->fetchItems();
- }
-
- return static::$functions[$key];
- }
-
- /**
- * Gets the constants.
- *
- * @return array
- */
- protected function getConstants()
- {
- $key = $this->getHashedFileName();
-
- if (! isset(static::$constants[$key])) {
- $this->fetchItems();
- }
-
- return static::$constants[$key];
- }
-
- /**
- * Get the structures.
- *
- * @return array
- */
- protected function getStructures()
- {
- $key = $this->getHashedFileName();
-
- if (! isset(static::$structures[$key])) {
- $this->fetchItems();
- }
-
- return static::$structures[$key];
- }
-
- /**
- * Fetch the items.
- *
- * @return void.
- */
- protected function fetchItems()
- {
- $key = $this->getHashedFileName();
-
- $classes = [];
- $functions = [];
- $constants = [];
- $structures = [];
- $tokens = $this->getFileTokens();
-
- $open = 0;
- $state = 'start';
- $lastState = '';
- $prefix = '';
- $name = '';
- $alias = '';
- $isFunc = $isConst = false;
-
- $startLine = $endLine = 0;
- $structType = $structName = '';
- $structIgnore = false;
-
- foreach ($tokens as $token) {
- switch ($state) {
- case 'start':
- switch ($token[0]) {
- case T_CLASS:
- case T_INTERFACE:
- case T_TRAIT:
- $state = 'before_structure';
- $startLine = $token[2];
- $structType = $token[0] == T_CLASS
- ? 'class'
- : ($token[0] == T_INTERFACE ? 'interface' : 'trait');
- break;
- case T_USE:
- $state = 'use';
- $prefix = $name = $alias = '';
- $isFunc = $isConst = false;
- break;
- case T_FUNCTION:
- $state = 'structure';
- $structIgnore = true;
- break;
- case T_NEW:
- $state = 'new';
- break;
- case T_OBJECT_OPERATOR:
- case T_DOUBLE_COLON:
- $state = 'invoke';
- break;
- }
- break;
- case 'use':
- switch ($token[0]) {
- case T_FUNCTION:
- $isFunc = true;
- break;
- case T_CONST:
- $isConst = true;
- break;
- case T_NS_SEPARATOR:
- $name .= $token[1];
- break;
- case T_STRING:
- $name .= $token[1];
- $alias = $token[1];
- break;
- case T_NAME_QUALIFIED:
- $name .= $token[1];
- $pieces = explode('\\', $token[1]);
- $alias = end($pieces);
- break;
- case T_AS:
- $lastState = 'use';
- $state = 'alias';
- break;
- case '{':
- $prefix = $name;
- $name = $alias = '';
- $state = 'use-group';
- break;
- case ',':
- case ';':
- if ($name === '' || $name[0] !== '\\') {
- $name = '\\'.$name;
- }
-
- if ($alias !== '') {
- if ($isFunc) {
- $functions[strtolower($alias)] = $name;
- } elseif ($isConst) {
- $constants[$alias] = $name;
- } else {
- $classes[strtolower($alias)] = $name;
- }
- }
- $name = $alias = '';
- $state = $token === ';' ? 'start' : 'use';
- break;
- }
- break;
- case 'use-group':
- switch ($token[0]) {
- case T_NS_SEPARATOR:
- $name .= $token[1];
- break;
- case T_NAME_QUALIFIED:
- $name .= $token[1];
- $pieces = explode('\\', $token[1]);
- $alias = end($pieces);
- break;
- case T_STRING:
- $name .= $token[1];
- $alias = $token[1];
- break;
- case T_AS:
- $lastState = 'use-group';
- $state = 'alias';
- break;
- case ',':
- case '}':
-
- if ($prefix === '' || $prefix[0] !== '\\') {
- $prefix = '\\'.$prefix;
- }
-
- if ($alias !== '') {
- if ($isFunc) {
- $functions[strtolower($alias)] = $prefix.$name;
- } elseif ($isConst) {
- $constants[$alias] = $prefix.$name;
- } else {
- $classes[strtolower($alias)] = $prefix.$name;
- }
- }
- $name = $alias = '';
- $state = $token === '}' ? 'use' : 'use-group';
- break;
- }
- break;
- case 'alias':
- if ($token[0] === T_STRING) {
- $alias = $token[1];
- $state = $lastState;
- }
- break;
- case 'new':
- switch ($token[0]) {
- case T_WHITESPACE:
- case T_COMMENT:
- case T_DOC_COMMENT:
- break 2;
- case T_CLASS:
- $state = 'structure';
- $structIgnore = true;
- break;
- default:
- $state = 'start';
- }
- break;
- case 'invoke':
- switch ($token[0]) {
- case T_WHITESPACE:
- case T_COMMENT:
- case T_DOC_COMMENT:
- break 2;
- default:
- $state = 'start';
- }
- break;
- case 'before_structure':
- if ($token[0] == T_STRING) {
- $structName = $token[1];
- $state = 'structure';
- }
- break;
- case 'structure':
- switch ($token[0]) {
- case '{':
- case T_CURLY_OPEN:
- case T_DOLLAR_OPEN_CURLY_BRACES:
- $open++;
- break;
- case '}':
- if (--$open == 0) {
- if (! $structIgnore) {
- $structures[] = [
- 'type' => $structType,
- 'name' => $structName,
- 'start' => $startLine,
- 'end' => $endLine,
- ];
- }
- $structIgnore = false;
- $state = 'start';
- }
- break;
- default:
- if (is_array($token)) {
- $endLine = $token[2];
- }
- }
- break;
- }
- }
-
- static::$classes[$key] = $classes;
- static::$functions[$key] = $functions;
- static::$constants[$key] = $constants;
- static::$structures[$key] = $structures;
- }
-
- /**
- * Returns the namespace associated to the closure.
- *
- * @return string
- */
- protected function getClosureNamespaceName()
- {
- $ns = $this->getNamespaceName();
-
- // First class callables...
- if ($this->getName() !== '{closure}' && empty($ns) && ! is_null($this->getClosureScopeClass())) {
- $ns = $this->getClosureScopeClass()->getNamespaceName();
- }
-
- return $ns;
- }
-
- /**
- * Parse the given token.
- *
- * @param string $token
- * @return array
- */
- protected function parseNameQualified($token)
- {
- $pieces = explode('\\', $token);
-
- $id_start = array_shift($pieces);
-
- $id_start_ci = strtolower($id_start);
-
- $id_name = '\\'.implode('\\', $pieces);
-
- return [$id_start, $id_start_ci, $id_name];
- }
-}
diff --git a/vendor/laravel/serializable-closure/src/Support/SelfReference.php b/vendor/laravel/serializable-closure/src/Support/SelfReference.php
deleted file mode 100644
index 5831950..0000000
--- a/vendor/laravel/serializable-closure/src/Support/SelfReference.php
+++ /dev/null
@@ -1,24 +0,0 @@
-hash = $hash;
- }
-}
diff --git a/vendor/laravel/serializable-closure/src/UnsignedSerializableClosure.php b/vendor/laravel/serializable-closure/src/UnsignedSerializableClosure.php
deleted file mode 100644
index 1588e7c..0000000
--- a/vendor/laravel/serializable-closure/src/UnsignedSerializableClosure.php
+++ /dev/null
@@ -1,82 +0,0 @@
-serializable = new Serializers\Native($closure);
- }
-
- /**
- * Resolve the closure with the given arguments.
- *
- * @return mixed
- */
- public function __invoke()
- {
- if (\PHP_VERSION_ID < 70400) {
- throw new PhpVersionNotSupportedException();
- }
-
- return call_user_func_array($this->serializable, func_get_args());
- }
-
- /**
- * Gets the closure.
- *
- * @return \Closure
- */
- public function getClosure()
- {
- if (\PHP_VERSION_ID < 70400) {
- throw new PhpVersionNotSupportedException();
- }
-
- return $this->serializable->getClosure();
- }
-
- /**
- * Get the serializable representation of the closure.
- *
- * @return array
- */
- public function __serialize()
- {
- return [
- 'serializable' => $this->serializable,
- ];
- }
-
- /**
- * Restore the closure after serialization.
- *
- * @param array $data
- * @return void
- */
- public function __unserialize($data)
- {
- $this->serializable = $data['serializable'];
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/.editorconfig b/vendor/league/flysystem-cached-adapter/.editorconfig
deleted file mode 100644
index 153cf3e..0000000
--- a/vendor/league/flysystem-cached-adapter/.editorconfig
+++ /dev/null
@@ -1,10 +0,0 @@
-; top-most EditorConfig file
-root = true
-
-; Unix-style newlines
-[*]
-end_of_line = LF
-
-[*.php]
-indent_style = space
-indent_size = 4
diff --git a/vendor/league/flysystem-cached-adapter/.gitignore b/vendor/league/flysystem-cached-adapter/.gitignore
deleted file mode 100644
index 7aea75f..0000000
--- a/vendor/league/flysystem-cached-adapter/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-coverage
-coverage.xml
-composer.lock
-vendor
\ No newline at end of file
diff --git a/vendor/league/flysystem-cached-adapter/.php_cs b/vendor/league/flysystem-cached-adapter/.php_cs
deleted file mode 100644
index 6643a32..0000000
--- a/vendor/league/flysystem-cached-adapter/.php_cs
+++ /dev/null
@@ -1,7 +0,0 @@
-level(Symfony\CS\FixerInterface::PSR2_LEVEL)
- ->fixers(['-yoda_conditions', 'ordered_use', 'short_array_syntax'])
- ->finder(Symfony\CS\Finder\DefaultFinder::create()
- ->in(__DIR__.'/src/'));
\ No newline at end of file
diff --git a/vendor/league/flysystem-cached-adapter/.scrutinizer.yml b/vendor/league/flysystem-cached-adapter/.scrutinizer.yml
deleted file mode 100644
index fa39b52..0000000
--- a/vendor/league/flysystem-cached-adapter/.scrutinizer.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-filter:
- paths: [src/*]
-checks:
- php:
- code_rating: true
- remove_extra_empty_lines: true
- remove_php_closing_tag: true
- remove_trailing_whitespace: true
- fix_use_statements:
- remove_unused: true
- preserve_multiple: false
- preserve_blanklines: true
- order_alphabetically: true
- fix_php_opening_tag: true
- fix_linefeed: true
- fix_line_ending: true
- fix_identation_4spaces: true
- fix_doc_comments: true
-tools:
- external_code_coverage:
- timeout: 900
- runs: 6
- php_code_coverage: false
- php_code_sniffer:
- config:
- standard: PSR2
- filter:
- paths: ['src']
- php_loc:
- enabled: true
- excluded_dirs: [vendor, spec, stubs]
- php_cpd:
- enabled: true
- excluded_dirs: [vendor, spec, stubs]
\ No newline at end of file
diff --git a/vendor/league/flysystem-cached-adapter/.travis.yml b/vendor/league/flysystem-cached-adapter/.travis.yml
deleted file mode 100644
index 6706449..0000000
--- a/vendor/league/flysystem-cached-adapter/.travis.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-language: php
-
-php:
- - 5.5
- - 5.6
- - 7.0
- - 7.1
- - 7.2
-
-matrix:
- allow_failures:
- - php: 5.5
-
-env:
- - COMPOSER_OPTS=""
- - COMPOSER_OPTS="--prefer-lowest"
-
-install:
- - if [[ "${TRAVIS_PHP_VERSION}" == "5.5" ]]; then composer require phpunit/phpunit:^4.8.36 phpspec/phpspec:^2 --prefer-dist --update-with-dependencies; fi
- - if [[ "${TRAVIS_PHP_VERSION}" == "7.2" ]]; then composer require phpunit/phpunit:^6.0 --prefer-dist --update-with-dependencies; fi
- - travis_retry composer update --prefer-dist $COMPOSER_OPTS
-
-script:
- - vendor/bin/phpspec run
- - vendor/bin/phpunit
-
-after_script:
- - wget https://scrutinizer-ci.com/ocular.phar'
- - php ocular.phar code-coverage:upload --format=php-clover ./clover/phpunit.xml'
diff --git a/vendor/league/flysystem-cached-adapter/clover/.gitignore b/vendor/league/flysystem-cached-adapter/clover/.gitignore
deleted file mode 100644
index d6b7ef3..0000000
--- a/vendor/league/flysystem-cached-adapter/clover/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*
-!.gitignore
diff --git a/vendor/league/flysystem-cached-adapter/composer.json b/vendor/league/flysystem-cached-adapter/composer.json
deleted file mode 100644
index df7fb7f..0000000
--- a/vendor/league/flysystem-cached-adapter/composer.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "name": "league/flysystem-cached-adapter",
- "description": "An adapter decorator to enable meta-data caching.",
- "autoload": {
- "psr-4": {
- "League\\Flysystem\\Cached\\": "src/"
- }
- },
- "require": {
- "league/flysystem": "~1.0",
- "psr/cache": "^1.0.0"
- },
- "require-dev": {
- "phpspec/phpspec": "^3.4",
- "phpunit/phpunit": "^5.7",
- "mockery/mockery": "~0.9",
- "predis/predis": "~1.0",
- "tedivm/stash": "~0.12"
- },
- "suggest": {
- "ext-phpredis": "Pure C implemented extension for PHP"
- },
- "license": "MIT",
- "authors": [
- {
- "name": "frankdejonge",
- "email": "info@frenky.net"
- }
- ]
-}
diff --git a/vendor/league/flysystem-cached-adapter/phpspec.yml b/vendor/league/flysystem-cached-adapter/phpspec.yml
deleted file mode 100644
index 5eabcb2..0000000
--- a/vendor/league/flysystem-cached-adapter/phpspec.yml
+++ /dev/null
@@ -1,6 +0,0 @@
----
-suites:
- cached_adapter_suite:
- namespace: League\Flysystem\Cached
- psr4_prefix: League\Flysystem\Cached
-formatter.name: pretty
diff --git a/vendor/league/flysystem-cached-adapter/phpunit.php b/vendor/league/flysystem-cached-adapter/phpunit.php
deleted file mode 100644
index d109587..0000000
--- a/vendor/league/flysystem-cached-adapter/phpunit.php
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
-
- ./tests/
-
-
-
-
- ./src/
-
-
-
-
-
-
-
-
diff --git a/vendor/league/flysystem-cached-adapter/readme.md b/vendor/league/flysystem-cached-adapter/readme.md
deleted file mode 100644
index dd1433d..0000000
--- a/vendor/league/flysystem-cached-adapter/readme.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# Flysystem Cached CachedAdapter
-
-[](https://twitter.com/frankdejonge)
-[](https://travis-ci.org/thephpleague/flysystem-cached-adapter)
-[](https://scrutinizer-ci.com/g/thephpleague/flysystem-cached-adapter/code-structure)
-[](https://scrutinizer-ci.com/g/thephpleague/flysystem-cached-adapter)
-[](LICENSE)
-[](https://packagist.org/packages/league/flysystem-cached-adapter)
-[](https://packagist.org/packages/league/flysystem-cached-adapter)
-
-
-The adapter decorator caches metadata and directory listings.
-
-```bash
-composer require league/flysystem-cached-adapter
-```
-
-## Usage
-
-[Check out the docs.](https://flysystem.thephpleague.com/docs/advanced/caching/)
diff --git a/vendor/league/flysystem-cached-adapter/spec/CachedAdapterSpec.php b/vendor/league/flysystem-cached-adapter/spec/CachedAdapterSpec.php
deleted file mode 100644
index 69428d9..0000000
--- a/vendor/league/flysystem-cached-adapter/spec/CachedAdapterSpec.php
+++ /dev/null
@@ -1,435 +0,0 @@
-adapter = $adapter;
- $this->cache = $cache;
- $this->cache->load()->shouldBeCalled();
- $this->beConstructedWith($adapter, $cache);
- }
-
- public function it_is_initializable()
- {
- $this->shouldHaveType('League\Flysystem\Cached\CachedAdapter');
- $this->shouldHaveType('League\Flysystem\AdapterInterface');
- }
-
- public function it_should_forward_read_streams()
- {
- $path = 'path.txt';
- $response = ['path' => $path];
- $this->adapter->readStream($path)->willReturn($response);
- $this->readStream($path)->shouldbe($response);
- }
-
- public function it_should_cache_writes()
- {
- $type = 'file';
- $path = 'path.txt';
- $contents = 'contents';
- $config = new Config();
- $response = compact('path', 'contents', 'type');
- $this->adapter->write($path, $contents, $config)->willReturn($response);
- $this->cache->updateObject($path, $response, true)->shouldBeCalled();
- $this->write($path, $contents, $config)->shouldBe($response);
- }
-
- public function it_should_cache_streamed_writes()
- {
- $type = 'file';
- $path = 'path.txt';
- $stream = tmpfile();
- $config = new Config();
- $response = compact('path', 'stream', 'type');
- $this->adapter->writeStream($path, $stream, $config)->willReturn($response);
- $this->cache->updateObject($path, ['contents' => false] + $response, true)->shouldBeCalled();
- $this->writeStream($path, $stream, $config)->shouldBe($response);
- fclose($stream);
- }
-
- public function it_should_cache_streamed_updates()
- {
- $type = 'file';
- $path = 'path.txt';
- $stream = tmpfile();
- $config = new Config();
- $response = compact('path', 'stream', 'type');
- $this->adapter->updateStream($path, $stream, $config)->willReturn($response);
- $this->cache->updateObject($path, ['contents' => false] + $response, true)->shouldBeCalled();
- $this->updateStream($path, $stream, $config)->shouldBe($response);
- fclose($stream);
- }
-
- public function it_should_ignore_failed_writes()
- {
- $path = 'path.txt';
- $contents = 'contents';
- $config = new Config();
- $this->adapter->write($path, $contents, $config)->willReturn(false);
- $this->write($path, $contents, $config)->shouldBe(false);
- }
-
- public function it_should_ignore_failed_streamed_writes()
- {
- $path = 'path.txt';
- $contents = tmpfile();
- $config = new Config();
- $this->adapter->writeStream($path, $contents, $config)->willReturn(false);
- $this->writeStream($path, $contents, $config)->shouldBe(false);
- fclose($contents);
- }
-
- public function it_should_cache_updated()
- {
- $type = 'file';
- $path = 'path.txt';
- $contents = 'contents';
- $config = new Config();
- $response = compact('path', 'contents', 'type');
- $this->adapter->update($path, $contents, $config)->willReturn($response);
- $this->cache->updateObject($path, $response, true)->shouldBeCalled();
- $this->update($path, $contents, $config)->shouldBe($response);
- }
-
- public function it_should_ignore_failed_updates()
- {
- $path = 'path.txt';
- $contents = 'contents';
- $config = new Config();
- $this->adapter->update($path, $contents, $config)->willReturn(false);
- $this->update($path, $contents, $config)->shouldBe(false);
- }
-
- public function it_should_ignore_failed_streamed_updates()
- {
- $path = 'path.txt';
- $contents = tmpfile();
- $config = new Config();
- $this->adapter->updateStream($path, $contents, $config)->willReturn(false);
- $this->updateStream($path, $contents, $config)->shouldBe(false);
- fclose($contents);
- }
-
- public function it_should_cache_renames()
- {
- $old = 'old.txt';
- $new = 'new.txt';
- $this->adapter->rename($old, $new)->willReturn(true);
- $this->cache->rename($old, $new)->shouldBeCalled();
- $this->rename($old, $new)->shouldBe(true);
- }
-
- public function it_should_ignore_rename_fails()
- {
- $old = 'old.txt';
- $new = 'new.txt';
- $this->adapter->rename($old, $new)->willReturn(false);
- $this->rename($old, $new)->shouldBe(false);
- }
-
- public function it_should_cache_copies()
- {
- $old = 'old.txt';
- $new = 'new.txt';
- $this->adapter->copy($old, $new)->willReturn(true);
- $this->cache->copy($old, $new)->shouldBeCalled();
- $this->copy($old, $new)->shouldBe(true);
- }
-
- public function it_should_ignore_copy_fails()
- {
- $old = 'old.txt';
- $new = 'new.txt';
- $this->adapter->copy($old, $new)->willReturn(false);
- $this->copy($old, $new)->shouldBe(false);
- }
-
- public function it_should_cache_deletes()
- {
- $delete = 'delete.txt';
- $this->adapter->delete($delete)->willReturn(true);
- $this->cache->delete($delete)->shouldBeCalled();
- $this->delete($delete)->shouldBe(true);
- }
-
- public function it_should_ignore_delete_fails()
- {
- $delete = 'delete.txt';
- $this->adapter->delete($delete)->willReturn(false);
- $this->delete($delete)->shouldBe(false);
- }
-
- public function it_should_cache_dir_deletes()
- {
- $delete = 'delete';
- $this->adapter->deleteDir($delete)->willReturn(true);
- $this->cache->deleteDir($delete)->shouldBeCalled();
- $this->deleteDir($delete)->shouldBe(true);
- }
-
- public function it_should_ignore_delete_dir_fails()
- {
- $delete = 'delete';
- $this->adapter->deleteDir($delete)->willReturn(false);
- $this->deleteDir($delete)->shouldBe(false);
- }
-
- public function it_should_cache_dir_creates()
- {
- $dirname = 'dirname';
- $config = new Config();
- $response = ['path' => $dirname, 'type' => 'dir'];
- $this->adapter->createDir($dirname, $config)->willReturn($response);
- $this->cache->updateObject($dirname, $response, true)->shouldBeCalled();
- $this->createDir($dirname, $config)->shouldBe($response);
- }
-
- public function it_should_ignore_create_dir_fails()
- {
- $dirname = 'dirname';
- $config = new Config();
- $this->adapter->createDir($dirname, $config)->willReturn(false);
- $this->createDir($dirname, $config)->shouldBe(false);
- }
-
- public function it_should_cache_set_visibility()
- {
- $path = 'path.txt';
- $visibility = AdapterInterface::VISIBILITY_PUBLIC;
- $this->adapter->setVisibility($path, $visibility)->willReturn(true);
- $this->cache->updateObject($path, ['path' => $path, 'visibility' => $visibility], true)->shouldBeCalled();
- $this->setVisibility($path, $visibility)->shouldBe(true);
- }
-
- public function it_should_ignore_set_visibility_fails()
- {
- $dirname = 'delete';
- $visibility = AdapterInterface::VISIBILITY_PUBLIC;
- $this->adapter->setVisibility($dirname, $visibility)->willReturn(false);
- $this->setVisibility($dirname, $visibility)->shouldBe(false);
- }
-
- public function it_should_indicate_missing_files()
- {
- $this->cache->has($path = 'path.txt')->willReturn(false);
- $this->has($path)->shouldBe(false);
- }
-
- public function it_should_indicate_file_existance()
- {
- $this->cache->has($path = 'path.txt')->willReturn(true);
- $this->has($path)->shouldBe(true);
- }
-
- public function it_should_cache_missing_files()
- {
- $this->cache->has($path = 'path.txt')->willReturn(null);
- $this->adapter->has($path)->willReturn(false);
- $this->cache->storeMiss($path)->shouldBeCalled();
- $this->has($path)->shouldBe(false);
- }
-
- public function it_should_delete_when_metadata_is_missing()
- {
- $path = 'path.txt';
- $this->cache->has($path)->willReturn(true);
- $this->cache->getSize($path)->willReturn(['path' => $path]);
- $this->adapter->getSize($path)->willReturn($response = ['path' => $path, 'size' => 1024]);
- $this->cache->updateObject($path, $response, true)->shouldBeCalled();
- $this->getSize($path)->shouldBe($response);
- }
-
- public function it_should_cache_has()
- {
- $this->cache->has($path = 'path.txt')->willReturn(null);
- $this->adapter->has($path)->willReturn(true);
- $this->cache->updateObject($path, compact('path'), true)->shouldBeCalled();
- $this->has($path)->shouldBe(true);
- }
-
- public function it_should_list_cached_contents()
- {
- $this->cache->isComplete($dirname = 'dirname', $recursive = true)->willReturn(true);
- $response = [['path' => 'path.txt']];
- $this->cache->listContents($dirname, $recursive)->willReturn($response);
- $this->listContents($dirname, $recursive)->shouldBe($response);
- }
-
- public function it_should_ignore_failed_list_contents()
- {
- $this->cache->isComplete($dirname = 'dirname', $recursive = true)->willReturn(false);
- $this->adapter->listContents($dirname, $recursive)->willReturn(false);
- $this->listContents($dirname, $recursive)->shouldBe(false);
- }
-
- public function it_should_cache_contents_listings()
- {
- $this->cache->isComplete($dirname = 'dirname', $recursive = true)->willReturn(false);
- $response = [['path' => 'path.txt']];
- $this->adapter->listContents($dirname, $recursive)->willReturn($response);
- $this->cache->storeContents($dirname, $response, $recursive)->shouldBeCalled();
- $this->listContents($dirname, $recursive)->shouldBe($response);
- }
-
- public function it_should_use_cached_visibility()
- {
- $this->make_it_use_getter_cache('getVisibility', 'path.txt', [
- 'path' => 'path.txt',
- 'visibility' => AdapterInterface::VISIBILITY_PUBLIC,
- ]);
- }
-
- public function it_should_cache_get_visibility()
- {
- $path = 'path.txt';
- $response = ['visibility' => AdapterInterface::VISIBILITY_PUBLIC, 'path' => $path];
- $this->make_it_cache_getter('getVisibility', $path, $response);
- }
-
- public function it_should_ignore_failed_get_visibility()
- {
- $path = 'path.txt';
- $this->make_it_ignore_failed_getter('getVisibility', $path);
- }
-
- public function it_should_use_cached_timestamp()
- {
- $this->make_it_use_getter_cache('getTimestamp', 'path.txt', [
- 'path' => 'path.txt',
- 'timestamp' => 1234,
- ]);
- }
-
- public function it_should_cache_timestamps()
- {
- $this->make_it_cache_getter('getTimestamp', 'path.txt', [
- 'path' => 'path.txt',
- 'timestamp' => 1234,
- ]);
- }
-
- public function it_should_ignore_failed_get_timestamps()
- {
- $this->make_it_ignore_failed_getter('getTimestamp', 'path.txt');
- }
-
- public function it_should_cache_get_metadata()
- {
- $path = 'path.txt';
- $response = ['visibility' => AdapterInterface::VISIBILITY_PUBLIC, 'path' => $path];
- $this->make_it_cache_getter('getMetadata', $path, $response);
- }
-
- public function it_should_use_cached_metadata()
- {
- $this->make_it_use_getter_cache('getMetadata', 'path.txt', [
- 'path' => 'path.txt',
- 'timestamp' => 1234,
- ]);
- }
-
- public function it_should_ignore_failed_get_metadata()
- {
- $this->make_it_ignore_failed_getter('getMetadata', 'path.txt');
- }
-
- public function it_should_cache_get_size()
- {
- $path = 'path.txt';
- $response = ['size' => 1234, 'path' => $path];
- $this->make_it_cache_getter('getSize', $path, $response);
- }
-
- public function it_should_use_cached_size()
- {
- $this->make_it_use_getter_cache('getSize', 'path.txt', [
- 'path' => 'path.txt',
- 'size' => 1234,
- ]);
- }
-
- public function it_should_ignore_failed_get_size()
- {
- $this->make_it_ignore_failed_getter('getSize', 'path.txt');
- }
-
- public function it_should_cache_get_mimetype()
- {
- $path = 'path.txt';
- $response = ['mimetype' => 'text/plain', 'path' => $path];
- $this->make_it_cache_getter('getMimetype', $path, $response);
- }
-
- public function it_should_use_cached_mimetype()
- {
- $this->make_it_use_getter_cache('getMimetype', 'path.txt', [
- 'path' => 'path.txt',
- 'mimetype' => 'text/plain',
- ]);
- }
-
- public function it_should_ignore_failed_get_mimetype()
- {
- $this->make_it_ignore_failed_getter('getMimetype', 'path.txt');
- }
-
- public function it_should_cache_reads()
- {
- $path = 'path.txt';
- $response = ['path' => $path, 'contents' => 'contents'];
- $this->make_it_cache_getter('read', $path, $response);
- }
-
- public function it_should_use_cached_file_contents()
- {
- $this->make_it_use_getter_cache('read', 'path.txt', [
- 'path' => 'path.txt',
- 'contents' => 'contents'
- ]);
- }
-
- public function it_should_ignore_failed_reads()
- {
- $this->make_it_ignore_failed_getter('read', 'path.txt');
- }
-
- protected function make_it_use_getter_cache($method, $path, $response)
- {
- $this->cache->{$method}($path)->willReturn($response);
- $this->{$method}($path)->shouldBe($response);
- }
-
- protected function make_it_cache_getter($method, $path, $response)
- {
- $this->cache->{$method}($path)->willReturn(false);
- $this->adapter->{$method}($path)->willReturn($response);
- $this->cache->updateObject($path, $response, true)->shouldBeCalled();
- $this->{$method}($path)->shouldBe($response);
- }
-
- protected function make_it_ignore_failed_getter($method, $path)
- {
- $this->cache->{$method}($path)->willReturn(false);
- $this->adapter->{$method}($path)->willReturn(false);
- $this->{$method}($path)->shouldBe(false);
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/src/CacheInterface.php b/vendor/league/flysystem-cached-adapter/src/CacheInterface.php
deleted file mode 100644
index de3ab3d..0000000
--- a/vendor/league/flysystem-cached-adapter/src/CacheInterface.php
+++ /dev/null
@@ -1,101 +0,0 @@
-adapter = $adapter;
- $this->cache = $cache;
- $this->cache->load();
- }
-
- /**
- * Get the underlying Adapter implementation.
- *
- * @return AdapterInterface
- */
- public function getAdapter()
- {
- return $this->adapter;
- }
-
- /**
- * Get the used Cache implementation.
- *
- * @return CacheInterface
- */
- public function getCache()
- {
- return $this->cache;
- }
-
- /**
- * {@inheritdoc}
- */
- public function write($path, $contents, Config $config)
- {
- $result = $this->adapter->write($path, $contents, $config);
-
- if ($result !== false) {
- $result['type'] = 'file';
- $this->cache->updateObject($path, $result + compact('path', 'contents'), true);
- }
-
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function writeStream($path, $resource, Config $config)
- {
- $result = $this->adapter->writeStream($path, $resource, $config);
-
- if ($result !== false) {
- $result['type'] = 'file';
- $contents = false;
- $this->cache->updateObject($path, $result + compact('path', 'contents'), true);
- }
-
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function update($path, $contents, Config $config)
- {
- $result = $this->adapter->update($path, $contents, $config);
-
- if ($result !== false) {
- $result['type'] = 'file';
- $this->cache->updateObject($path, $result + compact('path', 'contents'), true);
- }
-
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function updateStream($path, $resource, Config $config)
- {
- $result = $this->adapter->updateStream($path, $resource, $config);
-
- if ($result !== false) {
- $result['type'] = 'file';
- $contents = false;
- $this->cache->updateObject($path, $result + compact('path', 'contents'), true);
- }
-
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function rename($path, $newPath)
- {
- $result = $this->adapter->rename($path, $newPath);
-
- if ($result !== false) {
- $this->cache->rename($path, $newPath);
- }
-
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function copy($path, $newpath)
- {
- $result = $this->adapter->copy($path, $newpath);
-
- if ($result !== false) {
- $this->cache->copy($path, $newpath);
- }
-
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function delete($path)
- {
- $result = $this->adapter->delete($path);
-
- if ($result !== false) {
- $this->cache->delete($path);
- }
-
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function deleteDir($dirname)
- {
- $result = $this->adapter->deleteDir($dirname);
-
- if ($result !== false) {
- $this->cache->deleteDir($dirname);
- }
-
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function createDir($dirname, Config $config)
- {
- $result = $this->adapter->createDir($dirname, $config);
-
- if ($result !== false) {
- $type = 'dir';
- $path = $dirname;
- $this->cache->updateObject($dirname, compact('path', 'type'), true);
- }
-
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setVisibility($path, $visibility)
- {
- $result = $this->adapter->setVisibility($path, $visibility);
-
- if ($result !== false) {
- $this->cache->updateObject($path, compact('path', 'visibility'), true);
- }
-
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function has($path)
- {
- $cacheHas = $this->cache->has($path);
-
- if ($cacheHas !== null) {
- return $cacheHas;
- }
-
- $adapterResponse = $this->adapter->has($path);
-
- if (! $adapterResponse) {
- $this->cache->storeMiss($path);
- } else {
- $cacheEntry = is_array($adapterResponse) ? $adapterResponse : compact('path');
- $this->cache->updateObject($path, $cacheEntry, true);
- }
-
- return $adapterResponse;
- }
-
- /**
- * {@inheritdoc}
- */
- public function read($path)
- {
- return $this->callWithFallback('contents', $path, 'read');
- }
-
- /**
- * {@inheritdoc}
- */
- public function readStream($path)
- {
- return $this->adapter->readStream($path);
- }
-
- /**
- * Get the path prefix.
- *
- * @return string|null path prefix or null if pathPrefix is empty
- */
- public function getPathPrefix()
- {
- return $this->adapter->getPathPrefix();
- }
-
- /**
- * Prefix a path.
- *
- * @param string $path
- *
- * @return string prefixed path
- */
- public function applyPathPrefix($path)
- {
- return $this->adapter->applyPathPrefix($path);
- }
-
- /**
- * {@inheritdoc}
- */
- public function listContents($directory = '', $recursive = false)
- {
- if ($this->cache->isComplete($directory, $recursive)) {
- return $this->cache->listContents($directory, $recursive);
- }
-
- $result = $this->adapter->listContents($directory, $recursive);
-
- if ($result !== false) {
- $this->cache->storeContents($directory, $result, $recursive);
- }
-
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getMetadata($path)
- {
- return $this->callWithFallback(null, $path, 'getMetadata');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSize($path)
- {
- return $this->callWithFallback('size', $path, 'getSize');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getMimetype($path)
- {
- return $this->callWithFallback('mimetype', $path, 'getMimetype');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getTimestamp($path)
- {
- return $this->callWithFallback('timestamp', $path, 'getTimestamp');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getVisibility($path)
- {
- return $this->callWithFallback('visibility', $path, 'getVisibility');
- }
-
- /**
- * Call a method and cache the response.
- *
- * @param string $property
- * @param string $path
- * @param string $method
- *
- * @return mixed
- */
- protected function callWithFallback($property, $path, $method)
- {
- $result = $this->cache->{$method}($path);
-
- if ($result !== false && ($property === null || array_key_exists($property, $result))) {
- return $result;
- }
-
- $result = $this->adapter->{$method}($path);
-
- if ($result) {
- $object = $result + compact('path');
- $this->cache->updateObject($path, $object, true);
- }
-
- return $result;
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/AbstractCache.php b/vendor/league/flysystem-cached-adapter/src/Storage/AbstractCache.php
deleted file mode 100644
index 141b468..0000000
--- a/vendor/league/flysystem-cached-adapter/src/Storage/AbstractCache.php
+++ /dev/null
@@ -1,418 +0,0 @@
-autosave) {
- $this->save();
- }
- }
-
- /**
- * Get the autosave setting.
- *
- * @return bool autosave
- */
- public function getAutosave()
- {
- return $this->autosave;
- }
-
- /**
- * Get the autosave setting.
- *
- * @param bool $autosave
- */
- public function setAutosave($autosave)
- {
- $this->autosave = $autosave;
- }
-
- /**
- * Store the contents listing.
- *
- * @param string $directory
- * @param array $contents
- * @param bool $recursive
- *
- * @return array contents listing
- */
- public function storeContents($directory, array $contents, $recursive = false)
- {
- $directories = [$directory];
-
- foreach ($contents as $object) {
- $this->updateObject($object['path'], $object);
- $object = $this->cache[$object['path']];
-
- if ($recursive && $this->pathIsInDirectory($directory, $object['path'])) {
- $directories[] = $object['dirname'];
- }
- }
-
- foreach (array_unique($directories) as $directory) {
- $this->setComplete($directory, $recursive);
- }
-
- $this->autosave();
- }
-
- /**
- * Update the metadata for an object.
- *
- * @param string $path object path
- * @param array $object object metadata
- * @param bool $autosave whether to trigger the autosave routine
- */
- public function updateObject($path, array $object, $autosave = false)
- {
- if (! $this->has($path)) {
- $this->cache[$path] = Util::pathinfo($path);
- }
-
- $this->cache[$path] = array_merge($this->cache[$path], $object);
-
- if ($autosave) {
- $this->autosave();
- }
-
- $this->ensureParentDirectories($path);
- }
-
- /**
- * Store object hit miss.
- *
- * @param string $path
- */
- public function storeMiss($path)
- {
- $this->cache[$path] = false;
- $this->autosave();
- }
-
- /**
- * Get the contents listing.
- *
- * @param string $dirname
- * @param bool $recursive
- *
- * @return array contents listing
- */
- public function listContents($dirname = '', $recursive = false)
- {
- $result = [];
-
- foreach ($this->cache as $object) {
- if ($object === false) {
- continue;
- }
- if ($object['dirname'] === $dirname) {
- $result[] = $object;
- } elseif ($recursive && $this->pathIsInDirectory($dirname, $object['path'])) {
- $result[] = $object;
- }
- }
-
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function has($path)
- {
- if ($path !== false && array_key_exists($path, $this->cache)) {
- return $this->cache[$path] !== false;
- }
-
- if ($this->isComplete(Util::dirname($path), false)) {
- return false;
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function read($path)
- {
- if (isset($this->cache[$path]['contents']) && $this->cache[$path]['contents'] !== false) {
- return $this->cache[$path];
- }
-
- return false;
- }
-
- /**
- * {@inheritdoc}
- */
- public function readStream($path)
- {
- return false;
- }
-
- /**
- * {@inheritdoc}
- */
- public function rename($path, $newpath)
- {
- if ($this->has($path)) {
- $object = $this->cache[$path];
- unset($this->cache[$path]);
- $object['path'] = $newpath;
- $object = array_merge($object, Util::pathinfo($newpath));
- $this->cache[$newpath] = $object;
- $this->autosave();
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function copy($path, $newpath)
- {
- if ($this->has($path)) {
- $object = $this->cache[$path];
- $object = array_merge($object, Util::pathinfo($newpath));
- $this->updateObject($newpath, $object, true);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function delete($path)
- {
- $this->storeMiss($path);
- }
-
- /**
- * {@inheritdoc}
- */
- public function deleteDir($dirname)
- {
- foreach ($this->cache as $path => $object) {
- if ($this->pathIsInDirectory($dirname, $path) || $path === $dirname) {
- unset($this->cache[$path]);
- }
- }
-
- unset($this->complete[$dirname]);
-
- $this->autosave();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getMimetype($path)
- {
- if (isset($this->cache[$path]['mimetype'])) {
- return $this->cache[$path];
- }
-
- if (! $result = $this->read($path)) {
- return false;
- }
-
- $mimetype = Util::guessMimeType($path, $result['contents']);
- $this->cache[$path]['mimetype'] = $mimetype;
-
- return $this->cache[$path];
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSize($path)
- {
- if (isset($this->cache[$path]['size'])) {
- return $this->cache[$path];
- }
-
- return false;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getTimestamp($path)
- {
- if (isset($this->cache[$path]['timestamp'])) {
- return $this->cache[$path];
- }
-
- return false;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getVisibility($path)
- {
- if (isset($this->cache[$path]['visibility'])) {
- return $this->cache[$path];
- }
-
- return false;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getMetadata($path)
- {
- if (isset($this->cache[$path]['type'])) {
- return $this->cache[$path];
- }
-
- return false;
- }
-
- /**
- * {@inheritdoc}
- */
- public function isComplete($dirname, $recursive)
- {
- if (! array_key_exists($dirname, $this->complete)) {
- return false;
- }
-
- if ($recursive && $this->complete[$dirname] !== 'recursive') {
- return false;
- }
-
- return true;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setComplete($dirname, $recursive)
- {
- $this->complete[$dirname] = $recursive ? 'recursive' : true;
- }
-
- /**
- * Filter the contents from a listing.
- *
- * @param array $contents object listing
- *
- * @return array filtered contents
- */
- public function cleanContents(array $contents)
- {
- $cachedProperties = array_flip([
- 'path', 'dirname', 'basename', 'extension', 'filename',
- 'size', 'mimetype', 'visibility', 'timestamp', 'type',
- 'md5',
- ]);
-
- foreach ($contents as $path => $object) {
- if (is_array($object)) {
- $contents[$path] = array_intersect_key($object, $cachedProperties);
- }
- }
-
- return $contents;
- }
-
- /**
- * {@inheritdoc}
- */
- public function flush()
- {
- $this->cache = [];
- $this->complete = [];
- $this->autosave();
- }
-
- /**
- * {@inheritdoc}
- */
- public function autosave()
- {
- if ($this->autosave) {
- $this->save();
- }
- }
-
- /**
- * Retrieve serialized cache data.
- *
- * @return string serialized data
- */
- public function getForStorage()
- {
- $cleaned = $this->cleanContents($this->cache);
-
- return json_encode([$cleaned, $this->complete]);
- }
-
- /**
- * Load from serialized cache data.
- *
- * @param string $json
- */
- public function setFromStorage($json)
- {
- list($cache, $complete) = json_decode($json, true);
-
- if (json_last_error() === JSON_ERROR_NONE && is_array($cache) && is_array($complete)) {
- $this->cache = $cache;
- $this->complete = $complete;
- }
- }
-
- /**
- * Ensure parent directories of an object.
- *
- * @param string $path object path
- */
- public function ensureParentDirectories($path)
- {
- $object = $this->cache[$path];
-
- while ($object['dirname'] !== '' && ! isset($this->cache[$object['dirname']])) {
- $object = Util::pathinfo($object['dirname']);
- $object['type'] = 'dir';
- $this->cache[$object['path']] = $object;
- }
- }
-
- /**
- * Determines if the path is inside the directory.
- *
- * @param string $directory
- * @param string $path
- *
- * @return bool
- */
- protected function pathIsInDirectory($directory, $path)
- {
- return $directory === '' || strpos($path, $directory . '/') === 0;
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Adapter.php b/vendor/league/flysystem-cached-adapter/src/Storage/Adapter.php
deleted file mode 100644
index 649a60e..0000000
--- a/vendor/league/flysystem-cached-adapter/src/Storage/Adapter.php
+++ /dev/null
@@ -1,115 +0,0 @@
-adapter = $adapter;
- $this->file = $file;
- $this->setExpire($expire);
- }
-
- /**
- * Set the expiration time in seconds.
- *
- * @param int $expire relative expiration time
- */
- protected function setExpire($expire)
- {
- if ($expire) {
- $this->expire = $this->getTime($expire);
- }
- }
-
- /**
- * Get expiration time in seconds.
- *
- * @param int $time relative expiration time
- *
- * @return int actual expiration time
- */
- protected function getTime($time = 0)
- {
- return intval(microtime(true)) + $time;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setFromStorage($json)
- {
- list($cache, $complete, $expire) = json_decode($json, true);
-
- if (! $expire || $expire > $this->getTime()) {
- $this->cache = is_array($cache) ? $cache : [];
- $this->complete = is_array($complete) ? $complete : [];
- } else {
- $this->adapter->delete($this->file);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function load()
- {
- if ($this->adapter->has($this->file)) {
- $file = $this->adapter->read($this->file);
- if ($file && !empty($file['contents'])) {
- $this->setFromStorage($file['contents']);
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function getForStorage()
- {
- $cleaned = $this->cleanContents($this->cache);
-
- return json_encode([$cleaned, $this->complete, $this->expire]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function save()
- {
- $config = new Config();
- $contents = $this->getForStorage();
-
- if ($this->adapter->has($this->file)) {
- $this->adapter->update($this->file, $contents, $config);
- } else {
- $this->adapter->write($this->file, $contents, $config);
- }
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Memcached.php b/vendor/league/flysystem-cached-adapter/src/Storage/Memcached.php
deleted file mode 100644
index f67d271..0000000
--- a/vendor/league/flysystem-cached-adapter/src/Storage/Memcached.php
+++ /dev/null
@@ -1,59 +0,0 @@
-key = $key;
- $this->expire = $expire;
- $this->memcached = $memcached;
- }
-
- /**
- * {@inheritdoc}
- */
- public function load()
- {
- $contents = $this->memcached->get($this->key);
-
- if ($contents !== false) {
- $this->setFromStorage($contents);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function save()
- {
- $contents = $this->getForStorage();
- $expiration = $this->expire === null ? 0 : time() + $this->expire;
- $this->memcached->set($this->key, $contents, $expiration);
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Memory.php b/vendor/league/flysystem-cached-adapter/src/Storage/Memory.php
deleted file mode 100644
index d0914fa..0000000
--- a/vendor/league/flysystem-cached-adapter/src/Storage/Memory.php
+++ /dev/null
@@ -1,22 +0,0 @@
-client = $client ?: new Redis();
- $this->key = $key;
- $this->expire = $expire;
- }
-
- /**
- * {@inheritdoc}
- */
- public function load()
- {
- $contents = $this->client->get($this->key);
-
- if ($contents !== false) {
- $this->setFromStorage($contents);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function save()
- {
- $contents = $this->getForStorage();
- $this->client->set($this->key, $contents);
-
- if ($this->expire !== null) {
- $this->client->expire($this->key, $this->expire);
- }
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Predis.php b/vendor/league/flysystem-cached-adapter/src/Storage/Predis.php
deleted file mode 100644
index 8a29574..0000000
--- a/vendor/league/flysystem-cached-adapter/src/Storage/Predis.php
+++ /dev/null
@@ -1,75 +0,0 @@
-client = $client ?: new Client();
- $this->key = $key;
- $this->expire = $expire;
- }
-
- /**
- * {@inheritdoc}
- */
- public function load()
- {
- if (($contents = $this->executeCommand('get', [$this->key])) !== null) {
- $this->setFromStorage($contents);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function save()
- {
- $contents = $this->getForStorage();
- $this->executeCommand('set', [$this->key, $contents]);
-
- if ($this->expire !== null) {
- $this->executeCommand('expire', [$this->key, $this->expire]);
- }
- }
-
- /**
- * Execute a Predis command.
- *
- * @param string $name
- * @param array $arguments
- *
- * @return string
- */
- protected function executeCommand($name, array $arguments)
- {
- $command = $this->client->createCommand($name, $arguments);
-
- return $this->client->executeCommand($command);
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Psr6Cache.php b/vendor/league/flysystem-cached-adapter/src/Storage/Psr6Cache.php
deleted file mode 100644
index 43be87e..0000000
--- a/vendor/league/flysystem-cached-adapter/src/Storage/Psr6Cache.php
+++ /dev/null
@@ -1,59 +0,0 @@
-pool = $pool;
- $this->key = $key;
- $this->expire = $expire;
- }
-
- /**
- * {@inheritdoc}
- */
- public function save()
- {
- $item = $this->pool->getItem($this->key);
- $item->set($this->getForStorage());
- $item->expiresAfter($this->expire);
- $this->pool->save($item);
- }
-
- /**
- * {@inheritdoc}
- */
- public function load()
- {
- $item = $this->pool->getItem($this->key);
- if ($item->isHit()) {
- $this->setFromStorage($item->get());
- }
- }
-}
\ No newline at end of file
diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Stash.php b/vendor/league/flysystem-cached-adapter/src/Storage/Stash.php
deleted file mode 100644
index e05b832..0000000
--- a/vendor/league/flysystem-cached-adapter/src/Storage/Stash.php
+++ /dev/null
@@ -1,60 +0,0 @@
-key = $key;
- $this->expire = $expire;
- $this->pool = $pool;
- }
-
- /**
- * {@inheritdoc}
- */
- public function load()
- {
- $item = $this->pool->getItem($this->key);
- $contents = $item->get();
-
- if ($item->isMiss() === false) {
- $this->setFromStorage($contents);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function save()
- {
- $contents = $this->getForStorage();
- $item = $this->pool->getItem($this->key);
- $item->set($contents, $this->expire);
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/tests/AdapterCacheTests.php b/vendor/league/flysystem-cached-adapter/tests/AdapterCacheTests.php
deleted file mode 100644
index b63cba7..0000000
--- a/vendor/league/flysystem-cached-adapter/tests/AdapterCacheTests.php
+++ /dev/null
@@ -1,104 +0,0 @@
-shouldReceive('has')->once()->with('file.json')->andReturn(false);
- $cache = new Adapter($adapter, 'file.json', 10);
- $cache->load();
- $this->assertFalse($cache->isComplete('', false));
- }
-
- public function testLoadExpired()
- {
- $response = ['contents' => json_encode([[], ['' => true], 1234567890]), 'path' => 'file.json'];
- $adapter = Mockery::mock('League\Flysystem\AdapterInterface');
- $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(true);
- $adapter->shouldReceive('read')->once()->with('file.json')->andReturn($response);
- $adapter->shouldReceive('delete')->once()->with('file.json');
- $cache = new Adapter($adapter, 'file.json', 10);
- $cache->load();
- $this->assertFalse($cache->isComplete('', false));
- }
-
- public function testLoadSuccess()
- {
- $response = ['contents' => json_encode([[], ['' => true], 9876543210]), 'path' => 'file.json'];
- $adapter = Mockery::mock('League\Flysystem\AdapterInterface');
- $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(true);
- $adapter->shouldReceive('read')->once()->with('file.json')->andReturn($response);
- $cache = new Adapter($adapter, 'file.json', 10);
- $cache->load();
- $this->assertTrue($cache->isComplete('', false));
- }
-
- public function testSaveExists()
- {
- $response = json_encode([[], [], null]);
- $adapter = Mockery::mock('League\Flysystem\AdapterInterface');
- $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(true);
- $adapter->shouldReceive('update')->once()->with('file.json', $response, Mockery::any());
- $cache = new Adapter($adapter, 'file.json', null);
- $cache->save();
- }
-
- public function testSaveNew()
- {
- $response = json_encode([[], [], null]);
- $adapter = Mockery::mock('League\Flysystem\AdapterInterface');
- $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(false);
- $adapter->shouldReceive('write')->once()->with('file.json', $response, Mockery::any());
- $cache = new Adapter($adapter, 'file.json', null);
- $cache->save();
- }
-
- public function testStoreContentsRecursive()
- {
- $adapter = Mockery::mock('League\Flysystem\AdapterInterface');
- $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(false);
- $adapter->shouldReceive('write')->once()->with('file.json', Mockery::any(), Mockery::any());
-
- $cache = new Adapter($adapter, 'file.json', null);
-
- $contents = [
- ['path' => 'foo/bar', 'dirname' => 'foo'],
- ['path' => 'afoo/bang', 'dirname' => 'afoo'],
- ];
-
- $cache->storeContents('foo', $contents, true);
-
- $this->assertTrue($cache->isComplete('foo', true));
- $this->assertFalse($cache->isComplete('afoo', true));
- }
-
- public function testDeleteDir()
- {
- $cache_data = [
- 'foo' => ['path' => 'foo', 'type' => 'dir', 'dirname' => ''],
- 'foo/bar' => ['path' => 'foo/bar', 'type' => 'file', 'dirname' => 'foo'],
- 'foobaz' => ['path' => 'foobaz', 'type' => 'file', 'dirname' => ''],
- ];
-
- $response = [
- 'contents' => json_encode([$cache_data, [], null]),
- 'path' => 'file.json',
- ];
-
- $adapter = Mockery::mock('League\Flysystem\AdapterInterface');
- $adapter->shouldReceive('has')->zeroOrMoreTimes()->with('file.json')->andReturn(true);
- $adapter->shouldReceive('read')->once()->with('file.json')->andReturn($response);
- $adapter->shouldReceive('update')->once()->with('file.json', Mockery::any(), Mockery::any())->andReturn(true);
-
- $cache = new Adapter($adapter, 'file.json', null);
- $cache->load();
-
- $cache->deleteDir('foo', true);
-
- $this->assertSame(1, count($cache->listContents('', true)));
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/tests/InspectionTests.php b/vendor/league/flysystem-cached-adapter/tests/InspectionTests.php
deleted file mode 100644
index 40d4c91..0000000
--- a/vendor/league/flysystem-cached-adapter/tests/InspectionTests.php
+++ /dev/null
@@ -1,16 +0,0 @@
-shouldReceive('load')->once();
- $cached_adapter = new CachedAdapter($adapter, $cache);
- $this->assertInstanceOf('League\Flysystem\AdapterInterface', $cached_adapter->getAdapter());
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/tests/MemcachedTests.php b/vendor/league/flysystem-cached-adapter/tests/MemcachedTests.php
deleted file mode 100644
index e3d9ad9..0000000
--- a/vendor/league/flysystem-cached-adapter/tests/MemcachedTests.php
+++ /dev/null
@@ -1,35 +0,0 @@
-shouldReceive('get')->once()->andReturn(false);
- $cache = new Memcached($client);
- $cache->load();
- $this->assertFalse($cache->isComplete('', false));
- }
-
- public function testLoadSuccess()
- {
- $response = json_encode([[], ['' => true]]);
- $client = Mockery::mock('Memcached');
- $client->shouldReceive('get')->once()->andReturn($response);
- $cache = new Memcached($client);
- $cache->load();
- $this->assertTrue($cache->isComplete('', false));
- }
-
- public function testSave()
- {
- $response = json_encode([[], []]);
- $client = Mockery::mock('Memcached');
- $client->shouldReceive('set')->once()->andReturn($response);
- $cache = new Memcached($client);
- $cache->save();
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/tests/MemoryCacheTests.php b/vendor/league/flysystem-cached-adapter/tests/MemoryCacheTests.php
deleted file mode 100644
index 3ac58fd..0000000
--- a/vendor/league/flysystem-cached-adapter/tests/MemoryCacheTests.php
+++ /dev/null
@@ -1,255 +0,0 @@
-setAutosave(true);
- $this->assertTrue($cache->getAutosave());
- $cache->setAutosave(false);
- $this->assertFalse($cache->getAutosave());
- }
-
- public function testCacheMiss()
- {
- $cache = new Memory();
- $cache->storeMiss('path.txt');
- $this->assertFalse($cache->has('path.txt'));
- }
-
- public function testIsComplete()
- {
- $cache = new Memory();
- $this->assertFalse($cache->isComplete('dirname', false));
- $cache->setComplete('dirname', false);
- $this->assertFalse($cache->isComplete('dirname', true));
- $cache->setComplete('dirname', true);
- $this->assertTrue($cache->isComplete('dirname', true));
- }
-
- public function testCleanContents()
- {
- $cache = new Memory();
- $input = [[
- 'path' => 'path.txt',
- 'visibility' => 'public',
- 'invalid' => 'thing',
- ]];
-
- $expected = [[
- 'path' => 'path.txt',
- 'visibility' => 'public',
- ]];
-
- $output = $cache->cleanContents($input);
- $this->assertEquals($expected, $output);
- }
-
- public function testGetForStorage()
- {
- $cache = new Memory();
- $input = [[
- 'path' => 'path.txt',
- 'visibility' => 'public',
- 'type' => 'file',
- ]];
-
- $cache->storeContents('', $input, true);
- $contents = $cache->listContents('', true);
- $cached = [];
- foreach ($contents as $item) {
- $cached[$item['path']] = $item;
- }
-
- $this->assertEquals(json_encode([$cached, ['' => 'recursive']]), $cache->getForStorage());
- }
-
- public function testParentCompleteIsUsedDuringHas()
- {
- $cache = new Memory();
- $cache->setComplete('dirname', false);
- $this->assertFalse($cache->has('dirname/path.txt'));
- }
-
- public function testFlush()
- {
- $cache = new Memory();
- $cache->setComplete('dirname', true);
- $cache->updateObject('path.txt', [
- 'path' => 'path.txt',
- 'visibility' => 'public',
- ]);
- $cache->flush();
- $this->assertFalse($cache->isComplete('dirname', true));
- $this->assertNull($cache->has('path.txt'));
- }
-
- public function testSetFromStorage()
- {
- $cache = new Memory();
- $json = [[
- 'path.txt' => ['path' => 'path.txt', 'type' => 'file'],
- ], ['dirname' => 'recursive']];
- $jsonString = json_encode($json);
- $cache->setFromStorage($jsonString);
- $this->assertTrue($cache->has('path.txt'));
- $this->assertTrue($cache->isComplete('dirname', true));
- }
-
- public function testGetMetadataFail()
- {
- $cache = new Memory();
- $this->assertFalse($cache->getMetadata('path.txt'));
- }
-
- public function metaGetterProvider()
- {
- return [
- ['getTimestamp', 'timestamp', 12344],
- ['getMimetype', 'mimetype', 'text/plain'],
- ['getSize', 'size', 12],
- ['getVisibility', 'visibility', 'private'],
- ['read', 'contents', '__contents__'],
- ];
- }
-
- /**
- * @dataProvider metaGetterProvider
- *
- * @param $method
- * @param $key
- * @param $value
- */
- public function testMetaGetters($method, $key, $value)
- {
- $cache = new Memory();
- $this->assertFalse($cache->{$method}('path.txt'));
- $cache->updateObject('path.txt', $object = [
- 'path' => 'path.txt',
- 'type' => 'file',
- $key => $value,
- ] + Util::pathinfo('path.txt'), true);
- $this->assertEquals($object, $cache->{$method}('path.txt'));
- $this->assertEquals($object, $cache->getMetadata('path.txt'));
- }
-
- public function testGetDerivedMimetype()
- {
- $cache = new Memory();
- $cache->updateObject('path.txt', [
- 'contents' => 'something',
- ]);
- $response = $cache->getMimetype('path.txt');
- $this->assertEquals('text/plain', $response['mimetype']);
- }
-
- public function testCopyFail()
- {
- $cache = new Memory();
- $cache->copy('one', 'two');
- $this->assertNull($cache->has('two'));
- $this->assertNull($cache->load());
- }
-
- public function testStoreContents()
- {
- $cache = new Memory();
- $cache->storeContents('dirname', [
- ['path' => 'dirname', 'type' => 'dir'],
- ['path' => 'dirname/nested', 'type' => 'dir'],
- ['path' => 'dirname/nested/deep', 'type' => 'dir'],
- ['path' => 'other/nested/deep', 'type' => 'dir'],
- ], true);
-
- $this->isTrue($cache->isComplete('other/nested', true));
- }
-
- public function testDelete()
- {
- $cache = new Memory();
- $cache->updateObject('path.txt', ['type' => 'file']);
- $this->assertTrue($cache->has('path.txt'));
- $cache->delete('path.txt');
- $this->assertFalse($cache->has('path.txt'));
- }
-
- public function testDeleteDir()
- {
- $cache = new Memory();
- $cache->storeContents('dirname', [
- ['path' => 'dirname/path.txt', 'type' => 'file'],
- ]);
- $this->assertTrue($cache->isComplete('dirname', false));
- $this->assertTrue($cache->has('dirname/path.txt'));
- $cache->deleteDir('dirname');
- $this->assertFalse($cache->isComplete('dirname', false));
- $this->assertNull($cache->has('dirname/path.txt'));
- }
-
- public function testReadStream()
- {
- $cache = new Memory();
- $this->assertFalse($cache->readStream('path.txt'));
- }
-
- public function testRename()
- {
- $cache = new Memory();
- $cache->updateObject('path.txt', ['type' => 'file']);
- $cache->rename('path.txt', 'newpath.txt');
- $this->assertTrue($cache->has('newpath.txt'));
- }
-
- public function testCopy()
- {
- $cache = new Memory();
- $cache->updateObject('path.txt', ['type' => 'file']);
- $cache->copy('path.txt', 'newpath.txt');
- $this->assertTrue($cache->has('newpath.txt'));
- }
-
- public function testComplextListContents()
- {
- $cache = new Memory();
- $cache->storeContents('', [
- ['path' => 'dirname', 'type' => 'dir'],
- ['path' => 'dirname/file.txt', 'type' => 'file'],
- ['path' => 'other', 'type' => 'dir'],
- ['path' => 'other/file.txt', 'type' => 'file'],
- ['path' => 'other/nested/file.txt', 'type' => 'file'],
- ]);
-
- $this->assertCount(3, $cache->listContents('other', true));
- }
-
- public function testComplextListContentsWithDeletedFile()
- {
- $cache = new Memory();
- $cache->storeContents('', [
- ['path' => 'dirname', 'type' => 'dir'],
- ['path' => 'dirname/file.txt', 'type' => 'file'],
- ['path' => 'other', 'type' => 'dir'],
- ['path' => 'other/file.txt', 'type' => 'file'],
- ['path' => 'other/another_file.txt', 'type' => 'file'],
- ]);
-
- $cache->delete('other/another_file.txt');
- $this->assertCount(4, $cache->listContents('', true));
- }
-
- public function testCacheMissIfContentsIsFalse()
- {
- $cache = new Memory();
- $cache->updateObject('path.txt', [
- 'path' => 'path.txt',
- 'contents' => false,
- ], true);
-
- $this->assertFalse($cache->read('path.txt'));
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/tests/NoopCacheTests.php b/vendor/league/flysystem-cached-adapter/tests/NoopCacheTests.php
deleted file mode 100644
index 148616f..0000000
--- a/vendor/league/flysystem-cached-adapter/tests/NoopCacheTests.php
+++ /dev/null
@@ -1,35 +0,0 @@
-assertEquals($cache, $cache->storeMiss('file.txt'));
- $this->assertNull($cache->setComplete('', false));
- $this->assertNull($cache->load());
- $this->assertNull($cache->flush());
- $this->assertNull($cache->has('path.txt'));
- $this->assertNull($cache->autosave());
- $this->assertFalse($cache->isComplete('', false));
- $this->assertFalse($cache->read('something'));
- $this->assertFalse($cache->readStream('something'));
- $this->assertFalse($cache->getMetadata('something'));
- $this->assertFalse($cache->getMimetype('something'));
- $this->assertFalse($cache->getSize('something'));
- $this->assertFalse($cache->getTimestamp('something'));
- $this->assertFalse($cache->getVisibility('something'));
- $this->assertEmpty($cache->listContents('', false));
- $this->assertFalse($cache->rename('', ''));
- $this->assertFalse($cache->copy('', ''));
- $this->assertNull($cache->save());
- $object = ['path' => 'path.ext'];
- $this->assertEquals($object, $cache->updateObject('path.txt', $object));
- $this->assertEquals([['path' => 'some/file.txt']], $cache->storeContents('unknwon', [
- ['path' => 'some/file.txt'],
- ], false));
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/tests/PhpRedisTests.php b/vendor/league/flysystem-cached-adapter/tests/PhpRedisTests.php
deleted file mode 100644
index d1ccb65..0000000
--- a/vendor/league/flysystem-cached-adapter/tests/PhpRedisTests.php
+++ /dev/null
@@ -1,45 +0,0 @@
-shouldReceive('get')->with('flysystem')->once()->andReturn(false);
- $cache = new PhpRedis($client);
- $cache->load();
- $this->assertFalse($cache->isComplete('', false));
- }
-
- public function testLoadSuccess()
- {
- $response = json_encode([[], ['' => true]]);
- $client = Mockery::mock('Redis');
- $client->shouldReceive('get')->with('flysystem')->once()->andReturn($response);
- $cache = new PhpRedis($client);
- $cache->load();
- $this->assertTrue($cache->isComplete('', false));
- }
-
- public function testSave()
- {
- $data = json_encode([[], []]);
- $client = Mockery::mock('Redis');
- $client->shouldReceive('set')->with('flysystem', $data)->once();
- $cache = new PhpRedis($client);
- $cache->save();
- }
-
- public function testSaveWithExpire()
- {
- $data = json_encode([[], []]);
- $client = Mockery::mock('Redis');
- $client->shouldReceive('set')->with('flysystem', $data)->once();
- $client->shouldReceive('expire')->with('flysystem', 20)->once();
- $cache = new PhpRedis($client, 'flysystem', 20);
- $cache->save();
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/tests/PredisTests.php b/vendor/league/flysystem-cached-adapter/tests/PredisTests.php
deleted file mode 100644
index e33e104..0000000
--- a/vendor/league/flysystem-cached-adapter/tests/PredisTests.php
+++ /dev/null
@@ -1,55 +0,0 @@
-shouldReceive('createCommand')->with('get', ['flysystem'])->once()->andReturn($command);
- $client->shouldReceive('executeCommand')->with($command)->andReturn(null);
- $cache = new Predis($client);
- $cache->load();
- $this->assertFalse($cache->isComplete('', false));
- }
-
- public function testLoadSuccess()
- {
- $response = json_encode([[], ['' => true]]);
- $client = Mockery::mock('Predis\Client');
- $command = Mockery::mock('Predis\Command\CommandInterface');
- $client->shouldReceive('createCommand')->with('get', ['flysystem'])->once()->andReturn($command);
- $client->shouldReceive('executeCommand')->with($command)->andReturn($response);
- $cache = new Predis($client);
- $cache->load();
- $this->assertTrue($cache->isComplete('', false));
- }
-
- public function testSave()
- {
- $data = json_encode([[], []]);
- $client = Mockery::mock('Predis\Client');
- $command = Mockery::mock('Predis\Command\CommandInterface');
- $client->shouldReceive('createCommand')->with('set', ['flysystem', $data])->once()->andReturn($command);
- $client->shouldReceive('executeCommand')->with($command)->once();
- $cache = new Predis($client);
- $cache->save();
- }
-
- public function testSaveWithExpire()
- {
- $data = json_encode([[], []]);
- $client = Mockery::mock('Predis\Client');
- $command = Mockery::mock('Predis\Command\CommandInterface');
- $client->shouldReceive('createCommand')->with('set', ['flysystem', $data])->once()->andReturn($command);
- $client->shouldReceive('executeCommand')->with($command)->once();
- $expireCommand = Mockery::mock('Predis\Command\CommandInterface');
- $client->shouldReceive('createCommand')->with('expire', ['flysystem', 20])->once()->andReturn($expireCommand);
- $client->shouldReceive('executeCommand')->with($expireCommand)->once();
- $cache = new Predis($client, 'flysystem', 20);
- $cache->save();
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/tests/Psr6CacheTest.php b/vendor/league/flysystem-cached-adapter/tests/Psr6CacheTest.php
deleted file mode 100644
index d5e5700..0000000
--- a/vendor/league/flysystem-cached-adapter/tests/Psr6CacheTest.php
+++ /dev/null
@@ -1,45 +0,0 @@
-shouldReceive('isHit')->once()->andReturn(false);
- $pool->shouldReceive('getItem')->once()->andReturn($item);
- $cache = new Psr6Cache($pool);
- $cache->load();
- $this->assertFalse($cache->isComplete('', false));
- }
-
- public function testLoadSuccess()
- {
- $response = json_encode([[], ['' => true]]);
- $pool = Mockery::mock('Psr\Cache\CacheItemPoolInterface');
- $item = Mockery::mock('Psr\Cache\CacheItemInterface');
- $item->shouldReceive('get')->once()->andReturn($response);
- $item->shouldReceive('isHit')->once()->andReturn(true);
- $pool->shouldReceive('getItem')->once()->andReturn($item);
- $cache = new Psr6Cache($pool);
- $cache->load();
- $this->assertTrue($cache->isComplete('', false));
- }
-
- public function testSave()
- {
- $response = json_encode([[], []]);
- $ttl = 4711;
- $pool = Mockery::mock('Psr\Cache\CacheItemPoolInterface');
- $item = Mockery::mock('Psr\Cache\CacheItemInterface');
- $item->shouldReceive('expiresAfter')->once()->with($ttl);
- $item->shouldReceive('set')->once()->andReturn($response);
- $pool->shouldReceive('getItem')->once()->andReturn($item);
- $pool->shouldReceive('save')->once()->with($item);
- $cache = new Psr6Cache($pool, 'foo', $ttl);
- $cache->save();
- }
-}
diff --git a/vendor/league/flysystem-cached-adapter/tests/StashTest.php b/vendor/league/flysystem-cached-adapter/tests/StashTest.php
deleted file mode 100644
index 29e142d..0000000
--- a/vendor/league/flysystem-cached-adapter/tests/StashTest.php
+++ /dev/null
@@ -1,43 +0,0 @@
-shouldReceive('get')->once()->andReturn(null);
- $item->shouldReceive('isMiss')->once()->andReturn(true);
- $pool->shouldReceive('getItem')->once()->andReturn($item);
- $cache = new Stash($pool);
- $cache->load();
- $this->assertFalse($cache->isComplete('', false));
- }
-
- public function testLoadSuccess()
- {
- $response = json_encode([[], ['' => true]]);
- $pool = Mockery::mock('Stash\Pool');
- $item = Mockery::mock('Stash\Item');
- $item->shouldReceive('get')->once()->andReturn($response);
- $item->shouldReceive('isMiss')->once()->andReturn(false);
- $pool->shouldReceive('getItem')->once()->andReturn($item);
- $cache = new Stash($pool);
- $cache->load();
- $this->assertTrue($cache->isComplete('', false));
- }
-
- public function testSave()
- {
- $response = json_encode([[], []]);
- $pool = Mockery::mock('Stash\Pool');
- $item = Mockery::mock('Stash\Item');
- $item->shouldReceive('set')->once()->andReturn($response);
- $pool->shouldReceive('getItem')->once()->andReturn($item);
- $cache = new Stash($pool);
- $cache->save();
- }
-}
diff --git a/vendor/league/flysystem/CODE_OF_CONDUCT.md b/vendor/league/flysystem/CODE_OF_CONDUCT.md
deleted file mode 100644
index 89569c0..0000000
--- a/vendor/league/flysystem/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,76 +0,0 @@
-# Contributor Covenant Code of Conduct
-
-## Our Pledge
-
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to making participation in our project and
-our community a harassment-free experience for everyone, regardless of age, body
-size, disability, ethnicity, sex characteristics, gender identity and expression,
-level of experience, education, socio-economic status, nationality, personal
-appearance, race, religion, or sexual identity and orientation.
-
-## Our Standards
-
-Examples of behavior that contributes to creating a positive environment
-include:
-
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
-
-Examples of unacceptable behavior by participants include:
-
-* The use of sexualized language or imagery and unwelcome sexual attention or
- advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic
- address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a
- professional setting
-
-## Our Responsibilities
-
-Project maintainers are responsible for clarifying the standards of acceptable
-behavior and are expected to take appropriate and fair corrective action in
-response to any instances of unacceptable behavior.
-
-Project maintainers have the right and responsibility to remove, edit, or
-reject comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to this Code of Conduct, or to ban temporarily or
-permanently any contributor for other behaviors that they deem inappropriate,
-threatening, offensive, or harmful.
-
-## Scope
-
-This Code of Conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community. Examples of
-representing a project or community include using an official project e-mail
-address, posting via an official social media account, or acting as an appointed
-representative at an online or offline event. Representation of a project may be
-further defined and clarified by project maintainers.
-
-## Enforcement
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported by contacting the project team at info+flysystem@frankdejonge.nl. All
-complaints will be reviewed and investigated and will result in a response that
-is deemed necessary and appropriate to the circumstances. The project team is
-obligated to maintain confidentiality with regard to the reporter of an incident.
-Further details of specific enforcement policies may be posted separately.
-
-Project maintainers who do not follow or enforce the Code of Conduct in good
-faith may face temporary or permanent repercussions as determined by other
-members of the project's leadership.
-
-## Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
-
-[homepage]: https://www.contributor-covenant.org
-
-For answers to common questions about this code of conduct, see
-https://www.contributor-covenant.org/faq
diff --git a/vendor/league/flysystem/INFO.md b/vendor/league/flysystem/INFO.md
deleted file mode 100644
index 8a44d14..0000000
--- a/vendor/league/flysystem/INFO.md
+++ /dev/null
@@ -1,2 +0,0 @@
-View the docs at: https://flysystem.thephpleague.com/v2/
-Changelog at: https://github.com/thephpleague/flysystem/blob/2.x/CHANGELOG.md
diff --git a/vendor/league/flysystem/LICENSE b/vendor/league/flysystem/LICENSE
deleted file mode 100644
index f2684c8..0000000
--- a/vendor/league/flysystem/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2013-2019 Frank de Jonge
-
-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.
diff --git a/vendor/league/flysystem/SECURITY.md b/vendor/league/flysystem/SECURITY.md
deleted file mode 100644
index f5b205e..0000000
--- a/vendor/league/flysystem/SECURITY.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# Security Policy
-
-## Supported Versions
-
-| Version | Supported |
-| ------- | ------------------ |
-| 1.0.x | :white_check_mark: |
-| 2.0.x | :x: |
-
-## Reporting a Vulnerability
-
-When you've encountered a security vulnerability, please disclose it securely.
-
-The security process is described at:
-[https://flysystem.thephpleague.com/docs/security/](https://flysystem.thephpleague.com/docs/security/)
-
diff --git a/vendor/league/flysystem/composer.json b/vendor/league/flysystem/composer.json
deleted file mode 100644
index 32ec81d..0000000
--- a/vendor/league/flysystem/composer.json
+++ /dev/null
@@ -1,68 +0,0 @@
-{
- "name": "league/flysystem",
- "type": "library",
- "description": "Filesystem abstraction: Many filesystems, one API.",
- "keywords": [
- "filesystem", "filesystems", "files", "storage", "dropbox", "aws",
- "abstraction", "s3", "ftp", "sftp", "remote", "webdav",
- "file systems", "cloud", "cloud files", "rackspace", "copy.com"
- ],
- "funding": [
- {
- "type": "other",
- "url": "https://offset.earth/frankdejonge"
- }
- ],
- "license": "MIT",
- "authors": [
- {
- "name": "Frank de Jonge",
- "email": "info@frenky.net"
- }
- ],
- "require": {
- "php": "^7.2.5 || ^8.0",
- "ext-fileinfo": "*",
- "league/mime-type-detection": "^1.3"
- },
- "require-dev": {
- "phpspec/prophecy": "^1.11.1",
- "phpunit/phpunit": "^8.5.8"
- },
- "autoload": {
- "psr-4": {
- "League\\Flysystem\\": "src/"
- }
- },
- "autoload-dev": {
- "psr-4": {
- "League\\Flysystem\\Stub\\": "stub/"
- }
- },
- "suggest": {
- "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem",
- "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
- "league/flysystem-azure": "Allows you to use Windows Azure Blob storage",
- "league/flysystem-webdav": "Allows you to use WebDAV storage",
- "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
- "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",
- "spatie/flysystem-dropbox": "Allows you to use Dropbox storage",
- "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications",
- "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching",
- "ext-ftp": "Allows you to use FTP server storage",
- "ext-openssl": "Allows you to use FTPS server storage",
- "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib",
- "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter"
- },
- "conflict": {
- "league/flysystem-sftp": "<1.0.6"
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
- },
- "scripts": {
- "phpstan": "php phpstan.php"
- }
-}
diff --git a/vendor/league/flysystem/config.subsplit-publish.json b/vendor/league/flysystem/config.subsplit-publish.json
deleted file mode 100644
index b0de91e..0000000
--- a/vendor/league/flysystem/config.subsplit-publish.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "sub-splits": [
- {
- "name": "ftp",
- "directory": "src/Ftp",
- "target": "git@github.com:thephpleague/flysystem-ftp.git"
- },
- {
- "name": "sftp",
- "directory": "src/PhpseclibV2",
- "target": "git@github.com:thephpleague/flysystem-sftp.git"
- },
- {
- "name": "sftp-v3",
- "directory": "src/PhpseclibV3",
- "target": "git@github.com:thephpleague/flysystem-sftp-v3.git"
- },
- {
- "name": "memory",
- "directory": "src/InMemory",
- "target": "git@github.com:thephpleague/flysystem-memory.git"
- },
- {
- "name": "ziparchive",
- "directory": "src/ZipArchive",
- "target": "git@github.com:thephpleague/flysystem-ziparchive.git"
- },
- {
- "name": "aws-s3-v3",
- "directory": "src/AwsS3V3",
- "target": "git@github.com:thephpleague/flysystem-aws-s3-v3.git"
- },
- {
- "name": "async-aws-s3",
- "directory": "src/AsyncAwsS3",
- "target": "git@github.com:thephpleague/flysystem-async-aws-s3.git"
- },
- {
- "name": "google-cloud-storage",
- "directory": "src/GoogleCloudStorage",
- "target": "git@github.com:thephpleague/flysystem-google-cloud-storage.git"
- },
- {
- "name": "adapter-test-utilities",
- "directory": "src/AdapterTestUtilities",
- "target": "git@github.com:thephpleague/flysystem-adapter-test-utilities.git"
- }
- ]
-}
diff --git a/vendor/league/flysystem/deprecations.md b/vendor/league/flysystem/deprecations.md
deleted file mode 100644
index c336a42..0000000
--- a/vendor/league/flysystem/deprecations.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# Deprecations
-
-This document lists all the planned deprecations.
-
-## Handlers will be removed in 2.0
-
-The `Handler` type and associated calls will be removed in version 2.0.
-
-### Upgrade path
-
-You should create your own implementation for handling OOP usage,
-but it's recommended to move away from using an OOP-style wrapper entirely.
-
-The reason for this is that it's too easy for implementation details (for
-your application this is Flysystem) to leak into the application. The most
-important part for Flysystem is that it improves portability and creates a
-solid boundary between your application core and the infrastructure you use.
-The OOP-style handling breaks this principle, therefore I want to stop
-promoting it.
diff --git a/vendor/league/flysystem/docker-compose.yml b/vendor/league/flysystem/docker-compose.yml
deleted file mode 100644
index 3ab6b77..0000000
--- a/vendor/league/flysystem/docker-compose.yml
+++ /dev/null
@@ -1,58 +0,0 @@
----
-version: "3"
-services:
- webdav:
- image: bytemark/webdav
- restart: always
- ports:
- - "80:80"
- environment:
- AUTH_TYPE: Digest
- USERNAME: alice
- PASSWORD: secret1234
- sftp:
- container_name: sftp
- restart: always
- image: atmoz/sftp
- volumes:
- - ./test_files/sftp/users.conf:/etc/sftp/users.conf
- - ./test_files/sftp/ssh_host_ed25519_key:/etc/ssh/ssh_host_ed25519_key
- - ./test_files/sftp/ssh_host_rsa_key:/etc/ssh/ssh_host_rsa_key
- - ./test_files/sftp/id_rsa.pub:/home/bar/.ssh/keys/id_rsa.pub
- ports:
- - "2222:22"
- ftp:
- container_name: ftp
- restart: always
- image: delfer/alpine-ftp-server
- environment:
- USERS: 'foo|pass|/home/foo/upload'
- ADDRESS: 'localhost'
- ports:
- - "2121:21"
- - "21000-21010:21000-21010"
- ftpd:
- container_name: ftpd
- restart: always
- environment:
- PUBLICHOST: localhost
- FTP_USER_NAME: foo
- FTP_USER_PASS: pass
- FTP_USER_HOME: /home/foo
- image: stilliard/pure-ftpd
- ports:
- - "2122:21"
- - "30000-30009:30000-30009"
- command: "/run.sh -l puredb:/etc/pure-ftpd/pureftpd.pdb -E -j -P localhost"
- toxiproxy:
- container_name: toxiproxy
- restart: unless-stopped
- image: ghcr.io/shopify/toxiproxy
- command: "-host 0.0.0.0 -config /opt/toxiproxy/config.json"
- volumes:
- - ./test_files/toxiproxy/toxiproxy.json:/opt/toxiproxy/config.json:ro
- ports:
- - "8474:8474" # HTTP API
- - "8222:8222" # SFTP
- - "8121:8121" # FTP
- - "8122:8122" # FTPD
diff --git a/vendor/league/flysystem/readme.md b/vendor/league/flysystem/readme.md
deleted file mode 100644
index 0c0b98e..0000000
--- a/vendor/league/flysystem/readme.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# League\Flysystem
-
-[](https://twitter.com/frankdejonge)
-[](https://github.com/thephpleague/flysystem)
-[](https://github.com/thephpleague/flysystem/releases)
-[](https://github.com/thephpleague/flysystem/blob/master/LICENSE)
-[](https://github.com/thephpleague/flysystem/actions?query=workflow%3A%22Quality+Assurance%22)
-[](https://packagist.org/packages/league/flysystem)
-
-
-## About Flysystem
-
-Flysystem is a file storage library for PHP. It provides one interface to
-interact with many types of filesystems. When you use Flysystem, you're
-not only protected from vendor lock-in, you'll also have a consistent experience
-for which ever storage is right for you.
-
-## Getting Started
-
-* **[New in V2](https://flysystem.thephpleague.com/v2/docs/what-is-new/)**: What it new in Flysystem V2?
-* **[Architecture](https://flysystem.thephpleague.com/v2/docs/architecture/)**: Flysystem's internal architecture
-* **[Flysystem API](https://flysystem.thephpleague.com/v2/docs/usage/filesystem-api/)**: How to interact with your Flysystem instance
-* **[Upgrade to V2](https://flysystem.thephpleague.com/v2/docs/advanced/upgrade-to-2.0.0/)**: How to upgrade your Flysystem V1 instance to V2
-
-### Commonly-Used Adapters
-
-* **[AsyncAws S3](https://flysystem.thephpleague.com/v2/docs/adapter/async-aws-s3/)**
-* **[AWS S3](https://flysystem.thephpleague.com/v2/docs/adapter/aws-s3-v3/)**
-* **[Local](https://flysystem.thephpleague.com/v2/docs/adapter/local/)**
-* **[Memory](https://flysystem.thephpleague.com/v2/docs/adapter/in-memory/)**
-
-### Third party Adapters
-
-* **[Gitlab](https://github.com/RoyVoetman/flysystem-gitlab-storage)**
-* **[Google Drive (using regular paths)](https://github.com/masbug/flysystem-google-drive-ext)**
-
-You can always [create an adapter](https://flysystem.thephpleague.com/v2/docs/advanced/creating-an-adapter/) yourself.
-
-## Security
-
-If you discover any security related issues, please email info@frankdejonge.nl instead of using the issue tracker.
-
-## Enjoy
-
-Oh, and if you've come down this far, you might as well follow me on [twitter](https://twitter.com/frankdejonge).
diff --git a/vendor/league/flysystem/src/Adapter/AbstractAdapter.php b/vendor/league/flysystem/src/Adapter/AbstractAdapter.php
deleted file mode 100644
index a6a8ed0..0000000
--- a/vendor/league/flysystem/src/Adapter/AbstractAdapter.php
+++ /dev/null
@@ -1,72 +0,0 @@
-pathPrefix = null;
-
- return;
- }
-
- $this->pathPrefix = rtrim($prefix, '\\/') . $this->pathSeparator;
- }
-
- /**
- * Get the path prefix.
- *
- * @return string|null path prefix or null if pathPrefix is empty
- */
- public function getPathPrefix()
- {
- return $this->pathPrefix;
- }
-
- /**
- * Prefix a path.
- *
- * @param string $path
- *
- * @return string prefixed path
- */
- public function applyPathPrefix($path)
- {
- return $this->getPathPrefix() . ltrim($path, '\\/');
- }
-
- /**
- * Remove a path prefix.
- *
- * @param string $path
- *
- * @return string path without the prefix
- */
- public function removePathPrefix($path)
- {
- return substr($path, strlen((string) $this->getPathPrefix()));
- }
-}
diff --git a/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php b/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php
deleted file mode 100644
index 25d949e..0000000
--- a/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php
+++ /dev/null
@@ -1,705 +0,0 @@
-safeStorage = new SafeStorage();
- $this->setConfig($config);
- }
-
- /**
- * Set the config.
- *
- * @param array $config
- *
- * @return $this
- */
- public function setConfig(array $config)
- {
- foreach ($this->configurable as $setting) {
- if ( ! isset($config[$setting])) {
- continue;
- }
-
- $method = 'set' . ucfirst($setting);
-
- if (method_exists($this, $method)) {
- $this->$method($config[$setting]);
- }
- }
-
- return $this;
- }
-
- /**
- * Returns the host.
- *
- * @return string
- */
- public function getHost()
- {
- return $this->host;
- }
-
- /**
- * Set the host.
- *
- * @param string $host
- *
- * @return $this
- */
- public function setHost($host)
- {
- $this->host = $host;
-
- return $this;
- }
-
- /**
- * Set the public permission value.
- *
- * @param int $permPublic
- *
- * @return $this
- */
- public function setPermPublic($permPublic)
- {
- $this->permPublic = $permPublic;
-
- return $this;
- }
-
- /**
- * Set the private permission value.
- *
- * @param int $permPrivate
- *
- * @return $this
- */
- public function setPermPrivate($permPrivate)
- {
- $this->permPrivate = $permPrivate;
-
- return $this;
- }
-
- /**
- * Returns the ftp port.
- *
- * @return int
- */
- public function getPort()
- {
- return $this->port;
- }
-
- /**
- * Returns the root folder to work from.
- *
- * @return string
- */
- public function getRoot()
- {
- return $this->root;
- }
-
- /**
- * Set the ftp port.
- *
- * @param int|string $port
- *
- * @return $this
- */
- public function setPort($port)
- {
- $this->port = (int) $port;
-
- return $this;
- }
-
- /**
- * Set the root folder to work from.
- *
- * @param string $root
- *
- * @return $this
- */
- public function setRoot($root)
- {
- $this->root = rtrim($root, '\\/') . $this->separator;
-
- return $this;
- }
-
- /**
- * Returns the ftp username.
- *
- * @return string username
- */
- public function getUsername()
- {
- $username = $this->safeStorage->retrieveSafely('username');
-
- return $username !== null ? $username : 'anonymous';
- }
-
- /**
- * Set ftp username.
- *
- * @param string $username
- *
- * @return $this
- */
- public function setUsername($username)
- {
- $this->safeStorage->storeSafely('username', $username);
-
- return $this;
- }
-
- /**
- * Returns the password.
- *
- * @return string password
- */
- public function getPassword()
- {
- return $this->safeStorage->retrieveSafely('password');
- }
-
- /**
- * Set the ftp password.
- *
- * @param string $password
- *
- * @return $this
- */
- public function setPassword($password)
- {
- $this->safeStorage->storeSafely('password', $password);
-
- return $this;
- }
-
- /**
- * Returns the amount of seconds before the connection will timeout.
- *
- * @return int
- */
- public function getTimeout()
- {
- return $this->timeout;
- }
-
- /**
- * Set the amount of seconds before the connection should timeout.
- *
- * @param int $timeout
- *
- * @return $this
- */
- public function setTimeout($timeout)
- {
- $this->timeout = (int) $timeout;
-
- return $this;
- }
-
- /**
- * Return the FTP system type.
- *
- * @return string
- */
- public function getSystemType()
- {
- return $this->systemType;
- }
-
- /**
- * Set the FTP system type (windows or unix).
- *
- * @param string $systemType
- *
- * @return $this
- */
- public function setSystemType($systemType)
- {
- $this->systemType = strtolower($systemType);
-
- return $this;
- }
-
- /**
- * True to enable timestamps for FTP servers that return unix-style listings.
- *
- * @param bool $bool
- *
- * @return $this
- */
- public function setEnableTimestampsOnUnixListings($bool = false)
- {
- $this->enableTimestampsOnUnixListings = $bool;
-
- return $this;
- }
-
- /**
- * @inheritdoc
- */
- public function listContents($directory = '', $recursive = false)
- {
- return $this->listDirectoryContents($directory, $recursive);
- }
-
- abstract protected function listDirectoryContents($directory, $recursive = false);
-
- /**
- * Normalize a directory listing.
- *
- * @param array $listing
- * @param string $prefix
- *
- * @return array directory listing
- */
- protected function normalizeListing(array $listing, $prefix = '')
- {
- $base = $prefix;
- $result = [];
- $listing = $this->removeDotDirectories($listing);
-
- while ($item = array_shift($listing)) {
- if (preg_match('#^.*:$#', $item)) {
- $base = preg_replace('~^\./*|:$~', '', $item);
- continue;
- }
-
- $result[] = $this->normalizeObject($item, $base);
- }
-
- return $this->sortListing($result);
- }
-
- /**
- * Sort a directory listing.
- *
- * @param array $result
- *
- * @return array sorted listing
- */
- protected function sortListing(array $result)
- {
- $compare = function ($one, $two) {
- return strnatcmp($one['path'], $two['path']);
- };
-
- usort($result, $compare);
-
- return $result;
- }
-
- /**
- * Normalize a file entry.
- *
- * @param string $item
- * @param string $base
- *
- * @return array normalized file array
- *
- * @throws NotSupportedException
- */
- protected function normalizeObject($item, $base)
- {
- $systemType = $this->systemType ?: $this->detectSystemType($item);
-
- if ($systemType === 'unix') {
- return $this->normalizeUnixObject($item, $base);
- } elseif ($systemType === 'windows') {
- return $this->normalizeWindowsObject($item, $base);
- }
-
- throw NotSupportedException::forFtpSystemType($systemType);
- }
-
- /**
- * Normalize a Unix file entry.
- *
- * Given $item contains:
- * '-rw-r--r-- 1 ftp ftp 409 Aug 19 09:01 file1.txt'
- *
- * This function will return:
- * [
- * 'type' => 'file',
- * 'path' => 'file1.txt',
- * 'visibility' => 'public',
- * 'size' => 409,
- * 'timestamp' => 1566205260
- * ]
- *
- * @param string $item
- * @param string $base
- *
- * @return array normalized file array
- */
- protected function normalizeUnixObject($item, $base)
- {
- $item = preg_replace('#\s+#', ' ', trim($item), 7);
-
- if (count(explode(' ', $item, 9)) !== 9) {
- throw new RuntimeException("Metadata can't be parsed from item '$item' , not enough parts.");
- }
-
- list($permissions, /* $number */, /* $owner */, /* $group */, $size, $month, $day, $timeOrYear, $name) = explode(' ', $item, 9);
- $type = $this->detectType($permissions);
- $path = $base === '' ? $name : $base . $this->separator . $name;
-
- if ($type === 'dir') {
- $result = compact('type', 'path');
- if ($this->enableTimestampsOnUnixListings) {
- $timestamp = $this->normalizeUnixTimestamp($month, $day, $timeOrYear);
- $result += compact('timestamp');
- }
-
- return $result;
- }
-
- $permissions = $this->normalizePermissions($permissions);
- $visibility = $permissions & 0044 ? AdapterInterface::VISIBILITY_PUBLIC : AdapterInterface::VISIBILITY_PRIVATE;
- $size = (int) $size;
-
- $result = compact('type', 'path', 'visibility', 'size');
- if ($this->enableTimestampsOnUnixListings) {
- $timestamp = $this->normalizeUnixTimestamp($month, $day, $timeOrYear);
- $result += compact('timestamp');
- }
-
- return $result;
- }
-
- /**
- * Only accurate to the minute (current year), or to the day.
- *
- * Inadequacies in timestamp accuracy are due to limitations of the FTP 'LIST' command
- *
- * Note: The 'MLSD' command is a machine-readable replacement for 'LIST'
- * but many FTP servers do not support it :(
- *
- * @param string $month e.g. 'Aug'
- * @param string $day e.g. '19'
- * @param string $timeOrYear e.g. '09:01' OR '2015'
- *
- * @return int
- */
- protected function normalizeUnixTimestamp($month, $day, $timeOrYear)
- {
- if (is_numeric($timeOrYear)) {
- $year = $timeOrYear;
- $hour = '00';
- $minute = '00';
- $seconds = '00';
- } else {
- $year = date('Y');
- list($hour, $minute) = explode(':', $timeOrYear);
- $seconds = '00';
- }
- $dateTime = DateTime::createFromFormat('Y-M-j-G:i:s', "{$year}-{$month}-{$day}-{$hour}:{$minute}:{$seconds}");
-
- return $dateTime->getTimestamp();
- }
-
- /**
- * Normalize a Windows/DOS file entry.
- *
- * @param string $item
- * @param string $base
- *
- * @return array normalized file array
- */
- protected function normalizeWindowsObject($item, $base)
- {
- $item = preg_replace('#\s+#', ' ', trim($item), 3);
-
- if (count(explode(' ', $item, 4)) !== 4) {
- throw new RuntimeException("Metadata can't be parsed from item '$item' , not enough parts.");
- }
-
- list($date, $time, $size, $name) = explode(' ', $item, 4);
- $path = $base === '' ? $name : $base . $this->separator . $name;
-
- // Check for the correct date/time format
- $format = strlen($date) === 8 ? 'm-d-yH:iA' : 'Y-m-dH:i';
- $dt = DateTime::createFromFormat($format, $date . $time);
- $timestamp = $dt ? $dt->getTimestamp() : (int) strtotime("$date $time");
-
- if ($size === '') {
- $type = 'dir';
-
- return compact('type', 'path', 'timestamp');
- }
-
- $type = 'file';
- $visibility = AdapterInterface::VISIBILITY_PUBLIC;
- $size = (int) $size;
-
- return compact('type', 'path', 'visibility', 'size', 'timestamp');
- }
-
- /**
- * Get the system type from a listing item.
- *
- * @param string $item
- *
- * @return string the system type
- */
- protected function detectSystemType($item)
- {
- return preg_match('/^[0-9]{2,4}-[0-9]{2}-[0-9]{2}/', trim($item)) ? 'windows' : 'unix';
- }
-
- /**
- * Get the file type from the permissions.
- *
- * @param string $permissions
- *
- * @return string file type
- */
- protected function detectType($permissions)
- {
- return substr($permissions, 0, 1) === 'd' ? 'dir' : 'file';
- }
-
- /**
- * Normalize a permissions string.
- *
- * @param string $permissions
- *
- * @return int
- */
- protected function normalizePermissions($permissions)
- {
- if (is_numeric($permissions)) {
- return ((int) $permissions) & 0777;
- }
-
- // remove the type identifier
- $permissions = substr($permissions, 1);
-
- // map the string rights to the numeric counterparts
- $map = ['-' => '0', 'r' => '4', 'w' => '2', 'x' => '1'];
- $permissions = strtr($permissions, $map);
-
- // split up the permission groups
- $parts = str_split($permissions, 3);
-
- // convert the groups
- $mapper = function ($part) {
- return array_sum(str_split($part));
- };
-
- // converts to decimal number
- return octdec(implode('', array_map($mapper, $parts)));
- }
-
- /**
- * Filter out dot-directories.
- *
- * @param array $list
- *
- * @return array
- */
- public function removeDotDirectories(array $list)
- {
- $filter = function ($line) {
- return $line !== '' && ! preg_match('#.* \.(\.)?$|^total#', $line);
- };
-
- return array_filter($list, $filter);
- }
-
- /**
- * @inheritdoc
- */
- public function has($path)
- {
- return $this->getMetadata($path);
- }
-
- /**
- * @inheritdoc
- */
- public function getSize($path)
- {
- return $this->getMetadata($path);
- }
-
- /**
- * @inheritdoc
- */
- public function getVisibility($path)
- {
- return $this->getMetadata($path);
- }
-
- /**
- * Ensure a directory exists.
- *
- * @param string $dirname
- */
- public function ensureDirectory($dirname)
- {
- $dirname = (string) $dirname;
-
- if ($dirname !== '' && ! $this->has($dirname)) {
- $this->createDir($dirname, new Config());
- }
- }
-
- /**
- * @return mixed
- */
- public function getConnection()
- {
- if ( ! $this->isConnected()) {
- $this->disconnect();
- $this->connect();
- }
-
- return $this->connection;
- }
-
- /**
- * Get the public permission value.
- *
- * @return int
- */
- public function getPermPublic()
- {
- return $this->permPublic;
- }
-
- /**
- * Get the private permission value.
- *
- * @return int
- */
- public function getPermPrivate()
- {
- return $this->permPrivate;
- }
-
- /**
- * Disconnect on destruction.
- */
- public function __destruct()
- {
- $this->disconnect();
- }
-
- /**
- * Establish a connection.
- */
- abstract public function connect();
-
- /**
- * Close the connection.
- */
- abstract public function disconnect();
-
- /**
- * Check if a connection is active.
- *
- * @return bool
- */
- abstract public function isConnected();
-
- protected function escapePath($path)
- {
- return str_replace(['*', '[', ']'], ['\\*', '\\[', '\\]'], $path);
- }
-}
diff --git a/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php b/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php
deleted file mode 100644
index fd8d216..0000000
--- a/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php
+++ /dev/null
@@ -1,12 +0,0 @@
-transferMode = $mode;
-
- return $this;
- }
-
- /**
- * Set if Ssl is enabled.
- *
- * @param bool $ssl
- *
- * @return $this
- */
- public function setSsl($ssl)
- {
- $this->ssl = (bool) $ssl;
-
- return $this;
- }
-
- /**
- * Set if passive mode should be used.
- *
- * @param bool $passive
- */
- public function setPassive($passive = true)
- {
- $this->passive = $passive;
- }
-
- /**
- * @param bool $ignorePassiveAddress
- */
- public function setIgnorePassiveAddress($ignorePassiveAddress)
- {
- $this->ignorePassiveAddress = $ignorePassiveAddress;
- }
-
- /**
- * @param bool $recurseManually
- */
- public function setRecurseManually($recurseManually)
- {
- $this->recurseManually = $recurseManually;
- }
-
- /**
- * @param bool $utf8
- */
- public function setUtf8($utf8)
- {
- $this->utf8 = (bool) $utf8;
- }
-
- /**
- * Connect to the FTP server.
- */
- public function connect()
- {
- $tries = 3;
- start_connecting:
-
- if ($this->ssl) {
- $this->connection = @ftp_ssl_connect($this->getHost(), $this->getPort(), $this->getTimeout());
- } else {
- $this->connection = @ftp_connect($this->getHost(), $this->getPort(), $this->getTimeout());
- }
-
- if ( ! $this->connection) {
- $tries--;
-
- if ($tries > 0) goto start_connecting;
-
- throw new ConnectionRuntimeException('Could not connect to host: ' . $this->getHost() . ', port:' . $this->getPort());
- }
-
- $this->login();
- $this->setUtf8Mode();
- $this->setConnectionPassiveMode();
- $this->setConnectionRoot();
- $this->isPureFtpd = $this->isPureFtpdServer();
- }
-
- /**
- * Set the connection to UTF-8 mode.
- */
- protected function setUtf8Mode()
- {
- if ($this->utf8) {
- $response = ftp_raw($this->connection, "OPTS UTF8 ON");
- if (!in_array(substr($response[0], 0, 3), ['200', '202'])) {
- throw new ConnectionRuntimeException(
- 'Could not set UTF-8 mode for connection: ' . $this->getHost() . '::' . $this->getPort()
- );
- }
- }
- }
-
- /**
- * Set the connections to passive mode.
- *
- * @throws ConnectionRuntimeException
- */
- protected function setConnectionPassiveMode()
- {
- if (is_bool($this->ignorePassiveAddress) && defined('FTP_USEPASVADDRESS')) {
- ftp_set_option($this->connection, FTP_USEPASVADDRESS, ! $this->ignorePassiveAddress);
- }
-
- if ( ! ftp_pasv($this->connection, $this->passive)) {
- throw new ConnectionRuntimeException(
- 'Could not set passive mode for connection: ' . $this->getHost() . '::' . $this->getPort()
- );
- }
- }
-
- /**
- * Set the connection root.
- */
- protected function setConnectionRoot()
- {
- $root = $this->getRoot();
- $connection = $this->connection;
-
- if ($root && ! ftp_chdir($connection, $root)) {
- throw new InvalidRootException('Root is invalid or does not exist: ' . $this->getRoot());
- }
-
- // Store absolute path for further reference.
- // This is needed when creating directories and
- // initial root was a relative path, else the root
- // would be relative to the chdir'd path.
- $this->root = ftp_pwd($connection);
- }
-
- /**
- * Login.
- *
- * @throws ConnectionRuntimeException
- */
- protected function login()
- {
- set_error_handler(function () {
- });
- $isLoggedIn = ftp_login(
- $this->connection,
- $this->getUsername(),
- $this->getPassword()
- );
- restore_error_handler();
-
- if ( ! $isLoggedIn) {
- $this->disconnect();
- throw new ConnectionRuntimeException(
- 'Could not login with connection: ' . $this->getHost() . '::' . $this->getPort(
- ) . ', username: ' . $this->getUsername()
- );
- }
- }
-
- /**
- * Disconnect from the FTP server.
- */
- public function disconnect()
- {
- if ($this->hasFtpConnection()) {
- @ftp_close($this->connection);
- }
-
- $this->connection = null;
- }
-
- /**
- * @inheritdoc
- */
- public function write($path, $contents, Config $config)
- {
- $stream = fopen('php://temp', 'w+b');
- fwrite($stream, $contents);
- rewind($stream);
- $result = $this->writeStream($path, $stream, $config);
- fclose($stream);
-
- if ($result === false) {
- return false;
- }
-
- $result['contents'] = $contents;
- $result['mimetype'] = $config->get('mimetype') ?: Util::guessMimeType($path, $contents);
-
- return $result;
- }
-
- /**
- * @inheritdoc
- */
- public function writeStream($path, $resource, Config $config)
- {
- $this->ensureDirectory(Util::dirname($path));
-
- if ( ! ftp_fput($this->getConnection(), $path, $resource, $this->transferMode)) {
- return false;
- }
-
- if ($visibility = $config->get('visibility')) {
- $this->setVisibility($path, $visibility);
- }
-
- $type = 'file';
-
- return compact('type', 'path', 'visibility');
- }
-
- /**
- * @inheritdoc
- */
- public function update($path, $contents, Config $config)
- {
- return $this->write($path, $contents, $config);
- }
-
- /**
- * @inheritdoc
- */
- public function updateStream($path, $resource, Config $config)
- {
- return $this->writeStream($path, $resource, $config);
- }
-
- /**
- * @inheritdoc
- */
- public function rename($path, $newpath)
- {
- return ftp_rename($this->getConnection(), $path, $newpath);
- }
-
- /**
- * @inheritdoc
- */
- public function delete($path)
- {
- return ftp_delete($this->getConnection(), $path);
- }
-
- /**
- * @inheritdoc
- */
- public function deleteDir($dirname)
- {
- $connection = $this->getConnection();
- $contents = array_reverse($this->listDirectoryContents($dirname, false));
-
- foreach ($contents as $object) {
- if ($object['type'] === 'file') {
- if ( ! ftp_delete($connection, $object['path'])) {
- return false;
- }
- } elseif ( ! $this->deleteDir($object['path'])) {
- return false;
- }
- }
-
- return ftp_rmdir($connection, $dirname);
- }
-
- /**
- * @inheritdoc
- */
- public function createDir($dirname, Config $config)
- {
- $connection = $this->getConnection();
- $directories = explode('/', $dirname);
-
- foreach ($directories as $directory) {
- if (false === $this->createActualDirectory($directory, $connection)) {
- $this->setConnectionRoot();
-
- return false;
- }
-
- ftp_chdir($connection, $directory);
- }
-
- $this->setConnectionRoot();
-
- return ['type' => 'dir', 'path' => $dirname];
- }
-
- /**
- * Create a directory.
- *
- * @param string $directory
- * @param resource $connection
- *
- * @return bool
- */
- protected function createActualDirectory($directory, $connection)
- {
- // List the current directory
- $listing = ftp_nlist($connection, '.') ?: [];
-
- foreach ($listing as $key => $item) {
- if (preg_match('~^\./.*~', $item)) {
- $listing[$key] = substr($item, 2);
- }
- }
-
- if (in_array($directory, $listing, true)) {
- return true;
- }
-
- return (boolean) ftp_mkdir($connection, $directory);
- }
-
- /**
- * @inheritdoc
- */
- public function getMetadata($path)
- {
- if ($path === '') {
- return ['type' => 'dir', 'path' => ''];
- }
-
- if (@ftp_chdir($this->getConnection(), $path) === true) {
- $this->setConnectionRoot();
-
- return ['type' => 'dir', 'path' => $path];
- }
-
- $listing = $this->ftpRawlist('-A', $path);
-
- if (empty($listing) || in_array('total 0', $listing, true)) {
- return false;
- }
-
- if (preg_match('/.* not found/', $listing[0])) {
- return false;
- }
-
- if (preg_match('/^total [0-9]*$/', $listing[0])) {
- array_shift($listing);
- }
-
- return $this->normalizeObject($listing[0], '');
- }
-
- /**
- * @inheritdoc
- */
- public function getMimetype($path)
- {
- if ( ! $metadata = $this->getMetadata($path)) {
- return false;
- }
-
- $metadata['mimetype'] = MimeType::detectByFilename($path);
-
- return $metadata;
- }
-
- /**
- * @inheritdoc
- */
- public function getTimestamp($path)
- {
- $timestamp = ftp_mdtm($this->getConnection(), $path);
-
- return ($timestamp !== -1) ? ['path' => $path, 'timestamp' => $timestamp] : false;
- }
-
- /**
- * @inheritdoc
- */
- public function read($path)
- {
- if ( ! $object = $this->readStream($path)) {
- return false;
- }
-
- $object['contents'] = stream_get_contents($object['stream']);
- fclose($object['stream']);
- unset($object['stream']);
-
- return $object;
- }
-
- /**
- * @inheritdoc
- */
- public function readStream($path)
- {
- $stream = fopen('php://temp', 'w+b');
- $result = ftp_fget($this->getConnection(), $stream, $path, $this->transferMode);
- rewind($stream);
-
- if ( ! $result) {
- fclose($stream);
-
- return false;
- }
-
- return ['type' => 'file', 'path' => $path, 'stream' => $stream];
- }
-
- /**
- * @inheritdoc
- */
- public function setVisibility($path, $visibility)
- {
- $mode = $visibility === AdapterInterface::VISIBILITY_PUBLIC ? $this->getPermPublic() : $this->getPermPrivate();
-
- if ( ! ftp_chmod($this->getConnection(), $mode, $path)) {
- return false;
- }
-
- return compact('path', 'visibility');
- }
-
- /**
- * @inheritdoc
- *
- * @param string $directory
- */
- protected function listDirectoryContents($directory, $recursive = true)
- {
- if ($recursive && $this->recurseManually) {
- return $this->listDirectoryContentsRecursive($directory);
- }
-
- $options = $recursive ? '-alnR' : '-aln';
- $listing = $this->ftpRawlist($options, $directory);
-
- return $listing ? $this->normalizeListing($listing, $directory) : [];
- }
-
- /**
- * @inheritdoc
- *
- * @param string $directory
- */
- protected function listDirectoryContentsRecursive($directory)
- {
- $listing = $this->normalizeListing($this->ftpRawlist('-aln', $directory) ?: [], $directory);
- $output = [];
-
- foreach ($listing as $item) {
- $output[] = $item;
- if ($item['type'] !== 'dir') {
- continue;
- }
- $output = array_merge($output, $this->listDirectoryContentsRecursive($item['path']));
- }
-
- return $output;
- }
-
- /**
- * Check if the connection is open.
- *
- * @return bool
- *
- * @throws ConnectionErrorException
- */
- public function isConnected()
- {
- return $this->hasFtpConnection() && $this->getRawExecResponseCode('NOOP') === 200;
- }
-
- /**
- * @return bool
- */
- protected function isPureFtpdServer()
- {
- $response = ftp_raw($this->connection, 'HELP');
-
- return stripos(implode(' ', $response), 'Pure-FTPd') !== false;
- }
-
- /**
- * The ftp_rawlist function with optional escaping.
- *
- * @param string $options
- * @param string $path
- *
- * @return array
- */
- protected function ftpRawlist($options, $path)
- {
- $connection = $this->getConnection();
-
- if ($this->isPureFtpd) {
- $path = str_replace([' ', '[', ']'], ['\ ', '\\[', '\\]'], $path);
- }
-
- return ftp_rawlist($connection, $options . ' ' . $this->escapePath($path));
- }
-
- private function getRawExecResponseCode($command)
- {
- $response = @ftp_raw($this->connection, trim($command)) ?: [];
-
- return (int) preg_replace('/\D/', '', implode(' ', (array) $response));
- }
-
- private function hasFtpConnection(): bool
- {
- return is_resource($this->connection) || $this->connection instanceof \FTP\Connection;
- }
-}
diff --git a/vendor/league/flysystem/src/Adapter/Ftpd.php b/vendor/league/flysystem/src/Adapter/Ftpd.php
deleted file mode 100644
index 7e71d19..0000000
--- a/vendor/league/flysystem/src/Adapter/Ftpd.php
+++ /dev/null
@@ -1,48 +0,0 @@
- 'dir', 'path' => ''];
- }
-
- if (@ftp_chdir($this->getConnection(), $path) === true) {
- $this->setConnectionRoot();
-
- return ['type' => 'dir', 'path' => $path];
- }
-
- $object = ftp_raw($this->getConnection(), 'STAT ' . $this->escapePath($path));
-
- if ( ! $object || count($object) < 3) {
- return false;
- }
-
- if (substr($object[1], 0, 5) === "ftpd:") {
- return false;
- }
-
- return $this->normalizeObject($object[1], '');
- }
-
- /**
- * @inheritdoc
- */
- protected function listDirectoryContents($directory, $recursive = true)
- {
- $listing = ftp_rawlist($this->getConnection(), $this->escapePath($directory), $recursive);
-
- if ($listing === false || ( ! empty($listing) && substr($listing[0], 0, 5) === "ftpd:")) {
- return [];
- }
-
- return $this->normalizeListing($listing, $directory);
- }
-}
diff --git a/vendor/league/flysystem/src/Adapter/Local.php b/vendor/league/flysystem/src/Adapter/Local.php
deleted file mode 100644
index 747c463..0000000
--- a/vendor/league/flysystem/src/Adapter/Local.php
+++ /dev/null
@@ -1,533 +0,0 @@
- [
- 'public' => 0644,
- 'private' => 0600,
- ],
- 'dir' => [
- 'public' => 0755,
- 'private' => 0700,
- ],
- ];
-
- /**
- * @var string
- */
- protected $pathSeparator = DIRECTORY_SEPARATOR;
-
- /**
- * @var array
- */
- protected $permissionMap;
-
- /**
- * @var int
- */
- protected $writeFlags;
-
- /**
- * @var int
- */
- private $linkHandling;
-
- /**
- * Constructor.
- *
- * @param string $root
- * @param int $writeFlags
- * @param int $linkHandling
- * @param array $permissions
- *
- * @throws LogicException
- */
- public function __construct($root, $writeFlags = LOCK_EX, $linkHandling = self::DISALLOW_LINKS, array $permissions = [])
- {
- $root = is_link($root) ? realpath($root) : $root;
- $this->permissionMap = array_replace_recursive(static::$permissions, $permissions);
- $this->ensureDirectory($root);
-
- if ( ! is_dir($root) || ! is_readable($root)) {
- throw new LogicException('The root path ' . $root . ' is not readable.');
- }
-
- $this->setPathPrefix($root);
- $this->writeFlags = $writeFlags;
- $this->linkHandling = $linkHandling;
- }
-
- /**
- * Ensure the root directory exists.
- *
- * @param string $root root directory path
- *
- * @return void
- *
- * @throws Exception in case the root directory can not be created
- */
- protected function ensureDirectory($root)
- {
- if ( ! is_dir($root)) {
- $umask = umask(0);
-
- if ( ! @mkdir($root, $this->permissionMap['dir']['public'], true)) {
- $mkdirError = error_get_last();
- }
-
- umask($umask);
- clearstatcache(false, $root);
-
- if ( ! is_dir($root)) {
- $errorMessage = isset($mkdirError['message']) ? $mkdirError['message'] : '';
- throw new Exception(sprintf('Impossible to create the root directory "%s". %s', $root, $errorMessage));
- }
- }
- }
-
- /**
- * @inheritdoc
- */
- public function has($path)
- {
- $location = $this->applyPathPrefix($path);
-
- return file_exists($location);
- }
-
- /**
- * @inheritdoc
- */
- public function write($path, $contents, Config $config)
- {
- $location = $this->applyPathPrefix($path);
- $this->ensureDirectory(dirname($location));
-
- if (($size = file_put_contents($location, $contents, $this->writeFlags)) === false) {
- return false;
- }
-
- $type = 'file';
- $result = compact('contents', 'type', 'size', 'path');
-
- if ($visibility = $config->get('visibility')) {
- $result['visibility'] = $visibility;
- $this->setVisibility($path, $visibility);
- }
-
- return $result;
- }
-
- /**
- * @inheritdoc
- */
- public function writeStream($path, $resource, Config $config)
- {
- $location = $this->applyPathPrefix($path);
- $this->ensureDirectory(dirname($location));
- $stream = fopen($location, 'w+b');
-
- if ( ! $stream || stream_copy_to_stream($resource, $stream) === false || ! fclose($stream)) {
- return false;
- }
-
- $type = 'file';
- $result = compact('type', 'path');
-
- if ($visibility = $config->get('visibility')) {
- $this->setVisibility($path, $visibility);
- $result['visibility'] = $visibility;
- }
-
- return $result;
- }
-
- /**
- * @inheritdoc
- */
- public function readStream($path)
- {
- $location = $this->applyPathPrefix($path);
- $stream = fopen($location, 'rb');
-
- return ['type' => 'file', 'path' => $path, 'stream' => $stream];
- }
-
- /**
- * @inheritdoc
- */
- public function updateStream($path, $resource, Config $config)
- {
- return $this->writeStream($path, $resource, $config);
- }
-
- /**
- * @inheritdoc
- */
- public function update($path, $contents, Config $config)
- {
- $location = $this->applyPathPrefix($path);
- $size = file_put_contents($location, $contents, $this->writeFlags);
-
- if ($size === false) {
- return false;
- }
-
- $type = 'file';
-
- $result = compact('type', 'path', 'size', 'contents');
-
- if ($visibility = $config->get('visibility')) {
- $this->setVisibility($path, $visibility);
- $result['visibility'] = $visibility;
- }
-
- return $result;
- }
-
- /**
- * @inheritdoc
- */
- public function read($path)
- {
- $location = $this->applyPathPrefix($path);
- $contents = @file_get_contents($location);
-
- if ($contents === false) {
- return false;
- }
-
- return ['type' => 'file', 'path' => $path, 'contents' => $contents];
- }
-
- /**
- * @inheritdoc
- */
- public function rename($path, $newpath)
- {
- $location = $this->applyPathPrefix($path);
- $destination = $this->applyPathPrefix($newpath);
- $parentDirectory = $this->applyPathPrefix(Util::dirname($newpath));
- $this->ensureDirectory($parentDirectory);
-
- return rename($location, $destination);
- }
-
- /**
- * @inheritdoc
- */
- public function copy($path, $newpath)
- {
- $location = $this->applyPathPrefix($path);
- $destination = $this->applyPathPrefix($newpath);
- $this->ensureDirectory(dirname($destination));
-
- return copy($location, $destination);
- }
-
- /**
- * @inheritdoc
- */
- public function delete($path)
- {
- $location = $this->applyPathPrefix($path);
-
- return @unlink($location);
- }
-
- /**
- * @inheritdoc
- */
- public function listContents($directory = '', $recursive = false)
- {
- $result = [];
- $location = $this->applyPathPrefix($directory);
-
- if ( ! is_dir($location)) {
- return [];
- }
-
- $iterator = $recursive ? $this->getRecursiveDirectoryIterator($location) : $this->getDirectoryIterator($location);
-
- foreach ($iterator as $file) {
- $path = $this->getFilePath($file);
-
- if (preg_match('#(^|/|\\\\)\.{1,2}$#', $path)) {
- continue;
- }
-
- $result[] = $this->normalizeFileInfo($file);
- }
-
- unset($iterator);
-
- return array_filter($result);
- }
-
- /**
- * @inheritdoc
- */
- public function getMetadata($path)
- {
- $location = $this->applyPathPrefix($path);
- clearstatcache(false, $location);
- $info = new SplFileInfo($location);
-
- return $this->normalizeFileInfo($info);
- }
-
- /**
- * @inheritdoc
- */
- public function getSize($path)
- {
- return $this->getMetadata($path);
- }
-
- /**
- * @inheritdoc
- */
- public function getMimetype($path)
- {
- $location = $this->applyPathPrefix($path);
- $finfo = new Finfo(FILEINFO_MIME_TYPE);
- $mimetype = $finfo->file($location);
-
- if (in_array($mimetype, ['application/octet-stream', 'inode/x-empty', 'application/x-empty'])) {
- $mimetype = Util\MimeType::detectByFilename($location);
- }
-
- return ['path' => $path, 'type' => 'file', 'mimetype' => $mimetype];
- }
-
- /**
- * @inheritdoc
- */
- public function getTimestamp($path)
- {
- return $this->getMetadata($path);
- }
-
- /**
- * @inheritdoc
- */
- public function getVisibility($path)
- {
- $location = $this->applyPathPrefix($path);
- clearstatcache(false, $location);
- $permissions = octdec(substr(sprintf('%o', fileperms($location)), -4));
- $type = is_dir($location) ? 'dir' : 'file';
-
- foreach ($this->permissionMap[$type] as $visibility => $visibilityPermissions) {
- if ($visibilityPermissions == $permissions) {
- return compact('path', 'visibility');
- }
- }
-
- $visibility = substr(sprintf('%o', fileperms($location)), -4);
-
- return compact('path', 'visibility');
- }
-
- /**
- * @inheritdoc
- */
- public function setVisibility($path, $visibility)
- {
- $location = $this->applyPathPrefix($path);
- $type = is_dir($location) ? 'dir' : 'file';
- $success = chmod($location, $this->permissionMap[$type][$visibility]);
-
- if ($success === false) {
- return false;
- }
-
- return compact('path', 'visibility');
- }
-
- /**
- * @inheritdoc
- */
- public function createDir($dirname, Config $config)
- {
- $location = $this->applyPathPrefix($dirname);
- $umask = umask(0);
- $visibility = $config->get('visibility', 'public');
- $return = ['path' => $dirname, 'type' => 'dir'];
-
- if ( ! is_dir($location)) {
- if (false === @mkdir($location, $this->permissionMap['dir'][$visibility], true)
- || false === is_dir($location)) {
- $return = false;
- }
- }
-
- umask($umask);
-
- return $return;
- }
-
- /**
- * @inheritdoc
- */
- public function deleteDir($dirname)
- {
- $location = $this->applyPathPrefix($dirname);
-
- if ( ! is_dir($location)) {
- return false;
- }
-
- $contents = $this->getRecursiveDirectoryIterator($location, RecursiveIteratorIterator::CHILD_FIRST);
-
- /** @var SplFileInfo $file */
- foreach ($contents as $file) {
- $this->guardAgainstUnreadableFileInfo($file);
- $this->deleteFileInfoObject($file);
- }
-
- unset($contents);
-
- return rmdir($location);
- }
-
- /**
- * @param SplFileInfo $file
- */
- protected function deleteFileInfoObject(SplFileInfo $file)
- {
- switch ($file->getType()) {
- case 'dir':
- rmdir($file->getRealPath());
- break;
- case 'link':
- unlink($file->getPathname());
- break;
- default:
- unlink($file->getRealPath());
- }
- }
-
- /**
- * Normalize the file info.
- *
- * @param SplFileInfo $file
- *
- * @return array|void
- *
- * @throws NotSupportedException
- */
- protected function normalizeFileInfo(SplFileInfo $file)
- {
- if ( ! $file->isLink()) {
- return $this->mapFileInfo($file);
- }
-
- if ($this->linkHandling & self::DISALLOW_LINKS) {
- throw NotSupportedException::forLink($file);
- }
- }
-
- /**
- * Get the normalized path from a SplFileInfo object.
- *
- * @param SplFileInfo $file
- *
- * @return string
- */
- protected function getFilePath(SplFileInfo $file)
- {
- $location = $file->getPathname();
- $path = $this->removePathPrefix($location);
-
- return trim(str_replace('\\', '/', $path), '/');
- }
-
- /**
- * @param string $path
- * @param int $mode
- *
- * @return RecursiveIteratorIterator
- */
- protected function getRecursiveDirectoryIterator($path, $mode = RecursiveIteratorIterator::SELF_FIRST)
- {
- return new RecursiveIteratorIterator(
- new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS),
- $mode
- );
- }
-
- /**
- * @param string $path
- *
- * @return DirectoryIterator
- */
- protected function getDirectoryIterator($path)
- {
- $iterator = new DirectoryIterator($path);
-
- return $iterator;
- }
-
- /**
- * @param SplFileInfo $file
- *
- * @return array
- */
- protected function mapFileInfo(SplFileInfo $file)
- {
- $normalized = [
- 'type' => $file->getType(),
- 'path' => $this->getFilePath($file),
- ];
-
- $normalized['timestamp'] = $file->getMTime();
-
- if ($normalized['type'] === 'file') {
- $normalized['size'] = $file->getSize();
- }
-
- return $normalized;
- }
-
- /**
- * @param SplFileInfo $file
- *
- * @throws UnreadableFileException
- */
- protected function guardAgainstUnreadableFileInfo(SplFileInfo $file)
- {
- if ( ! $file->isReadable()) {
- throw UnreadableFileException::forFileInfo($file);
- }
- }
-}
diff --git a/vendor/league/flysystem/src/Adapter/NullAdapter.php b/vendor/league/flysystem/src/Adapter/NullAdapter.php
deleted file mode 100644
index 2527087..0000000
--- a/vendor/league/flysystem/src/Adapter/NullAdapter.php
+++ /dev/null
@@ -1,144 +0,0 @@
-get('visibility')) {
- $result['visibility'] = $visibility;
- }
-
- return $result;
- }
-
- /**
- * @inheritdoc
- */
- public function update($path, $contents, Config $config)
- {
- return false;
- }
-
- /**
- * @inheritdoc
- */
- public function read($path)
- {
- return false;
- }
-
- /**
- * @inheritdoc
- */
- public function rename($path, $newpath)
- {
- return false;
- }
-
- /**
- * @inheritdoc
- */
- public function delete($path)
- {
- return false;
- }
-
- /**
- * @inheritdoc
- */
- public function listContents($directory = '', $recursive = false)
- {
- return [];
- }
-
- /**
- * @inheritdoc
- */
- public function getMetadata($path)
- {
- return false;
- }
-
- /**
- * @inheritdoc
- */
- public function getSize($path)
- {
- return false;
- }
-
- /**
- * @inheritdoc
- */
- public function getMimetype($path)
- {
- return false;
- }
-
- /**
- * @inheritdoc
- */
- public function getTimestamp($path)
- {
- return false;
- }
-
- /**
- * @inheritdoc
- */
- public function getVisibility($path)
- {
- return false;
- }
-
- /**
- * @inheritdoc
- */
- public function setVisibility($path, $visibility)
- {
- return compact('visibility');
- }
-
- /**
- * @inheritdoc
- */
- public function createDir($dirname, Config $config)
- {
- return ['path' => $dirname, 'type' => 'dir'];
- }
-
- /**
- * @inheritdoc
- */
- public function deleteDir($dirname)
- {
- return false;
- }
-}
diff --git a/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php b/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php
deleted file mode 100644
index fc0a747..0000000
--- a/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php
+++ /dev/null
@@ -1,33 +0,0 @@
-readStream($path);
-
- if ($response === false || ! is_resource($response['stream'])) {
- return false;
- }
-
- $result = $this->writeStream($newpath, $response['stream'], new Config());
-
- if ($result !== false && is_resource($response['stream'])) {
- fclose($response['stream']);
- }
-
- return $result !== false;
- }
-
- // Required abstract method
-
- /**
- * @param string $path
- *
- * @return resource
- */
- abstract public function readStream($path);
-
- /**
- * @param string $path
- * @param resource $resource
- * @param Config $config
- *
- * @return resource
- */
- abstract public function writeStream($path, $resource, Config $config);
-}
diff --git a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php b/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php
deleted file mode 100644
index 2b31c01..0000000
--- a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php
+++ /dev/null
@@ -1,44 +0,0 @@
-read($path)) {
- return false;
- }
-
- $stream = fopen('php://temp', 'w+b');
- fwrite($stream, $data['contents']);
- rewind($stream);
- $data['stream'] = $stream;
- unset($data['contents']);
-
- return $data;
- }
-
- /**
- * Reads a file.
- *
- * @param string $path
- *
- * @return array|false
- *
- * @see League\Flysystem\ReadInterface::read()
- */
- abstract public function read($path);
-}
diff --git a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php b/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php
deleted file mode 100644
index 8042496..0000000
--- a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php
+++ /dev/null
@@ -1,9 +0,0 @@
-stream($path, $resource, $config, 'write');
- }
-
- /**
- * Update a file using a stream.
- *
- * @param string $path
- * @param resource $resource
- * @param Config $config Config object or visibility setting
- *
- * @return mixed false of file metadata
- */
- public function updateStream($path, $resource, Config $config)
- {
- return $this->stream($path, $resource, $config, 'update');
- }
-
- // Required abstract methods
- abstract public function write($pash, $contents, Config $config);
- abstract public function update($pash, $contents, Config $config);
-}
diff --git a/vendor/league/flysystem/src/Adapter/SynologyFtp.php b/vendor/league/flysystem/src/Adapter/SynologyFtp.php
deleted file mode 100644
index fe0d344..0000000
--- a/vendor/league/flysystem/src/Adapter/SynologyFtp.php
+++ /dev/null
@@ -1,8 +0,0 @@
-settings = $settings;
- }
-
- /**
- * Get a setting.
- *
- * @param string $key
- * @param mixed $default
- *
- * @return mixed config setting or default when not found
- */
- public function get($key, $default = null)
- {
- if ( ! array_key_exists($key, $this->settings)) {
- return $this->getDefault($key, $default);
- }
-
- return $this->settings[$key];
- }
-
- /**
- * Check if an item exists by key.
- *
- * @param string $key
- *
- * @return bool
- */
- public function has($key)
- {
- if (array_key_exists($key, $this->settings)) {
- return true;
- }
-
- return $this->fallback instanceof Config
- ? $this->fallback->has($key)
- : false;
- }
-
- /**
- * Try to retrieve a default setting from a config fallback.
- *
- * @param string $key
- * @param mixed $default
- *
- * @return mixed config setting or default when not found
- */
- protected function getDefault($key, $default)
- {
- if ( ! $this->fallback) {
- return $default;
- }
-
- return $this->fallback->get($key, $default);
- }
-
- /**
- * Set a setting.
- *
- * @param string $key
- * @param mixed $value
- *
- * @return $this
- */
- public function set($key, $value)
- {
- $this->settings[$key] = $value;
-
- return $this;
- }
-
- /**
- * Set the fallback.
- *
- * @param Config $fallback
- *
- * @return $this
- */
- public function setFallback(Config $fallback)
- {
- $this->fallback = $fallback;
-
- return $this;
- }
-}
diff --git a/vendor/league/flysystem/src/ConfigAwareTrait.php b/vendor/league/flysystem/src/ConfigAwareTrait.php
deleted file mode 100644
index 202d605..0000000
--- a/vendor/league/flysystem/src/ConfigAwareTrait.php
+++ /dev/null
@@ -1,49 +0,0 @@
-config = $config ? Util::ensureConfig($config) : new Config;
- }
-
- /**
- * Get the Config.
- *
- * @return Config config object
- */
- public function getConfig()
- {
- return $this->config;
- }
-
- /**
- * Convert a config array to a Config object with the correct fallback.
- *
- * @param array $config
- *
- * @return Config
- */
- protected function prepareConfig(array $config)
- {
- $config = new Config($config);
- $config->setFallback($this->getConfig());
-
- return $config;
- }
-}
diff --git a/vendor/league/flysystem/src/ConnectionErrorException.php b/vendor/league/flysystem/src/ConnectionErrorException.php
deleted file mode 100644
index adb651d..0000000
--- a/vendor/league/flysystem/src/ConnectionErrorException.php
+++ /dev/null
@@ -1,9 +0,0 @@
-filesystem->deleteDir($this->path);
- }
-
- /**
- * List the directory contents.
- *
- * @param bool $recursive
- *
- * @return array|bool directory contents or false
- */
- public function getContents($recursive = false)
- {
- return $this->filesystem->listContents($this->path, $recursive);
- }
-}
diff --git a/vendor/league/flysystem/src/DirectoryAttributes.php b/vendor/league/flysystem/src/DirectoryAttributes.php
deleted file mode 100644
index 94e6218..0000000
--- a/vendor/league/flysystem/src/DirectoryAttributes.php
+++ /dev/null
@@ -1,110 +0,0 @@
-path = $path;
- $this->visibility = $visibility;
- $this->lastModified = $lastModified;
- $this->extraMetadata = $extraMetadata;
- }
-
- public function path(): string
- {
- return $this->path;
- }
-
- public function type(): string
- {
- return StorageAttributes::TYPE_DIRECTORY;
- }
-
- public function visibility(): ?string
- {
- return $this->visibility;
- }
-
- public function lastModified(): ?int
- {
- return $this->lastModified;
- }
-
- public function extraMetadata(): array
- {
- return $this->extraMetadata;
- }
-
- public function isFile(): bool
- {
- return false;
- }
-
- public function isDir(): bool
- {
- return true;
- }
-
- public function withPath(string $path): StorageAttributes
- {
- $clone = clone $this;
- $clone->path = $path;
-
- return $clone;
- }
-
- public static function fromArray(array $attributes): StorageAttributes
- {
- return new DirectoryAttributes(
- $attributes[StorageAttributes::ATTRIBUTE_PATH],
- $attributes[StorageAttributes::ATTRIBUTE_VISIBILITY] ?? null,
- $attributes[StorageAttributes::ATTRIBUTE_LAST_MODIFIED] ?? null,
- $attributes[StorageAttributes::ATTRIBUTE_EXTRA_METADATA] ?? []
- );
- }
-
- /**
- * @inheritDoc
- */
- public function jsonSerialize(): array
- {
- return [
- StorageAttributes::ATTRIBUTE_TYPE => $this->type,
- StorageAttributes::ATTRIBUTE_PATH => $this->path,
- StorageAttributes::ATTRIBUTE_VISIBILITY => $this->visibility,
- StorageAttributes::ATTRIBUTE_LAST_MODIFIED => $this->lastModified,
- StorageAttributes::ATTRIBUTE_EXTRA_METADATA => $this->extraMetadata,
- ];
- }
-}
diff --git a/vendor/league/flysystem/src/DirectoryListing.php b/vendor/league/flysystem/src/DirectoryListing.php
deleted file mode 100644
index 0f429a8..0000000
--- a/vendor/league/flysystem/src/DirectoryListing.php
+++ /dev/null
@@ -1,84 +0,0 @@
-
- */
- private $listing;
-
- /**
- * @param iterable $listing
- */
- public function __construct(iterable $listing)
- {
- $this->listing = $listing;
- }
-
- public function filter(callable $filter): DirectoryListing
- {
- $generator = (static function (iterable $listing) use ($filter): Generator {
- foreach ($listing as $item) {
- if ($filter($item)) {
- yield $item;
- }
- }
- })($this->listing);
-
- return new DirectoryListing($generator);
- }
-
- public function map(callable $mapper): DirectoryListing
- {
- $generator = (static function (iterable $listing) use ($mapper): Generator {
- foreach ($listing as $item) {
- yield $mapper($item);
- }
- })($this->listing);
-
- return new DirectoryListing($generator);
- }
-
- public function sortByPath(): DirectoryListing
- {
- $listing = $this->toArray();
-
- usort($listing, function (StorageAttributes $a, StorageAttributes $b) {
- return $a->path() <=> $b->path();
- });
-
- return new DirectoryListing($listing);
- }
-
- /**
- * @return Traversable
- */
- public function getIterator(): Traversable
- {
- return $this->listing instanceof Traversable
- ? $this->listing
- : new ArrayIterator($this->listing);
- }
-
- /**
- * @return T[]
- */
- public function toArray(): array
- {
- return $this->listing instanceof Traversable
- ? iterator_to_array($this->listing, false)
- : (array) $this->listing;
- }
-}
diff --git a/vendor/league/flysystem/src/Exception.php b/vendor/league/flysystem/src/Exception.php
deleted file mode 100644
index 4596c0a..0000000
--- a/vendor/league/flysystem/src/Exception.php
+++ /dev/null
@@ -1,8 +0,0 @@
-filesystem->has($this->path);
- }
-
- /**
- * Read the file.
- *
- * @return string|false file contents
- */
- public function read()
- {
- return $this->filesystem->read($this->path);
- }
-
- /**
- * Read the file as a stream.
- *
- * @return resource|false file stream
- */
- public function readStream()
- {
- return $this->filesystem->readStream($this->path);
- }
-
- /**
- * Write the new file.
- *
- * @param string $content
- *
- * @return bool success boolean
- */
- public function write($content)
- {
- return $this->filesystem->write($this->path, $content);
- }
-
- /**
- * Write the new file using a stream.
- *
- * @param resource $resource
- *
- * @return bool success boolean
- */
- public function writeStream($resource)
- {
- return $this->filesystem->writeStream($this->path, $resource);
- }
-
- /**
- * Update the file contents.
- *
- * @param string $content
- *
- * @return bool success boolean
- */
- public function update($content)
- {
- return $this->filesystem->update($this->path, $content);
- }
-
- /**
- * Update the file contents with a stream.
- *
- * @param resource $resource
- *
- * @return bool success boolean
- */
- public function updateStream($resource)
- {
- return $this->filesystem->updateStream($this->path, $resource);
- }
-
- /**
- * Create the file or update if exists.
- *
- * @param string $content
- *
- * @return bool success boolean
- */
- public function put($content)
- {
- return $this->filesystem->put($this->path, $content);
- }
-
- /**
- * Create the file or update if exists using a stream.
- *
- * @param resource $resource
- *
- * @return bool success boolean
- */
- public function putStream($resource)
- {
- return $this->filesystem->putStream($this->path, $resource);
- }
-
- /**
- * Rename the file.
- *
- * @param string $newpath
- *
- * @return bool success boolean
- */
- public function rename($newpath)
- {
- if ($this->filesystem->rename($this->path, $newpath)) {
- $this->path = $newpath;
-
- return true;
- }
-
- return false;
- }
-
- /**
- * Copy the file.
- *
- * @param string $newpath
- *
- * @return File|false new file or false
- */
- public function copy($newpath)
- {
- if ($this->filesystem->copy($this->path, $newpath)) {
- return new File($this->filesystem, $newpath);
- }
-
- return false;
- }
-
- /**
- * Get the file's timestamp.
- *
- * @return string|false The timestamp or false on failure.
- */
- public function getTimestamp()
- {
- return $this->filesystem->getTimestamp($this->path);
- }
-
- /**
- * Get the file's mimetype.
- *
- * @return string|false The file mime-type or false on failure.
- */
- public function getMimetype()
- {
- return $this->filesystem->getMimetype($this->path);
- }
-
- /**
- * Get the file's visibility.
- *
- * @return string|false The visibility (public|private) or false on failure.
- */
- public function getVisibility()
- {
- return $this->filesystem->getVisibility($this->path);
- }
-
- /**
- * Get the file's metadata.
- *
- * @return array|false The file metadata or false on failure.
- */
- public function getMetadata()
- {
- return $this->filesystem->getMetadata($this->path);
- }
-
- /**
- * Get the file size.
- *
- * @return int|false The file size or false on failure.
- */
- public function getSize()
- {
- return $this->filesystem->getSize($this->path);
- }
-
- /**
- * Delete the file.
- *
- * @return bool success boolean
- */
- public function delete()
- {
- return $this->filesystem->delete($this->path);
- }
-}
diff --git a/vendor/league/flysystem/src/FileAttributes.php b/vendor/league/flysystem/src/FileAttributes.php
deleted file mode 100644
index 2efd9c4..0000000
--- a/vendor/league/flysystem/src/FileAttributes.php
+++ /dev/null
@@ -1,139 +0,0 @@
-path = $path;
- $this->fileSize = $fileSize;
- $this->visibility = $visibility;
- $this->lastModified = $lastModified;
- $this->mimeType = $mimeType;
- $this->extraMetadata = $extraMetadata;
- }
-
- public function type(): string
- {
- return $this->type;
- }
-
- public function path(): string
- {
- return $this->path;
- }
-
- public function fileSize(): ?int
- {
- return $this->fileSize;
- }
-
- public function visibility(): ?string
- {
- return $this->visibility;
- }
-
- public function lastModified(): ?int
- {
- return $this->lastModified;
- }
-
- public function mimeType(): ?string
- {
- return $this->mimeType;
- }
-
- public function extraMetadata(): array
- {
- return $this->extraMetadata;
- }
-
- public function isFile(): bool
- {
- return true;
- }
-
- public function isDir(): bool
- {
- return false;
- }
-
- public function withPath(string $path): StorageAttributes
- {
- $clone = clone $this;
- $clone->path = $path;
-
- return $clone;
- }
-
- public static function fromArray(array $attributes): StorageAttributes
- {
- return new FileAttributes(
- $attributes[StorageAttributes::ATTRIBUTE_PATH],
- $attributes[StorageAttributes::ATTRIBUTE_FILE_SIZE] ?? null,
- $attributes[StorageAttributes::ATTRIBUTE_VISIBILITY] ?? null,
- $attributes[StorageAttributes::ATTRIBUTE_LAST_MODIFIED] ?? null,
- $attributes[StorageAttributes::ATTRIBUTE_MIME_TYPE] ?? null,
- $attributes[StorageAttributes::ATTRIBUTE_EXTRA_METADATA] ?? []
- );
- }
-
- public function jsonSerialize(): array
- {
- return [
- StorageAttributes::ATTRIBUTE_TYPE => self::TYPE_FILE,
- StorageAttributes::ATTRIBUTE_PATH => $this->path,
- StorageAttributes::ATTRIBUTE_FILE_SIZE => $this->fileSize,
- StorageAttributes::ATTRIBUTE_VISIBILITY => $this->visibility,
- StorageAttributes::ATTRIBUTE_LAST_MODIFIED => $this->lastModified,
- StorageAttributes::ATTRIBUTE_MIME_TYPE => $this->mimeType,
- StorageAttributes::ATTRIBUTE_EXTRA_METADATA => $this->extraMetadata,
- ];
- }
-}
diff --git a/vendor/league/flysystem/src/FileExistsException.php b/vendor/league/flysystem/src/FileExistsException.php
deleted file mode 100644
index c82e20c..0000000
--- a/vendor/league/flysystem/src/FileExistsException.php
+++ /dev/null
@@ -1,37 +0,0 @@
-path = $path;
-
- parent::__construct('File already exists at path: ' . $this->getPath(), $code, $previous);
- }
-
- /**
- * Get the path which was found.
- *
- * @return string
- */
- public function getPath()
- {
- return $this->path;
- }
-}
diff --git a/vendor/league/flysystem/src/FileNotFoundException.php b/vendor/league/flysystem/src/FileNotFoundException.php
deleted file mode 100644
index 989df69..0000000
--- a/vendor/league/flysystem/src/FileNotFoundException.php
+++ /dev/null
@@ -1,37 +0,0 @@
-path = $path;
-
- parent::__construct('File not found at path: ' . $this->getPath(), $code, $previous);
- }
-
- /**
- * Get the path which was not found.
- *
- * @return string
- */
- public function getPath()
- {
- return $this->path;
- }
-}
diff --git a/vendor/league/flysystem/src/Filesystem.php b/vendor/league/flysystem/src/Filesystem.php
deleted file mode 100644
index c4eaf27..0000000
--- a/vendor/league/flysystem/src/Filesystem.php
+++ /dev/null
@@ -1,409 +0,0 @@
-adapter = $adapter;
- $this->setConfig($config);
- }
-
- /**
- * Get the Adapter.
- *
- * @return AdapterInterface adapter
- */
- public function getAdapter()
- {
- return $this->adapter;
- }
-
- /**
- * @inheritdoc
- */
- public function has($path)
- {
- $path = Util::normalizePath($path);
-
- return strlen($path) === 0 ? false : (bool) $this->getAdapter()->has($path);
- }
-
- /**
- * @inheritdoc
- */
- public function write($path, $contents, array $config = [])
- {
- $path = Util::normalizePath($path);
- $this->assertAbsent($path);
- $config = $this->prepareConfig($config);
-
- return (bool) $this->getAdapter()->write($path, $contents, $config);
- }
-
- /**
- * @inheritdoc
- */
- public function writeStream($path, $resource, array $config = [])
- {
- if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') {
- throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.');
- }
-
- $path = Util::normalizePath($path);
- $this->assertAbsent($path);
- $config = $this->prepareConfig($config);
-
- Util::rewindStream($resource);
-
- return (bool) $this->getAdapter()->writeStream($path, $resource, $config);
- }
-
- /**
- * @inheritdoc
- */
- public function put($path, $contents, array $config = [])
- {
- $path = Util::normalizePath($path);
- $config = $this->prepareConfig($config);
-
- if ( ! $this->getAdapter() instanceof CanOverwriteFiles && $this->has($path)) {
- return (bool) $this->getAdapter()->update($path, $contents, $config);
- }
-
- return (bool) $this->getAdapter()->write($path, $contents, $config);
- }
-
- /**
- * @inheritdoc
- */
- public function putStream($path, $resource, array $config = [])
- {
- if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') {
- throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.');
- }
-
- $path = Util::normalizePath($path);
- $config = $this->prepareConfig($config);
- Util::rewindStream($resource);
-
- if ( ! $this->getAdapter() instanceof CanOverwriteFiles && $this->has($path)) {
- return (bool) $this->getAdapter()->updateStream($path, $resource, $config);
- }
-
- return (bool) $this->getAdapter()->writeStream($path, $resource, $config);
- }
-
- /**
- * @inheritdoc
- */
- public function readAndDelete($path)
- {
- $path = Util::normalizePath($path);
- $this->assertPresent($path);
- $contents = $this->read($path);
-
- if ($contents === false) {
- return false;
- }
-
- $this->delete($path);
-
- return $contents;
- }
-
- /**
- * @inheritdoc
- */
- public function update($path, $contents, array $config = [])
- {
- $path = Util::normalizePath($path);
- $config = $this->prepareConfig($config);
-
- $this->assertPresent($path);
-
- return (bool) $this->getAdapter()->update($path, $contents, $config);
- }
-
- /**
- * @inheritdoc
- */
- public function updateStream($path, $resource, array $config = [])
- {
- if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') {
- throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.');
- }
-
- $path = Util::normalizePath($path);
- $config = $this->prepareConfig($config);
- $this->assertPresent($path);
- Util::rewindStream($resource);
-
- return (bool) $this->getAdapter()->updateStream($path, $resource, $config);
- }
-
- /**
- * @inheritdoc
- */
- public function read($path)
- {
- $path = Util::normalizePath($path);
- $this->assertPresent($path);
-
- if ( ! ($object = $this->getAdapter()->read($path))) {
- return false;
- }
-
- return $object['contents'];
- }
-
- /**
- * @inheritdoc
- */
- public function readStream($path)
- {
- $path = Util::normalizePath($path);
- $this->assertPresent($path);
-
- if ( ! $object = $this->getAdapter()->readStream($path)) {
- return false;
- }
-
- return $object['stream'];
- }
-
- /**
- * @inheritdoc
- */
- public function rename($path, $newpath)
- {
- $path = Util::normalizePath($path);
- $newpath = Util::normalizePath($newpath);
- $this->assertPresent($path);
- $this->assertAbsent($newpath);
-
- return (bool) $this->getAdapter()->rename($path, $newpath);
- }
-
- /**
- * @inheritdoc
- */
- public function copy($path, $newpath)
- {
- $path = Util::normalizePath($path);
- $newpath = Util::normalizePath($newpath);
- $this->assertPresent($path);
- $this->assertAbsent($newpath);
-
- return $this->getAdapter()->copy($path, $newpath);
- }
-
- /**
- * @inheritdoc
- */
- public function delete($path)
- {
- $path = Util::normalizePath($path);
- $this->assertPresent($path);
-
- return $this->getAdapter()->delete($path);
- }
-
- /**
- * @inheritdoc
- */
- public function deleteDir($dirname)
- {
- $dirname = Util::normalizePath($dirname);
-
- if ($dirname === '') {
- throw new RootViolationException('Root directories can not be deleted.');
- }
-
- return (bool) $this->getAdapter()->deleteDir($dirname);
- }
-
- /**
- * @inheritdoc
- */
- public function createDir($dirname, array $config = [])
- {
- $dirname = Util::normalizePath($dirname);
- $config = $this->prepareConfig($config);
-
- return (bool) $this->getAdapter()->createDir($dirname, $config);
- }
-
- /**
- * @inheritdoc
- */
- public function listContents($directory = '', $recursive = false)
- {
- $directory = Util::normalizePath($directory);
- $contents = $this->getAdapter()->listContents($directory, $recursive);
-
- return (new ContentListingFormatter($directory, $recursive, $this->config->get('case_sensitive', true)))
- ->formatListing($contents);
- }
-
- /**
- * @inheritdoc
- */
- public function getMimetype($path)
- {
- $path = Util::normalizePath($path);
- $this->assertPresent($path);
-
- if (( ! $object = $this->getAdapter()->getMimetype($path)) || ! array_key_exists('mimetype', $object)) {
- return false;
- }
-
- return $object['mimetype'];
- }
-
- /**
- * @inheritdoc
- */
- public function getTimestamp($path)
- {
- $path = Util::normalizePath($path);
- $this->assertPresent($path);
-
- if (( ! $object = $this->getAdapter()->getTimestamp($path)) || ! array_key_exists('timestamp', $object)) {
- return false;
- }
-
- return (int) $object['timestamp'];
- }
-
- /**
- * @inheritdoc
- */
- public function getVisibility($path)
- {
- $path = Util::normalizePath($path);
- $this->assertPresent($path);
-
- if (( ! $object = $this->getAdapter()->getVisibility($path)) || ! array_key_exists('visibility', $object)) {
- return false;
- }
-
- return $object['visibility'];
- }
-
- /**
- * @inheritdoc
- */
- public function getSize($path)
- {
- $path = Util::normalizePath($path);
- $this->assertPresent($path);
-
- if (( ! $object = $this->getAdapter()->getSize($path)) || ! array_key_exists('size', $object)) {
- return false;
- }
-
- return (int) $object['size'];
- }
-
- /**
- * @inheritdoc
- */
- public function setVisibility($path, $visibility)
- {
- $path = Util::normalizePath($path);
- $this->assertPresent($path);
-
- return (bool) $this->getAdapter()->setVisibility($path, $visibility);
- }
-
- /**
- * @inheritdoc
- */
- public function getMetadata($path)
- {
- $path = Util::normalizePath($path);
- $this->assertPresent($path);
-
- return $this->getAdapter()->getMetadata($path);
- }
-
- /**
- * @inheritdoc
- */
- public function get($path, Handler $handler = null)
- {
- $path = Util::normalizePath($path);
-
- if ( ! $handler) {
- $metadata = $this->getMetadata($path);
- $handler = ($metadata && $metadata['type'] === 'file') ? new File($this, $path) : new Directory($this, $path);
- }
-
- $handler->setPath($path);
- $handler->setFilesystem($this);
-
- return $handler;
- }
-
- /**
- * Assert a file is present.
- *
- * @param string $path path to file
- *
- * @throws FileNotFoundException
- *
- * @return void
- */
- public function assertPresent($path)
- {
- if ($this->config->get('disable_asserts', false) === false && ! $this->has($path)) {
- throw new FileNotFoundException($path);
- }
- }
-
- /**
- * Assert a file is absent.
- *
- * @param string $path path to file
- *
- * @throws FileExistsException
- *
- * @return void
- */
- public function assertAbsent($path)
- {
- if ($this->config->get('disable_asserts', false) === false && $this->has($path)) {
- throw new FileExistsException($path);
- }
- }
-}
diff --git a/vendor/league/flysystem/src/FilesystemAdapter.php b/vendor/league/flysystem/src/FilesystemAdapter.php
deleted file mode 100644
index 6dcb51e..0000000
--- a/vendor/league/flysystem/src/FilesystemAdapter.php
+++ /dev/null
@@ -1,108 +0,0 @@
-
- *
- * @throws FilesystemException
- */
- public function listContents(string $path, bool $deep): iterable;
-
- /**
- * @throws UnableToMoveFile
- * @throws FilesystemException
- */
- public function move(string $source, string $destination, Config $config): void;
-
- /**
- * @throws UnableToCopyFile
- * @throws FilesystemException
- */
- public function copy(string $source, string $destination, Config $config): void;
-}
diff --git a/vendor/league/flysystem/src/FilesystemException.php b/vendor/league/flysystem/src/FilesystemException.php
deleted file mode 100644
index 3121e53..0000000
--- a/vendor/league/flysystem/src/FilesystemException.php
+++ /dev/null
@@ -1,7 +0,0 @@
-
- *
- * @throws FilesystemException
- */
- public function listContents(string $location, bool $deep = self::LIST_SHALLOW): DirectoryListing;
-
- /**
- * @throws UnableToRetrieveMetadata
- * @throws FilesystemException
- */
- public function lastModified(string $path): int;
-
- /**
- * @throws UnableToRetrieveMetadata
- * @throws FilesystemException
- */
- public function fileSize(string $path): int;
-
- /**
- * @throws UnableToRetrieveMetadata
- * @throws FilesystemException
- */
- public function mimeType(string $path): string;
-
- /**
- * @throws UnableToRetrieveMetadata
- * @throws FilesystemException
- */
- public function visibility(string $path): string;
-}
diff --git a/vendor/league/flysystem/src/FilesystemWriter.php b/vendor/league/flysystem/src/FilesystemWriter.php
deleted file mode 100644
index a24bb0f..0000000
--- a/vendor/league/flysystem/src/FilesystemWriter.php
+++ /dev/null
@@ -1,58 +0,0 @@
-path = $path;
- $this->filesystem = $filesystem;
- }
-
- /**
- * Check whether the entree is a directory.
- *
- * @return bool
- */
- public function isDir()
- {
- return $this->getType() === 'dir';
- }
-
- /**
- * Check whether the entree is a file.
- *
- * @return bool
- */
- public function isFile()
- {
- return $this->getType() === 'file';
- }
-
- /**
- * Retrieve the entree type (file|dir).
- *
- * @return string file or dir
- */
- public function getType()
- {
- $metadata = $this->filesystem->getMetadata($this->path);
-
- return $metadata ? $metadata['type'] : 'dir';
- }
-
- /**
- * Set the Filesystem object.
- *
- * @param FilesystemInterface $filesystem
- *
- * @return $this
- */
- public function setFilesystem(FilesystemInterface $filesystem)
- {
- $this->filesystem = $filesystem;
-
- return $this;
- }
-
- /**
- * Retrieve the Filesystem object.
- *
- * @return FilesystemInterface
- */
- public function getFilesystem()
- {
- return $this->filesystem;
- }
-
- /**
- * Set the entree path.
- *
- * @param string $path
- *
- * @return $this
- */
- public function setPath($path)
- {
- $this->path = $path;
-
- return $this;
- }
-
- /**
- * Retrieve the entree path.
- *
- * @return string path
- */
- public function getPath()
- {
- return $this->path;
- }
-
- /**
- * Plugins pass-through.
- *
- * @param string $method
- * @param array $arguments
- *
- * @return mixed
- */
- public function __call($method, array $arguments)
- {
- array_unshift($arguments, $this->path);
- $callback = [$this->filesystem, $method];
-
- try {
- return call_user_func_array($callback, $arguments);
- } catch (BadMethodCallException $e) {
- throw new BadMethodCallException(
- 'Call to undefined method '
- . get_called_class()
- . '::' . $method
- );
- }
- }
-}
diff --git a/vendor/league/flysystem/src/InvalidRootException.php b/vendor/league/flysystem/src/InvalidRootException.php
deleted file mode 100644
index 468d1d5..0000000
--- a/vendor/league/flysystem/src/InvalidRootException.php
+++ /dev/null
@@ -1,9 +0,0 @@
-prefixer = new PathPrefixer($location, DIRECTORY_SEPARATOR);
- $this->writeFlags = $writeFlags;
- $this->linkHandling = $linkHandling;
- $this->visibility = $visibility ?: new PortableVisibilityConverter();
- $this->ensureDirectoryExists($location, $this->visibility->defaultForDirectories());
- $this->mimeTypeDetector = $mimeTypeDetector ?: new FinfoMimeTypeDetector();
- }
-
- public function write(string $path, string $contents, Config $config): void
- {
- $this->writeToFile($path, $contents, $config);
- }
-
- public function writeStream(string $path, $contents, Config $config): void
- {
- $this->writeToFile($path, $contents, $config);
- }
-
- /**
- * @param resource|string $contents
- */
- private function writeToFile(string $path, $contents, Config $config): void
- {
- $prefixedLocation = $this->prefixer->prefixPath($path);
- $this->ensureDirectoryExists(
- dirname($prefixedLocation),
- $this->resolveDirectoryVisibility($config->get(Config::OPTION_DIRECTORY_VISIBILITY))
- );
- error_clear_last();
-
- if (@file_put_contents($prefixedLocation, $contents, $this->writeFlags) === false) {
- throw UnableToWriteFile::atLocation($path, error_get_last()['message'] ?? '');
- }
-
- if ($visibility = $config->get(Config::OPTION_VISIBILITY)) {
- $this->setVisibility($path, (string) $visibility);
- }
- }
-
- public function delete(string $path): void
- {
- $location = $this->prefixer->prefixPath($path);
-
- if ( ! file_exists($location)) {
- return;
- }
-
- error_clear_last();
-
- if ( ! @unlink($location)) {
- throw UnableToDeleteFile::atLocation($location, error_get_last()['message'] ?? '');
- }
- }
-
- public function deleteDirectory(string $prefix): void
- {
- $location = $this->prefixer->prefixPath($prefix);
-
- if ( ! is_dir($location)) {
- return;
- }
-
- $contents = $this->listDirectoryRecursively($location, RecursiveIteratorIterator::CHILD_FIRST);
-
- /** @var SplFileInfo $file */
- foreach ($contents as $file) {
- if ( ! $this->deleteFileInfoObject($file)) {
- throw UnableToDeleteDirectory::atLocation($prefix, "Unable to delete file at " . $file->getPathname());
- }
- }
-
- unset($contents);
-
- if ( ! @rmdir($location)) {
- throw UnableToDeleteDirectory::atLocation($prefix, error_get_last()['message'] ?? '');
- }
- }
-
- private function listDirectoryRecursively(
- string $path,
- int $mode = RecursiveIteratorIterator::SELF_FIRST
- ): Generator {
- yield from new RecursiveIteratorIterator(
- new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS),
- $mode
- );
- }
-
- protected function deleteFileInfoObject(SplFileInfo $file): bool
- {
- switch ($file->getType()) {
- case 'dir':
- return @rmdir((string) $file->getRealPath());
- case 'link':
- return @unlink((string) $file->getPathname());
- default:
- return @unlink((string) $file->getRealPath());
- }
- }
-
- public function listContents(string $path, bool $deep): iterable
- {
- $location = $this->prefixer->prefixPath($path);
-
- if ( ! is_dir($location)) {
- return;
- }
-
- /** @var SplFileInfo[] $iterator */
- $iterator = $deep ? $this->listDirectoryRecursively($location) : $this->listDirectory($location);
-
- foreach ($iterator as $fileInfo) {
- if ($fileInfo->isLink()) {
- if ($this->linkHandling & self::SKIP_LINKS) {
- continue;
- }
- throw SymbolicLinkEncountered::atLocation($fileInfo->getPathname());
- }
-
- $path = $this->prefixer->stripPrefix($fileInfo->getPathname());
- $lastModified = $fileInfo->getMTime();
- $isDirectory = $fileInfo->isDir();
- $permissions = octdec(substr(sprintf('%o', $fileInfo->getPerms()), -4));
- $visibility = $isDirectory ? $this->visibility->inverseForDirectory($permissions) : $this->visibility->inverseForFile($permissions);
-
- yield $isDirectory ? new DirectoryAttributes($path, $visibility, $lastModified) : new FileAttributes(
- str_replace('\\', '/', $path),
- $fileInfo->getSize(),
- $visibility,
- $lastModified
- );
- }
- }
-
- public function move(string $source, string $destination, Config $config): void
- {
- $sourcePath = $this->prefixer->prefixPath($source);
- $destinationPath = $this->prefixer->prefixPath($destination);
- $this->ensureDirectoryExists(
- dirname($destinationPath),
- $this->resolveDirectoryVisibility($config->get(Config::OPTION_DIRECTORY_VISIBILITY))
- );
-
- if ( ! @rename($sourcePath, $destinationPath)) {
- throw UnableToMoveFile::fromLocationTo($sourcePath, $destinationPath);
- }
- }
-
- public function copy(string $source, string $destination, Config $config): void
- {
- $sourcePath = $this->prefixer->prefixPath($source);
- $destinationPath = $this->prefixer->prefixPath($destination);
- $this->ensureDirectoryExists(
- dirname($destinationPath),
- $this->resolveDirectoryVisibility($config->get(Config::OPTION_DIRECTORY_VISIBILITY))
- );
-
- if ( ! @copy($sourcePath, $destinationPath)) {
- throw UnableToCopyFile::fromLocationTo($sourcePath, $destinationPath);
- }
- }
-
- public function read(string $path): string
- {
- $location = $this->prefixer->prefixPath($path);
- error_clear_last();
- $contents = @file_get_contents($location);
-
- if ($contents === false) {
- throw UnableToReadFile::fromLocation($path, error_get_last()['message'] ?? '');
- }
-
- return $contents;
- }
-
- public function readStream(string $path)
- {
- $location = $this->prefixer->prefixPath($path);
- error_clear_last();
- $contents = @fopen($location, 'rb');
-
- if ($contents === false) {
- throw UnableToReadFile::fromLocation($path, error_get_last()['message'] ?? '');
- }
-
- return $contents;
- }
-
- protected function ensureDirectoryExists(string $dirname, int $visibility): void
- {
- if (is_dir($dirname)) {
- return;
- }
-
- error_clear_last();
-
- if ( ! @mkdir($dirname, $visibility, true)) {
- $mkdirError = error_get_last();
- }
-
- clearstatcache(true, $dirname);
-
- if ( ! is_dir($dirname)) {
- $errorMessage = isset($mkdirError['message']) ? $mkdirError['message'] : '';
-
- throw UnableToCreateDirectory::atLocation($dirname, $errorMessage);
- }
- }
-
- public function fileExists(string $location): bool
- {
- $location = $this->prefixer->prefixPath($location);
-
- return is_file($location);
- }
-
- public function createDirectory(string $path, Config $config): void
- {
- $location = $this->prefixer->prefixPath($path);
- $visibility = $config->get(Config::OPTION_VISIBILITY, $config->get(Config::OPTION_DIRECTORY_VISIBILITY));
- $permissions = $this->resolveDirectoryVisibility($visibility);
-
- if (is_dir($location)) {
- $this->setPermissions($location, $permissions);
-
- return;
- }
-
- error_clear_last();
-
- if ( ! @mkdir($location, $permissions, true)) {
- throw UnableToCreateDirectory::atLocation($path, error_get_last()['message'] ?? '');
- }
- }
-
- public function setVisibility(string $path, string $visibility): void
- {
- $path = $this->prefixer->prefixPath($path);
- $visibility = is_dir($path) ? $this->visibility->forDirectory($visibility) : $this->visibility->forFile(
- $visibility
- );
-
- $this->setPermissions($path, $visibility);
- }
-
- public function visibility(string $path): FileAttributes
- {
- $location = $this->prefixer->prefixPath($path);
- clearstatcache(false, $location);
- error_clear_last();
- $fileperms = @fileperms($location);
-
- if ($fileperms === false) {
- throw UnableToRetrieveMetadata::visibility($path, error_get_last()['message'] ?? '');
- }
-
- $permissions = $fileperms & 0777;
- $visibility = $this->visibility->inverseForFile($permissions);
-
- return new FileAttributes($path, null, $visibility);
- }
-
- private function resolveDirectoryVisibility(?string $visibility): int
- {
- return $visibility === null ? $this->visibility->defaultForDirectories() : $this->visibility->forDirectory(
- $visibility
- );
- }
-
- public function mimeType(string $path): FileAttributes
- {
- $location = $this->prefixer->prefixPath($path);
- error_clear_last();
- $mimeType = $this->mimeTypeDetector->detectMimeTypeFromFile($location);
-
- if ($mimeType === null) {
- throw UnableToRetrieveMetadata::mimeType($path, error_get_last()['message'] ?? '');
- }
-
- return new FileAttributes($path, null, null, null, $mimeType);
- }
-
- public function lastModified(string $path): FileAttributes
- {
- $location = $this->prefixer->prefixPath($path);
- error_clear_last();
- $lastModified = @filemtime($location);
-
- if ($lastModified === false) {
- throw UnableToRetrieveMetadata::lastModified($path, error_get_last()['message'] ?? '');
- }
-
- return new FileAttributes($path, null, null, $lastModified);
- }
-
- public function fileSize(string $path): FileAttributes
- {
- $location = $this->prefixer->prefixPath($path);
- error_clear_last();
-
- if (is_file($location) && ($fileSize = @filesize($location)) !== false) {
- return new FileAttributes($path, $fileSize);
- }
-
- throw UnableToRetrieveMetadata::fileSize($path, error_get_last()['message'] ?? '');
- }
-
- private function listDirectory(string $location): Generator
- {
- $iterator = new DirectoryIterator($location);
-
- foreach ($iterator as $item) {
- if ($item->isDot()) {
- continue;
- }
-
- yield $item;
- }
- }
-
- private function setPermissions(string $location, int $visibility): void
- {
- error_clear_last();
- if ( ! @chmod($location, $visibility)) {
- $extraMessage = error_get_last()['message'] ?? '';
- throw UnableToSetVisibility::atLocation($this->prefixer->stripPrefix($location), $extraMessage);
- }
- }
-}
diff --git a/vendor/league/flysystem/src/MountManager.php b/vendor/league/flysystem/src/MountManager.php
deleted file mode 100644
index 620f540..0000000
--- a/vendor/league/flysystem/src/MountManager.php
+++ /dev/null
@@ -1,648 +0,0 @@
- Filesystem,]
- *
- * @throws InvalidArgumentException
- */
- public function __construct(array $filesystems = [])
- {
- $this->mountFilesystems($filesystems);
- }
-
- /**
- * Mount filesystems.
- *
- * @param FilesystemInterface[] $filesystems [:prefix => Filesystem,]
- *
- * @throws InvalidArgumentException
- *
- * @return $this
- */
- public function mountFilesystems(array $filesystems)
- {
- foreach ($filesystems as $prefix => $filesystem) {
- $this->mountFilesystem($prefix, $filesystem);
- }
-
- return $this;
- }
-
- /**
- * Mount filesystems.
- *
- * @param string $prefix
- * @param FilesystemInterface $filesystem
- *
- * @throws InvalidArgumentException
- *
- * @return $this
- */
- public function mountFilesystem($prefix, FilesystemInterface $filesystem)
- {
- if ( ! is_string($prefix)) {
- throw new InvalidArgumentException(__METHOD__ . ' expects argument #1 to be a string.');
- }
-
- $this->filesystems[$prefix] = $filesystem;
-
- return $this;
- }
-
- /**
- * Get the filesystem with the corresponding prefix.
- *
- * @param string $prefix
- *
- * @throws FilesystemNotFoundException
- *
- * @return FilesystemInterface
- */
- public function getFilesystem($prefix)
- {
- if ( ! isset($this->filesystems[$prefix])) {
- throw new FilesystemNotFoundException('No filesystem mounted with prefix ' . $prefix);
- }
-
- return $this->filesystems[$prefix];
- }
-
- /**
- * Retrieve the prefix from an arguments array.
- *
- * @param array $arguments
- *
- * @throws InvalidArgumentException
- *
- * @return array [:prefix, :arguments]
- */
- public function filterPrefix(array $arguments)
- {
- if (empty($arguments)) {
- throw new InvalidArgumentException('At least one argument needed');
- }
-
- $path = array_shift($arguments);
-
- if ( ! is_string($path)) {
- throw new InvalidArgumentException('First argument should be a string');
- }
-
- list($prefix, $path) = $this->getPrefixAndPath($path);
- array_unshift($arguments, $path);
-
- return [$prefix, $arguments];
- }
-
- /**
- * @param string $directory
- * @param bool $recursive
- *
- * @throws InvalidArgumentException
- * @throws FilesystemNotFoundException
- *
- * @return array
- */
- public function listContents($directory = '', $recursive = false)
- {
- list($prefix, $directory) = $this->getPrefixAndPath($directory);
- $filesystem = $this->getFilesystem($prefix);
- $result = $filesystem->listContents($directory, $recursive);
-
- foreach ($result as &$file) {
- $file['filesystem'] = $prefix;
- }
-
- return $result;
- }
-
- /**
- * Call forwarder.
- *
- * @param string $method
- * @param array $arguments
- *
- * @throws InvalidArgumentException
- * @throws FilesystemNotFoundException
- *
- * @return mixed
- */
- public function __call($method, $arguments)
- {
- list($prefix, $arguments) = $this->filterPrefix($arguments);
-
- return $this->invokePluginOnFilesystem($method, $arguments, $prefix);
- }
-
- /**
- * @param string $from
- * @param string $to
- * @param array $config
- *
- * @throws InvalidArgumentException
- * @throws FilesystemNotFoundException
- * @throws FileExistsException
- *
- * @return bool
- */
- public function copy($from, $to, array $config = [])
- {
- list($prefixFrom, $from) = $this->getPrefixAndPath($from);
-
- $buffer = $this->getFilesystem($prefixFrom)->readStream($from);
-
- if ($buffer === false) {
- return false;
- }
-
- list($prefixTo, $to) = $this->getPrefixAndPath($to);
-
- $result = $this->getFilesystem($prefixTo)->writeStream($to, $buffer, $config);
-
- if (is_resource($buffer)) {
- fclose($buffer);
- }
-
- return $result;
- }
-
- /**
- * List with plugin adapter.
- *
- * @param array $keys
- * @param string $directory
- * @param bool $recursive
- *
- * @throws InvalidArgumentException
- * @throws FilesystemNotFoundException
- *
- * @return array
- */
- public function listWith(array $keys = [], $directory = '', $recursive = false)
- {
- list($prefix, $directory) = $this->getPrefixAndPath($directory);
- $arguments = [$keys, $directory, $recursive];
-
- return $this->invokePluginOnFilesystem('listWith', $arguments, $prefix);
- }
-
- /**
- * Move a file.
- *
- * @param string $from
- * @param string $to
- * @param array $config
- *
- * @throws InvalidArgumentException
- * @throws FilesystemNotFoundException
- *
- * @return bool
- */
- public function move($from, $to, array $config = [])
- {
- list($prefixFrom, $pathFrom) = $this->getPrefixAndPath($from);
- list($prefixTo, $pathTo) = $this->getPrefixAndPath($to);
-
- if ($prefixFrom === $prefixTo) {
- $filesystem = $this->getFilesystem($prefixFrom);
- $renamed = $filesystem->rename($pathFrom, $pathTo);
-
- if ($renamed && isset($config['visibility'])) {
- return $filesystem->setVisibility($pathTo, $config['visibility']);
- }
-
- return $renamed;
- }
-
- $copied = $this->copy($from, $to, $config);
-
- if ($copied) {
- return $this->delete($from);
- }
-
- return false;
- }
-
- /**
- * Invoke a plugin on a filesystem mounted on a given prefix.
- *
- * @param string $method
- * @param array $arguments
- * @param string $prefix
- *
- * @throws FilesystemNotFoundException
- *
- * @return mixed
- */
- public function invokePluginOnFilesystem($method, $arguments, $prefix)
- {
- $filesystem = $this->getFilesystem($prefix);
-
- try {
- return $this->invokePlugin($method, $arguments, $filesystem);
- } catch (PluginNotFoundException $e) {
- // Let it pass, it's ok, don't panic.
- }
-
- $callback = [$filesystem, $method];
-
- return call_user_func_array($callback, $arguments);
- }
-
- /**
- * @param string $path
- *
- * @throws InvalidArgumentException
- *
- * @return string[] [:prefix, :path]
- */
- protected function getPrefixAndPath($path)
- {
- if (strpos($path, '://') < 1) {
- throw new InvalidArgumentException('No prefix detected in path: ' . $path);
- }
-
- return explode('://', $path, 2);
- }
-
- /**
- * Check whether a file exists.
- *
- * @param string $path
- *
- * @return bool
- */
- public function has($path)
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->has($path);
- }
-
- /**
- * Read a file.
- *
- * @param string $path The path to the file.
- *
- * @throws FileNotFoundException
- *
- * @return string|false The file contents or false on failure.
- */
- public function read($path)
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->read($path);
- }
-
- /**
- * Retrieves a read-stream for a path.
- *
- * @param string $path The path to the file.
- *
- * @throws FileNotFoundException
- *
- * @return resource|false The path resource or false on failure.
- */
- public function readStream($path)
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->readStream($path);
- }
-
- /**
- * Get a file's metadata.
- *
- * @param string $path The path to the file.
- *
- * @throws FileNotFoundException
- *
- * @return array|false The file metadata or false on failure.
- */
- public function getMetadata($path)
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->getMetadata($path);
- }
-
- /**
- * Get a file's size.
- *
- * @param string $path The path to the file.
- *
- * @throws FileNotFoundException
- *
- * @return int|false The file size or false on failure.
- */
- public function getSize($path)
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->getSize($path);
- }
-
- /**
- * Get a file's mime-type.
- *
- * @param string $path The path to the file.
- *
- * @throws FileNotFoundException
- *
- * @return string|false The file mime-type or false on failure.
- */
- public function getMimetype($path)
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->getMimetype($path);
- }
-
- /**
- * Get a file's timestamp.
- *
- * @param string $path The path to the file.
- *
- * @throws FileNotFoundException
- *
- * @return string|false The timestamp or false on failure.
- */
- public function getTimestamp($path)
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->getTimestamp($path);
- }
-
- /**
- * Get a file's visibility.
- *
- * @param string $path The path to the file.
- *
- * @throws FileNotFoundException
- *
- * @return string|false The visibility (public|private) or false on failure.
- */
- public function getVisibility($path)
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->getVisibility($path);
- }
-
- /**
- * Write a new file.
- *
- * @param string $path The path of the new file.
- * @param string $contents The file contents.
- * @param array $config An optional configuration array.
- *
- * @throws FileExistsException
- *
- * @return bool True on success, false on failure.
- */
- public function write($path, $contents, array $config = [])
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->write($path, $contents, $config);
- }
-
- /**
- * Write a new file using a stream.
- *
- * @param string $path The path of the new file.
- * @param resource $resource The file handle.
- * @param array $config An optional configuration array.
- *
- * @throws InvalidArgumentException If $resource is not a file handle.
- * @throws FileExistsException
- *
- * @return bool True on success, false on failure.
- */
- public function writeStream($path, $resource, array $config = [])
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->writeStream($path, $resource, $config);
- }
-
- /**
- * Update an existing file.
- *
- * @param string $path The path of the existing file.
- * @param string $contents The file contents.
- * @param array $config An optional configuration array.
- *
- * @throws FileNotFoundException
- *
- * @return bool True on success, false on failure.
- */
- public function update($path, $contents, array $config = [])
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->update($path, $contents, $config);
- }
-
- /**
- * Update an existing file using a stream.
- *
- * @param string $path The path of the existing file.
- * @param resource $resource The file handle.
- * @param array $config An optional configuration array.
- *
- * @throws InvalidArgumentException If $resource is not a file handle.
- * @throws FileNotFoundException
- *
- * @return bool True on success, false on failure.
- */
- public function updateStream($path, $resource, array $config = [])
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->updateStream($path, $resource, $config);
- }
-
- /**
- * Rename a file.
- *
- * @param string $path Path to the existing file.
- * @param string $newpath The new path of the file.
- *
- * @throws FileExistsException Thrown if $newpath exists.
- * @throws FileNotFoundException Thrown if $path does not exist.
- *
- * @return bool True on success, false on failure.
- */
- public function rename($path, $newpath)
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->rename($path, $newpath);
- }
-
- /**
- * Delete a file.
- *
- * @param string $path
- *
- * @throws FileNotFoundException
- *
- * @return bool True on success, false on failure.
- */
- public function delete($path)
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->delete($path);
- }
-
- /**
- * Delete a directory.
- *
- * @param string $dirname
- *
- * @throws RootViolationException Thrown if $dirname is empty.
- *
- * @return bool True on success, false on failure.
- */
- public function deleteDir($dirname)
- {
- list($prefix, $dirname) = $this->getPrefixAndPath($dirname);
-
- return $this->getFilesystem($prefix)->deleteDir($dirname);
- }
-
- /**
- * Create a directory.
- *
- * @param string $dirname The name of the new directory.
- * @param array $config An optional configuration array.
- *
- * @return bool True on success, false on failure.
- */
- public function createDir($dirname, array $config = [])
- {
- list($prefix, $dirname) = $this->getPrefixAndPath($dirname);
-
- return $this->getFilesystem($prefix)->createDir($dirname);
- }
-
- /**
- * Set the visibility for a file.
- *
- * @param string $path The path to the file.
- * @param string $visibility One of 'public' or 'private'.
- *
- * @throws FileNotFoundException
- *
- * @return bool True on success, false on failure.
- */
- public function setVisibility($path, $visibility)
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->setVisibility($path, $visibility);
- }
-
- /**
- * Create a file or update if exists.
- *
- * @param string $path The path to the file.
- * @param string $contents The file contents.
- * @param array $config An optional configuration array.
- *
- * @return bool True on success, false on failure.
- */
- public function put($path, $contents, array $config = [])
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->put($path, $contents, $config);
- }
-
- /**
- * Create a file or update if exists.
- *
- * @param string $path The path to the file.
- * @param resource $resource The file handle.
- * @param array $config An optional configuration array.
- *
- * @throws InvalidArgumentException Thrown if $resource is not a resource.
- *
- * @return bool True on success, false on failure.
- */
- public function putStream($path, $resource, array $config = [])
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->putStream($path, $resource, $config);
- }
-
- /**
- * Read and delete a file.
- *
- * @param string $path The path to the file.
- *
- * @throws FileNotFoundException
- *
- * @return string|false The file contents, or false on failure.
- */
- public function readAndDelete($path)
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->readAndDelete($path);
- }
-
- /**
- * Get a file/directory handler.
- *
- * @deprecated
- *
- * @param string $path The path to the file.
- * @param Handler $handler An optional existing handler to populate.
- *
- * @return Handler Either a file or directory handler.
- */
- public function get($path, Handler $handler = null)
- {
- list($prefix, $path) = $this->getPrefixAndPath($path);
-
- return $this->getFilesystem($prefix)->get($path);
- }
-}
diff --git a/vendor/league/flysystem/src/NotSupportedException.php b/vendor/league/flysystem/src/NotSupportedException.php
deleted file mode 100644
index e0a989b..0000000
--- a/vendor/league/flysystem/src/NotSupportedException.php
+++ /dev/null
@@ -1,37 +0,0 @@
-getPathname());
- }
-
- /**
- * Create a new exception for a link.
- *
- * @param string $systemType
- *
- * @return static
- */
- public static function forFtpSystemType($systemType)
- {
- $message = "The FTP system type '$systemType' is currently not supported.";
-
- return new static($message);
- }
-}
diff --git a/vendor/league/flysystem/src/PathNormalizer.php b/vendor/league/flysystem/src/PathNormalizer.php
deleted file mode 100644
index 54da201..0000000
--- a/vendor/league/flysystem/src/PathNormalizer.php
+++ /dev/null
@@ -1,10 +0,0 @@
-prefix = rtrim($prefix, '\\/');
-
- if ($this->prefix !== '' || $prefix === $separator) {
- $this->prefix .= $separator;
- }
-
- $this->separator = $separator;
- }
-
- public function prefixPath(string $path): string
- {
- return $this->prefix . ltrim($path, '\\/');
- }
-
- public function stripPrefix(string $path): string
- {
- /* @var string */
- return substr($path, strlen($this->prefix));
- }
-
- public function stripDirectoryPrefix(string $path): string
- {
- return rtrim($this->stripPrefix($path), '\\/');
- }
-
- public function prefixDirectoryPath(string $path): string
- {
- $prefixedPath = $this->prefixPath(rtrim($path, '\\/'));
-
- if ((substr($prefixedPath, -1) === $this->separator) || $prefixedPath === '') {
- return $prefixedPath;
- }
-
- return $prefixedPath . $this->separator;
- }
-}
diff --git a/vendor/league/flysystem/src/PathTraversalDetected.php b/vendor/league/flysystem/src/PathTraversalDetected.php
deleted file mode 100644
index d149997..0000000
--- a/vendor/league/flysystem/src/PathTraversalDetected.php
+++ /dev/null
@@ -1,28 +0,0 @@
-path;
- }
-
- public static function forPath(string $path): PathTraversalDetected
- {
- $e = new PathTraversalDetected("Path traversal detected: {$path}");
- $e->path = $path;
-
- return $e;
- }
-}
diff --git a/vendor/league/flysystem/src/Plugin/AbstractPlugin.php b/vendor/league/flysystem/src/Plugin/AbstractPlugin.php
deleted file mode 100644
index 0d56789..0000000
--- a/vendor/league/flysystem/src/Plugin/AbstractPlugin.php
+++ /dev/null
@@ -1,24 +0,0 @@
-filesystem = $filesystem;
- }
-}
diff --git a/vendor/league/flysystem/src/Plugin/EmptyDir.php b/vendor/league/flysystem/src/Plugin/EmptyDir.php
deleted file mode 100644
index b5ae7f5..0000000
--- a/vendor/league/flysystem/src/Plugin/EmptyDir.php
+++ /dev/null
@@ -1,34 +0,0 @@
-filesystem->listContents($dirname, false);
-
- foreach ($listing as $item) {
- if ($item['type'] === 'dir') {
- $this->filesystem->deleteDir($item['path']);
- } else {
- $this->filesystem->delete($item['path']);
- }
- }
- }
-}
diff --git a/vendor/league/flysystem/src/Plugin/ForcedCopy.php b/vendor/league/flysystem/src/Plugin/ForcedCopy.php
deleted file mode 100644
index a41e9f3..0000000
--- a/vendor/league/flysystem/src/Plugin/ForcedCopy.php
+++ /dev/null
@@ -1,44 +0,0 @@
-filesystem->delete($newpath);
- } catch (FileNotFoundException $e) {
- // The destination path does not exist. That's ok.
- $deleted = true;
- }
-
- if ($deleted) {
- return $this->filesystem->copy($path, $newpath);
- }
-
- return false;
- }
-}
diff --git a/vendor/league/flysystem/src/Plugin/ForcedRename.php b/vendor/league/flysystem/src/Plugin/ForcedRename.php
deleted file mode 100644
index 3f51cd6..0000000
--- a/vendor/league/flysystem/src/Plugin/ForcedRename.php
+++ /dev/null
@@ -1,44 +0,0 @@
-filesystem->delete($newpath);
- } catch (FileNotFoundException $e) {
- // The destination path does not exist. That's ok.
- $deleted = true;
- }
-
- if ($deleted) {
- return $this->filesystem->rename($path, $newpath);
- }
-
- return false;
- }
-}
diff --git a/vendor/league/flysystem/src/Plugin/GetWithMetadata.php b/vendor/league/flysystem/src/Plugin/GetWithMetadata.php
deleted file mode 100644
index 2f13d2f..0000000
--- a/vendor/league/flysystem/src/Plugin/GetWithMetadata.php
+++ /dev/null
@@ -1,51 +0,0 @@
-filesystem->getMetadata($path);
-
- if ( ! $object) {
- return false;
- }
-
- $keys = array_diff($metadata, array_keys($object));
-
- foreach ($keys as $key) {
- if ( ! method_exists($this->filesystem, $method = 'get' . ucfirst($key))) {
- throw new InvalidArgumentException('Could not fetch metadata: ' . $key);
- }
-
- $object[$key] = $this->filesystem->{$method}($path);
- }
-
- return $object;
- }
-}
diff --git a/vendor/league/flysystem/src/Plugin/ListFiles.php b/vendor/league/flysystem/src/Plugin/ListFiles.php
deleted file mode 100644
index 9669fe7..0000000
--- a/vendor/league/flysystem/src/Plugin/ListFiles.php
+++ /dev/null
@@ -1,35 +0,0 @@
-filesystem->listContents($directory, $recursive);
-
- $filter = function ($object) {
- return $object['type'] === 'file';
- };
-
- return array_values(array_filter($contents, $filter));
- }
-}
diff --git a/vendor/league/flysystem/src/Plugin/ListPaths.php b/vendor/league/flysystem/src/Plugin/ListPaths.php
deleted file mode 100644
index 0889d1f..0000000
--- a/vendor/league/flysystem/src/Plugin/ListPaths.php
+++ /dev/null
@@ -1,36 +0,0 @@
-filesystem->listContents($directory, $recursive);
-
- foreach ($contents as $object) {
- $result[] = $object['path'];
- }
-
- return $result;
- }
-}
diff --git a/vendor/league/flysystem/src/Plugin/ListWith.php b/vendor/league/flysystem/src/Plugin/ListWith.php
deleted file mode 100644
index d64debe..0000000
--- a/vendor/league/flysystem/src/Plugin/ListWith.php
+++ /dev/null
@@ -1,60 +0,0 @@
-filesystem->listContents($directory, $recursive);
-
- foreach ($contents as $index => $object) {
- if ($object['type'] === 'file') {
- $missingKeys = array_diff($keys, array_keys($object));
- $contents[$index] = array_reduce($missingKeys, [$this, 'getMetadataByName'], $object);
- }
- }
-
- return $contents;
- }
-
- /**
- * Get a meta-data value by key name.
- *
- * @param array $object
- * @param string $key
- *
- * @return array
- */
- protected function getMetadataByName(array $object, $key)
- {
- $method = 'get' . ucfirst($key);
-
- if ( ! method_exists($this->filesystem, $method)) {
- throw new \InvalidArgumentException('Could not get meta-data for key: ' . $key);
- }
-
- $object[$key] = $this->filesystem->{$method}($object['path']);
-
- return $object;
- }
-}
diff --git a/vendor/league/flysystem/src/Plugin/PluggableTrait.php b/vendor/league/flysystem/src/Plugin/PluggableTrait.php
deleted file mode 100644
index 922edfe..0000000
--- a/vendor/league/flysystem/src/Plugin/PluggableTrait.php
+++ /dev/null
@@ -1,97 +0,0 @@
-plugins[$plugin->getMethod()] = $plugin;
-
- return $this;
- }
-
- /**
- * Find a specific plugin.
- *
- * @param string $method
- *
- * @throws PluginNotFoundException
- *
- * @return PluginInterface
- */
- protected function findPlugin($method)
- {
- if ( ! isset($this->plugins[$method])) {
- throw new PluginNotFoundException('Plugin not found for method: ' . $method);
- }
-
- return $this->plugins[$method];
- }
-
- /**
- * Invoke a plugin by method name.
- *
- * @param string $method
- * @param array $arguments
- * @param FilesystemInterface $filesystem
- *
- * @throws PluginNotFoundException
- *
- * @return mixed
- */
- protected function invokePlugin($method, array $arguments, FilesystemInterface $filesystem)
- {
- $plugin = $this->findPlugin($method);
- $plugin->setFilesystem($filesystem);
- $callback = [$plugin, 'handle'];
-
- return call_user_func_array($callback, $arguments);
- }
-
- /**
- * Plugins pass-through.
- *
- * @param string $method
- * @param array $arguments
- *
- * @throws BadMethodCallException
- *
- * @return mixed
- */
- public function __call($method, array $arguments)
- {
- try {
- return $this->invokePlugin($method, $arguments, $this);
- } catch (PluginNotFoundException $e) {
- throw new BadMethodCallException(
- 'Call to undefined method '
- . get_class($this)
- . '::' . $method
- );
- }
- }
-}
diff --git a/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php b/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php
deleted file mode 100644
index fd1d7e7..0000000
--- a/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php
+++ /dev/null
@@ -1,10 +0,0 @@
-formatPropertyName((string) $offset);
-
- return isset($this->{$property});
- }
-
- /**
- * @param mixed $offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- $property = $this->formatPropertyName((string) $offset);
-
- return $this->{$property};
- }
-
- /**
- * @param mixed $offset
- * @param mixed $value
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value): void
- {
- throw new RuntimeException('Properties can not be manipulated');
- }
-
- /**
- * @param mixed $offset
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset): void
- {
- throw new RuntimeException('Properties can not be manipulated');
- }
-}
diff --git a/vendor/league/flysystem/src/ReadInterface.php b/vendor/league/flysystem/src/ReadInterface.php
deleted file mode 100644
index 898a8d5..0000000
--- a/vendor/league/flysystem/src/ReadInterface.php
+++ /dev/null
@@ -1,88 +0,0 @@
-hash = spl_object_hash($this);
- static::$safeStorage[$this->hash] = [];
- }
-
- public function storeSafely($key, $value)
- {
- static::$safeStorage[$this->hash][$key] = $value;
- }
-
- public function retrieveSafely($key)
- {
- if (array_key_exists($key, static::$safeStorage[$this->hash])) {
- return static::$safeStorage[$this->hash][$key];
- }
- }
-
- public function __destruct()
- {
- unset(static::$safeStorage[$this->hash]);
- }
-}
diff --git a/vendor/league/flysystem/src/StorageAttributes.php b/vendor/league/flysystem/src/StorageAttributes.php
deleted file mode 100644
index 6be6235..0000000
--- a/vendor/league/flysystem/src/StorageAttributes.php
+++ /dev/null
@@ -1,40 +0,0 @@
-location;
- }
-
- public static function atLocation(string $pathName): SymbolicLinkEncountered
- {
- $e = new static("Unsupported symbolic link encountered at location $pathName");
- $e->location = $pathName;
-
- return $e;
- }
-}
diff --git a/vendor/league/flysystem/src/UnableToCheckFileExistence.php b/vendor/league/flysystem/src/UnableToCheckFileExistence.php
deleted file mode 100644
index d78e4ee..0000000
--- a/vendor/league/flysystem/src/UnableToCheckFileExistence.php
+++ /dev/null
@@ -1,21 +0,0 @@
-source;
- }
-
- public function destination(): string
- {
- return $this->destination;
- }
-
- public static function fromLocationTo(
- string $sourcePath,
- string $destinationPath,
- Throwable $previous = null
- ): UnableToCopyFile {
- $e = new static("Unable to copy file from $sourcePath to $destinationPath", 0 , $previous);
- $e->source = $sourcePath;
- $e->destination = $destinationPath;
-
- return $e;
- }
-
- public function operation(): string
- {
- return FilesystemOperationFailed::OPERATION_COPY;
- }
-}
diff --git a/vendor/league/flysystem/src/UnableToCreateDirectory.php b/vendor/league/flysystem/src/UnableToCreateDirectory.php
deleted file mode 100644
index 8298f9f..0000000
--- a/vendor/league/flysystem/src/UnableToCreateDirectory.php
+++ /dev/null
@@ -1,44 +0,0 @@
-location = $dirname;
-
- return $e;
- }
-
- public static function dueToFailure(string $dirname, Throwable $previous): UnableToCreateDirectory
- {
- $message = "Unable to create a directory at {$dirname}";
- $e = new static($message, 0, $previous);
- $e->location = $dirname;
-
- return $e;
- }
-
- public function operation(): string
- {
- return FilesystemOperationFailed::OPERATION_CREATE_DIRECTORY;
- }
-
- public function location(): string
- {
- return $this->location;
- }
-}
diff --git a/vendor/league/flysystem/src/UnableToDeleteDirectory.php b/vendor/league/flysystem/src/UnableToDeleteDirectory.php
deleted file mode 100644
index eeeab24..0000000
--- a/vendor/league/flysystem/src/UnableToDeleteDirectory.php
+++ /dev/null
@@ -1,48 +0,0 @@
-location = $location;
- $e->reason = $reason;
-
- return $e;
- }
-
- public function operation(): string
- {
- return FilesystemOperationFailed::OPERATION_DELETE_DIRECTORY;
- }
-
- public function reason(): string
- {
- return $this->reason;
- }
-
- public function location(): string
- {
- return $this->location;
- }
-}
diff --git a/vendor/league/flysystem/src/UnableToDeleteFile.php b/vendor/league/flysystem/src/UnableToDeleteFile.php
deleted file mode 100644
index 18f7215..0000000
--- a/vendor/league/flysystem/src/UnableToDeleteFile.php
+++ /dev/null
@@ -1,45 +0,0 @@
-location = $location;
- $e->reason = $reason;
-
- return $e;
- }
-
- public function operation(): string
- {
- return FilesystemOperationFailed::OPERATION_DELETE;
- }
-
- public function reason(): string
- {
- return $this->reason;
- }
-
- public function location(): string
- {
- return $this->location;
- }
-}
diff --git a/vendor/league/flysystem/src/UnableToMountFilesystem.php b/vendor/league/flysystem/src/UnableToMountFilesystem.php
deleted file mode 100644
index bd41bc9..0000000
--- a/vendor/league/flysystem/src/UnableToMountFilesystem.php
+++ /dev/null
@@ -1,32 +0,0 @@
-source;
- }
-
- public function destination(): string
- {
- return $this->destination;
- }
-
- public static function fromLocationTo(
- string $sourcePath,
- string $destinationPath,
- Throwable $previous = null
- ): UnableToMoveFile {
- $e = new static("Unable to move file from $sourcePath to $destinationPath", 0, $previous);
- $e->source = $sourcePath;
- $e->destination = $destinationPath;
-
- return $e;
- }
-
- public function operation(): string
- {
- return FilesystemOperationFailed::OPERATION_MOVE;
- }
-}
diff --git a/vendor/league/flysystem/src/UnableToReadFile.php b/vendor/league/flysystem/src/UnableToReadFile.php
deleted file mode 100644
index 766b563..0000000
--- a/vendor/league/flysystem/src/UnableToReadFile.php
+++ /dev/null
@@ -1,45 +0,0 @@
-location = $location;
- $e->reason = $reason;
-
- return $e;
- }
-
- public function operation(): string
- {
- return FilesystemOperationFailed::OPERATION_READ;
- }
-
- public function reason(): string
- {
- return $this->reason;
- }
-
- public function location(): string
- {
- return $this->location;
- }
-}
diff --git a/vendor/league/flysystem/src/UnableToResolveFilesystemMount.php b/vendor/league/flysystem/src/UnableToResolveFilesystemMount.php
deleted file mode 100644
index 91a9ee3..0000000
--- a/vendor/league/flysystem/src/UnableToResolveFilesystemMount.php
+++ /dev/null
@@ -1,20 +0,0 @@
-reason = $reason;
- $e->location = $location;
- $e->metadataType = $type;
-
- return $e;
- }
-
- public function reason(): string
- {
- return $this->reason;
- }
-
- public function location(): string
- {
- return $this->location;
- }
-
- public function metadataType(): string
- {
- return $this->metadataType;
- }
-
- public function operation(): string
- {
- return FilesystemOperationFailed::OPERATION_RETRIEVE_METADATA;
- }
-}
diff --git a/vendor/league/flysystem/src/UnableToSetVisibility.php b/vendor/league/flysystem/src/UnableToSetVisibility.php
deleted file mode 100644
index 5862d0e..0000000
--- a/vendor/league/flysystem/src/UnableToSetVisibility.php
+++ /dev/null
@@ -1,49 +0,0 @@
-reason;
- }
-
- public static function atLocation(string $filename, string $extraMessage = '', Throwable $previous = null): self
- {
- $message = "Unable to set visibility for file {$filename}. $extraMessage";
- $e = new static(rtrim($message), 0, $previous);
- $e->reason = $extraMessage;
- $e->location = $filename;
-
- return $e;
- }
-
- public function operation(): string
- {
- return FilesystemOperationFailed::OPERATION_SET_VISIBILITY;
- }
-
- public function location(): string
- {
- return $this->location;
- }
-}
diff --git a/vendor/league/flysystem/src/UnableToWriteFile.php b/vendor/league/flysystem/src/UnableToWriteFile.php
deleted file mode 100644
index 5de7866..0000000
--- a/vendor/league/flysystem/src/UnableToWriteFile.php
+++ /dev/null
@@ -1,45 +0,0 @@
-location = $location;
- $e->reason = $reason;
-
- return $e;
- }
-
- public function operation(): string
- {
- return FilesystemOperationFailed::OPERATION_WRITE;
- }
-
- public function reason(): string
- {
- return $this->reason;
- }
-
- public function location(): string
- {
- return $this->location;
- }
-}
diff --git a/vendor/league/flysystem/src/UnixVisibility/PortableVisibilityConverter.php b/vendor/league/flysystem/src/UnixVisibility/PortableVisibilityConverter.php
deleted file mode 100644
index 5cc1eb2..0000000
--- a/vendor/league/flysystem/src/UnixVisibility/PortableVisibilityConverter.php
+++ /dev/null
@@ -1,109 +0,0 @@
-filePublic = $filePublic;
- $this->filePrivate = $filePrivate;
- $this->directoryPublic = $directoryPublic;
- $this->directoryPrivate = $directoryPrivate;
- $this->defaultForDirectories = $defaultForDirectories;
- }
-
- public function forFile(string $visibility): int
- {
- PortableVisibilityGuard::guardAgainstInvalidInput($visibility);
-
- return $visibility === Visibility::PUBLIC
- ? $this->filePublic
- : $this->filePrivate;
- }
-
- public function forDirectory(string $visibility): int
- {
- PortableVisibilityGuard::guardAgainstInvalidInput($visibility);
-
- return $visibility === Visibility::PUBLIC
- ? $this->directoryPublic
- : $this->directoryPrivate;
- }
-
- public function inverseForFile(int $visibility): string
- {
- if ($visibility === $this->filePublic) {
- return Visibility::PUBLIC;
- } elseif ($visibility === $this->filePrivate) {
- return Visibility::PRIVATE;
- }
-
- return Visibility::PUBLIC; // default
- }
-
- public function inverseForDirectory(int $visibility): string
- {
- if ($visibility === $this->directoryPublic) {
- return Visibility::PUBLIC;
- } elseif ($visibility === $this->directoryPrivate) {
- return Visibility::PRIVATE;
- }
-
- return Visibility::PUBLIC; // default
- }
-
- public function defaultForDirectories(): int
- {
- return $this->defaultForDirectories === Visibility::PUBLIC ? $this->directoryPublic : $this->directoryPrivate;
- }
-
- /**
- * @param array $permissionMap
- */
- public static function fromArray(array $permissionMap, string $defaultForDirectories = Visibility::PRIVATE): PortableVisibilityConverter
- {
- return new PortableVisibilityConverter(
- $permissionMap['file']['public'] ?? 0644,
- $permissionMap['file']['private'] ?? 0600,
- $permissionMap['dir']['public'] ?? 0755,
- $permissionMap['dir']['private'] ?? 0700,
- $defaultForDirectories
- );
- }
-}
diff --git a/vendor/league/flysystem/src/UnixVisibility/VisibilityConverter.php b/vendor/league/flysystem/src/UnixVisibility/VisibilityConverter.php
deleted file mode 100644
index 64af86a..0000000
--- a/vendor/league/flysystem/src/UnixVisibility/VisibilityConverter.php
+++ /dev/null
@@ -1,14 +0,0 @@
-location;
- }
-
- public static function atLocation(string $location): UnreadableFileEncountered
- {
- $e = new static("Unreadable file encountered at location {$location}.");
- $e->location = $location;
-
- return $e;
- }
-}
diff --git a/vendor/league/flysystem/src/UnreadableFileException.php b/vendor/league/flysystem/src/UnreadableFileException.php
deleted file mode 100644
index e668033..0000000
--- a/vendor/league/flysystem/src/UnreadableFileException.php
+++ /dev/null
@@ -1,18 +0,0 @@
-getRealPath()
- )
- );
- }
-}
diff --git a/vendor/league/flysystem/src/Util.php b/vendor/league/flysystem/src/Util.php
deleted file mode 100644
index 1a2db71..0000000
--- a/vendor/league/flysystem/src/Util.php
+++ /dev/null
@@ -1,354 +0,0 @@
- ''];
- }
-
- /**
- * Normalize a dirname return value.
- *
- * @param string $dirname
- *
- * @return string normalized dirname
- */
- public static function normalizeDirname($dirname)
- {
- return $dirname === '.' ? '' : $dirname;
- }
-
- /**
- * Get a normalized dirname from a path.
- *
- * @param string $path
- *
- * @return string dirname
- */
- public static function dirname($path)
- {
- return static::normalizeDirname(dirname($path));
- }
-
- /**
- * Map result arrays.
- *
- * @param array $object
- * @param array $map
- *
- * @return array mapped result
- */
- public static function map(array $object, array $map)
- {
- $result = [];
-
- foreach ($map as $from => $to) {
- if ( ! isset($object[$from])) {
- continue;
- }
-
- $result[$to] = $object[$from];
- }
-
- return $result;
- }
-
- /**
- * Normalize path.
- *
- * @param string $path
- *
- * @throws LogicException
- *
- * @return string
- */
- public static function normalizePath($path)
- {
- return static::normalizeRelativePath($path);
- }
-
- /**
- * Normalize relative directories in a path.
- *
- * @param string $path
- *
- * @throws LogicException
- *
- * @return string
- */
- public static function normalizeRelativePath($path)
- {
- $path = str_replace('\\', '/', $path);
- $path = static::removeFunkyWhiteSpace($path);
- $parts = [];
-
- foreach (explode('/', $path) as $part) {
- switch ($part) {
- case '':
- case '.':
- break;
-
- case '..':
- if (empty($parts)) {
- throw new LogicException(
- 'Path is outside of the defined root, path: [' . $path . ']'
- );
- }
- array_pop($parts);
- break;
-
- default:
- $parts[] = $part;
- break;
- }
- }
-
- $path = implode('/', $parts);
-
- return $path;
- }
-
- /**
- * Rejects unprintable characters and invalid unicode characters.
- *
- * @param string $path
- *
- * @return string $path
- */
- protected static function removeFunkyWhiteSpace($path)
- {
- if (preg_match('#\p{C}+#u', $path)) {
- throw CorruptedPathDetected::forPath($path);
- }
-
- return $path;
- }
-
- /**
- * Normalize prefix.
- *
- * @param string $prefix
- * @param string $separator
- *
- * @return string normalized path
- */
- public static function normalizePrefix($prefix, $separator)
- {
- return rtrim($prefix, $separator) . $separator;
- }
-
- /**
- * Get content size.
- *
- * @param string $contents
- *
- * @return int content size
- */
- public static function contentSize($contents)
- {
- return defined('MB_OVERLOAD_STRING') ? mb_strlen($contents, '8bit') : strlen($contents);
- }
-
- /**
- * Guess MIME Type based on the path of the file and it's content.
- *
- * @param string $path
- * @param string|resource $content
- *
- * @return string|null MIME Type or NULL if no extension detected
- */
- public static function guessMimeType($path, $content)
- {
- $mimeType = MimeType::detectByContent($content);
-
- if ( ! (empty($mimeType) || in_array($mimeType, ['application/x-empty', 'text/plain', 'text/x-asm']))) {
- return $mimeType;
- }
-
- return MimeType::detectByFilename($path);
- }
-
- /**
- * Emulate directories.
- *
- * @param array $listing
- *
- * @return array listing with emulated directories
- */
- public static function emulateDirectories(array $listing)
- {
- $directories = [];
- $listedDirectories = [];
-
- foreach ($listing as $object) {
- [$directories, $listedDirectories] = static::emulateObjectDirectories($object, $directories, $listedDirectories);
- }
-
- $directories = array_diff(array_unique($directories), array_unique($listedDirectories));
-
- foreach ($directories as $directory) {
- $listing[] = static::pathinfo($directory) + ['type' => 'dir'];
- }
-
- return $listing;
- }
-
- /**
- * Ensure a Config instance.
- *
- * @param null|array|Config $config
- *
- * @return Config config instance
- *
- * @throw LogicException
- */
- public static function ensureConfig($config)
- {
- if ($config === null) {
- return new Config();
- }
-
- if ($config instanceof Config) {
- return $config;
- }
-
- if (is_array($config)) {
- return new Config($config);
- }
-
- throw new LogicException('A config should either be an array or a Flysystem\Config object.');
- }
-
- /**
- * Rewind a stream.
- *
- * @param resource $resource
- */
- public static function rewindStream($resource)
- {
- if (ftell($resource) !== 0 && static::isSeekableStream($resource)) {
- rewind($resource);
- }
- }
-
- public static function isSeekableStream($resource)
- {
- $metadata = stream_get_meta_data($resource);
-
- return $metadata['seekable'];
- }
-
- /**
- * Get the size of a stream.
- *
- * @param resource $resource
- *
- * @return int|null stream size
- */
- public static function getStreamSize($resource)
- {
- $stat = fstat($resource);
-
- if ( ! is_array($stat) || ! isset($stat['size'])) {
- return null;
- }
-
- return $stat['size'];
- }
-
- /**
- * Emulate the directories of a single object.
- *
- * @param array $object
- * @param array $directories
- * @param array $listedDirectories
- *
- * @return array
- */
- protected static function emulateObjectDirectories(array $object, array $directories, array $listedDirectories)
- {
- if ($object['type'] === 'dir') {
- $listedDirectories[] = $object['path'];
- }
-
- if ( ! isset($object['dirname']) || trim($object['dirname']) === '') {
- return [$directories, $listedDirectories];
- }
-
- $parent = $object['dirname'];
-
- while (isset($parent) && trim($parent) !== '' && ! in_array($parent, $directories)) {
- $directories[] = $parent;
- $parent = static::dirname($parent);
- }
-
- if (isset($object['type']) && $object['type'] === 'dir') {
- $listedDirectories[] = $object['path'];
-
- return [$directories, $listedDirectories];
- }
-
- return [$directories, $listedDirectories];
- }
-
- /**
- * Returns the trailing name component of the path.
- *
- * @param string $path
- *
- * @return string
- */
- private static function basename($path)
- {
- $separators = DIRECTORY_SEPARATOR === '/' ? '/' : '\/';
-
- $path = rtrim($path, $separators);
-
- $basename = preg_replace('#.*?([^' . preg_quote($separators, '#') . ']+$)#', '$1', $path);
-
- if (DIRECTORY_SEPARATOR === '/') {
- return $basename;
- }
- // @codeCoverageIgnoreStart
- // Extra Windows path munging. This is tested via AppVeyor, but code
- // coverage is not reported.
-
- // Handle relative paths with drive letters. c:file.txt.
- while (preg_match('#^[a-zA-Z]{1}:[^\\\/]#', $basename)) {
- $basename = substr($basename, 2);
- }
-
- // Remove colon for standalone drive letter names.
- if (preg_match('#^[a-zA-Z]{1}:$#', $basename)) {
- $basename = rtrim($basename, ':');
- }
-
- return $basename;
- // @codeCoverageIgnoreEnd
- }
-}
diff --git a/vendor/league/flysystem/src/Util/ContentListingFormatter.php b/vendor/league/flysystem/src/Util/ContentListingFormatter.php
deleted file mode 100644
index ae0d3b9..0000000
--- a/vendor/league/flysystem/src/Util/ContentListingFormatter.php
+++ /dev/null
@@ -1,122 +0,0 @@
-directory = rtrim($directory, '/');
- $this->recursive = $recursive;
- $this->caseSensitive = $caseSensitive;
- }
-
- /**
- * Format contents listing.
- *
- * @param array $listing
- *
- * @return array
- */
- public function formatListing(array $listing)
- {
- $listing = array_filter(array_map([$this, 'addPathInfo'], $listing), [$this, 'isEntryOutOfScope']);
-
- return $this->sortListing(array_values($listing));
- }
-
- private function addPathInfo(array $entry)
- {
- return $entry + Util::pathinfo($entry['path']);
- }
-
- /**
- * Determine if the entry is out of scope.
- *
- * @param array $entry
- *
- * @return bool
- */
- private function isEntryOutOfScope(array $entry)
- {
- if (empty($entry['path']) && $entry['path'] !== '0') {
- return false;
- }
-
- if ($this->recursive) {
- return $this->residesInDirectory($entry);
- }
-
- return $this->isDirectChild($entry);
- }
-
- /**
- * Check if the entry resides within the parent directory.
- *
- * @param array $entry
- *
- * @return bool
- */
- private function residesInDirectory(array $entry)
- {
- if ($this->directory === '') {
- return true;
- }
-
- return $this->caseSensitive
- ? strpos($entry['path'], $this->directory . '/') === 0
- : stripos($entry['path'], $this->directory . '/') === 0;
- }
-
- /**
- * Check if the entry is a direct child of the directory.
- *
- * @param array $entry
- *
- * @return bool
- */
- private function isDirectChild(array $entry)
- {
- return $this->caseSensitive
- ? $entry['dirname'] === $this->directory
- : strcasecmp($this->directory, $entry['dirname']) === 0;
- }
-
- /**
- * @param array $listing
- *
- * @return array
- */
- private function sortListing(array $listing)
- {
- usort($listing, function ($a, $b) {
- return strcasecmp($a['path'], $b['path']);
- });
-
- return $listing;
- }
-}
diff --git a/vendor/league/flysystem/src/Util/MimeType.php b/vendor/league/flysystem/src/Util/MimeType.php
deleted file mode 100644
index 35cba3f..0000000
--- a/vendor/league/flysystem/src/Util/MimeType.php
+++ /dev/null
@@ -1,80 +0,0 @@
-detectMimeTypeFromBuffer($content);
- }
-
- return 'text/plain';
- }
-
- /**
- * Detects MIME Type based on file extension.
- *
- * @param string $extension
- *
- * @return string MIME Type
- */
- public static function detectByFileExtension($extension)
- {
- return static::detector()->detectMimeTypeFromPath('artificial.' . $extension) ?: 'text/plain';
- }
-
- /**
- * @param string $filename
- *
- * @return string MIME Type
- */
- public static function detectByFilename($filename)
- {
- return static::detector()->detectMimeTypeFromPath($filename) ?: 'text/plain';
- }
-
- /**
- * @return array Map of file extension to MIME Type
- */
- public static function getExtensionToMimeTypeMap()
- {
- return static::$extensionToMimeTypeMap;
- }
-}
diff --git a/vendor/league/flysystem/src/Util/StreamHasher.php b/vendor/league/flysystem/src/Util/StreamHasher.php
deleted file mode 100644
index 938ec5d..0000000
--- a/vendor/league/flysystem/src/Util/StreamHasher.php
+++ /dev/null
@@ -1,36 +0,0 @@
-algo = $algo;
- }
-
- /**
- * @param resource $resource
- *
- * @return string
- */
- public function hash($resource)
- {
- rewind($resource);
- $context = hash_init($this->algo);
- hash_update_stream($context, $resource);
- fclose($resource);
-
- return hash_final($context);
- }
-}
diff --git a/vendor/league/flysystem/src/Visibility.php b/vendor/league/flysystem/src/Visibility.php
deleted file mode 100644
index 071ca00..0000000
--- a/vendor/league/flysystem/src/Visibility.php
+++ /dev/null
@@ -1,11 +0,0 @@
-rejectFunkyWhiteSpace($path);
-
- return $this->normalizeRelativePath($path);
- }
-
- private function rejectFunkyWhiteSpace(string $path): void
- {
- if (preg_match('#\p{C}+#u', $path)) {
- throw CorruptedPathDetected::forPath($path);
- }
- }
-
- private function normalizeRelativePath(string $path): string
- {
- $parts = [];
-
- foreach (explode('/', $path) as $part) {
- switch ($part) {
- case '':
- case '.':
- break;
-
- case '..':
- if (empty($parts)) {
- throw PathTraversalDetected::forPath($path);
- }
- array_pop($parts);
- break;
-
- default:
- $parts[] = $part;
- break;
- }
- }
-
- return implode('/', $parts);
- }
-}
diff --git a/vendor/league/mime-type-detection/CHANGELOG.md b/vendor/league/mime-type-detection/CHANGELOG.md
deleted file mode 100644
index 2264f7a..0000000
--- a/vendor/league/mime-type-detection/CHANGELOG.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# Changelog
-
-## 1.10.0 - 2022-04-11
-
-### Fixed
-
-- Added Flysystem v1 inconclusive mime-types and made it configurable as a constructor parameter.
-
-## 1.9.0 - 2021-11-21
-
-### Updated
-
-- Updated lookup
-
-## 1.8.0 - 2021-09-25
-
-### Added
-
-- Added the decorator `OverridingExtensionToMimeTypeMap` which allows you to override values.
-
-## 1.7.0 - 2021-01-18
-
-### Added
-
-- Added a `bufferSampleSize` parameter to the `FinfoMimeTypeDetector` class that allows you to send a reduced content sample which costs less memory.
-
-## 1.6.0 - 2021-01-18
-
-### Changes
-
-- Updated generated mime-type map
diff --git a/vendor/league/mime-type-detection/LICENSE b/vendor/league/mime-type-detection/LICENSE
deleted file mode 100644
index 1f01652..0000000
--- a/vendor/league/mime-type-detection/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2013-2022 Frank de Jonge
-
-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.
diff --git a/vendor/league/mime-type-detection/composer.json b/vendor/league/mime-type-detection/composer.json
deleted file mode 100644
index 80ca1af..0000000
--- a/vendor/league/mime-type-detection/composer.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "name": "league/mime-type-detection",
- "description": "Mime-type detection for Flysystem",
- "license": "MIT",
- "authors": [
- {
- "name": "Frank de Jonge",
- "email": "info@frankdejonge.nl"
- }
- ],
- "scripts": {
- "test": "vendor/bin/phpunit",
- "phpstan": "vendor/bin/phpstan analyse -l 6 src"
- },
- "require": {
- "php": "^7.2 || ^8.0",
- "ext-fileinfo": "*"
- },
- "require-dev": {
- "phpunit/phpunit": "^8.5.8 || ^9.3",
- "phpstan/phpstan": "^0.12.68",
- "friendsofphp/php-cs-fixer": "^3.2"
- },
- "autoload": {
- "psr-4": {
- "League\\MimeTypeDetection\\": "src"
- }
- },
- "config": {
- "platform": {
- "php": "7.2.0"
- }
- }
-}
diff --git a/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php
deleted file mode 100644
index fc04241..0000000
--- a/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php
+++ /dev/null
@@ -1,13 +0,0 @@
-extensions = $extensions ?: new GeneratedExtensionToMimeTypeMap();
- }
-
- public function detectMimeType(string $path, $contents): ?string
- {
- return $this->detectMimeTypeFromPath($path);
- }
-
- public function detectMimeTypeFromPath(string $path): ?string
- {
- $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION));
-
- return $this->extensions->lookupMimeType($extension);
- }
-
- public function detectMimeTypeFromFile(string $path): ?string
- {
- return $this->detectMimeTypeFromPath($path);
- }
-
- public function detectMimeTypeFromBuffer(string $contents): ?string
- {
- return null;
- }
-}
diff --git a/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php
deleted file mode 100644
index 1dad7bc..0000000
--- a/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php
+++ /dev/null
@@ -1,10 +0,0 @@
-
- */
- private $inconclusiveMimetypes;
-
- public function __construct(
- string $magicFile = '',
- ExtensionToMimeTypeMap $extensionMap = null,
- ?int $bufferSampleSize = null,
- array $inconclusiveMimetypes = self::INCONCLUSIVE_MIME_TYPES
- ) {
- $this->finfo = new finfo(FILEINFO_MIME_TYPE, $magicFile);
- $this->extensionMap = $extensionMap ?: new GeneratedExtensionToMimeTypeMap();
- $this->bufferSampleSize = $bufferSampleSize;
- $this->inconclusiveMimetypes = $inconclusiveMimetypes;
- }
-
- public function detectMimeType(string $path, $contents): ?string
- {
- $mimeType = is_string($contents)
- ? (@$this->finfo->buffer($this->takeSample($contents)) ?: null)
- : null;
-
- if ($mimeType !== null && ! in_array($mimeType, $this->inconclusiveMimetypes)) {
- return $mimeType;
- }
-
- return $this->detectMimeTypeFromPath($path);
- }
-
- public function detectMimeTypeFromPath(string $path): ?string
- {
- $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION));
-
- return $this->extensionMap->lookupMimeType($extension);
- }
-
- public function detectMimeTypeFromFile(string $path): ?string
- {
- return @$this->finfo->file($path) ?: null;
- }
-
- public function detectMimeTypeFromBuffer(string $contents): ?string
- {
- return @$this->finfo->buffer($this->takeSample($contents)) ?: null;
- }
-
- private function takeSample(string $contents): string
- {
- if ($this->bufferSampleSize === null) {
- return $contents;
- }
-
- return (string) substr($contents, 0, $this->bufferSampleSize);
- }
-}
diff --git a/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php
deleted file mode 100644
index f092388..0000000
--- a/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php
+++ /dev/null
@@ -1,1227 +0,0 @@
- 'application/vnd.1000minds.decision-model+xml',
- '3dml' => 'text/vnd.in3d.3dml',
- '3ds' => 'image/x-3ds',
- '3g2' => 'video/3gpp2',
- '3gp' => 'video/3gp',
- '3gpp' => 'video/3gpp',
- '3mf' => 'model/3mf',
- '7z' => 'application/x-7z-compressed',
- '7zip' => 'application/x-7z-compressed',
- '123' => 'application/vnd.lotus-1-2-3',
- 'aab' => 'application/x-authorware-bin',
- 'aac' => 'audio/x-acc',
- 'aam' => 'application/x-authorware-map',
- 'aas' => 'application/x-authorware-seg',
- 'abw' => 'application/x-abiword',
- 'ac' => 'application/vnd.nokia.n-gage.ac+xml',
- 'ac3' => 'audio/ac3',
- 'acc' => 'application/vnd.americandynamics.acc',
- 'ace' => 'application/x-ace-compressed',
- 'acu' => 'application/vnd.acucobol',
- 'acutc' => 'application/vnd.acucorp',
- 'adp' => 'audio/adpcm',
- 'aep' => 'application/vnd.audiograph',
- 'afm' => 'application/x-font-type1',
- 'afp' => 'application/vnd.ibm.modcap',
- 'age' => 'application/vnd.age',
- 'ahead' => 'application/vnd.ahead.space',
- 'ai' => 'application/pdf',
- 'aif' => 'audio/x-aiff',
- 'aifc' => 'audio/x-aiff',
- 'aiff' => 'audio/x-aiff',
- 'air' => 'application/vnd.adobe.air-application-installer-package+zip',
- 'ait' => 'application/vnd.dvb.ait',
- 'ami' => 'application/vnd.amiga.ami',
- 'amr' => 'audio/amr',
- 'apk' => 'application/vnd.android.package-archive',
- 'apng' => 'image/apng',
- 'appcache' => 'text/cache-manifest',
- 'application' => 'application/x-ms-application',
- 'apr' => 'application/vnd.lotus-approach',
- 'arc' => 'application/x-freearc',
- 'arj' => 'application/x-arj',
- 'asc' => 'application/pgp-signature',
- 'asf' => 'video/x-ms-asf',
- 'asm' => 'text/x-asm',
- 'aso' => 'application/vnd.accpac.simply.aso',
- 'asx' => 'video/x-ms-asf',
- 'atc' => 'application/vnd.acucorp',
- 'atom' => 'application/atom+xml',
- 'atomcat' => 'application/atomcat+xml',
- 'atomdeleted' => 'application/atomdeleted+xml',
- 'atomsvc' => 'application/atomsvc+xml',
- 'atx' => 'application/vnd.antix.game-component',
- 'au' => 'audio/x-au',
- 'avci' => 'image/avci',
- 'avcs' => 'image/avcs',
- 'avi' => 'video/x-msvideo',
- 'avif' => 'image/avif',
- 'aw' => 'application/applixware',
- 'azf' => 'application/vnd.airzip.filesecure.azf',
- 'azs' => 'application/vnd.airzip.filesecure.azs',
- 'azv' => 'image/vnd.airzip.accelerator.azv',
- 'azw' => 'application/vnd.amazon.ebook',
- 'b16' => 'image/vnd.pco.b16',
- 'bat' => 'application/x-msdownload',
- 'bcpio' => 'application/x-bcpio',
- 'bdf' => 'application/x-font-bdf',
- 'bdm' => 'application/vnd.syncml.dm+wbxml',
- 'bdoc' => 'application/x-bdoc',
- 'bed' => 'application/vnd.realvnc.bed',
- 'bh2' => 'application/vnd.fujitsu.oasysprs',
- 'bin' => 'application/octet-stream',
- 'blb' => 'application/x-blorb',
- 'blorb' => 'application/x-blorb',
- 'bmi' => 'application/vnd.bmi',
- 'bmml' => 'application/vnd.balsamiq.bmml+xml',
- 'bmp' => 'image/bmp',
- 'book' => 'application/vnd.framemaker',
- 'box' => 'application/vnd.previewsystems.box',
- 'boz' => 'application/x-bzip2',
- 'bpk' => 'application/octet-stream',
- 'bpmn' => 'application/octet-stream',
- 'bsp' => 'model/vnd.valve.source.compiled-map',
- 'btif' => 'image/prs.btif',
- 'buffer' => 'application/octet-stream',
- 'bz' => 'application/x-bzip',
- 'bz2' => 'application/x-bzip2',
- 'c' => 'text/x-c',
- 'c4d' => 'application/vnd.clonk.c4group',
- 'c4f' => 'application/vnd.clonk.c4group',
- 'c4g' => 'application/vnd.clonk.c4group',
- 'c4p' => 'application/vnd.clonk.c4group',
- 'c4u' => 'application/vnd.clonk.c4group',
- 'c11amc' => 'application/vnd.cluetrust.cartomobile-config',
- 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg',
- 'cab' => 'application/vnd.ms-cab-compressed',
- 'caf' => 'audio/x-caf',
- 'cap' => 'application/vnd.tcpdump.pcap',
- 'car' => 'application/vnd.curl.car',
- 'cat' => 'application/vnd.ms-pki.seccat',
- 'cb7' => 'application/x-cbr',
- 'cba' => 'application/x-cbr',
- 'cbr' => 'application/x-cbr',
- 'cbt' => 'application/x-cbr',
- 'cbz' => 'application/x-cbr',
- 'cc' => 'text/x-c',
- 'cco' => 'application/x-cocoa',
- 'cct' => 'application/x-director',
- 'ccxml' => 'application/ccxml+xml',
- 'cdbcmsg' => 'application/vnd.contact.cmsg',
- 'cdf' => 'application/x-netcdf',
- 'cdfx' => 'application/cdfx+xml',
- 'cdkey' => 'application/vnd.mediastation.cdkey',
- 'cdmia' => 'application/cdmi-capability',
- 'cdmic' => 'application/cdmi-container',
- 'cdmid' => 'application/cdmi-domain',
- 'cdmio' => 'application/cdmi-object',
- 'cdmiq' => 'application/cdmi-queue',
- 'cdr' => 'application/cdr',
- 'cdx' => 'chemical/x-cdx',
- 'cdxml' => 'application/vnd.chemdraw+xml',
- 'cdy' => 'application/vnd.cinderella',
- 'cer' => 'application/pkix-cert',
- 'cfs' => 'application/x-cfs-compressed',
- 'cgm' => 'image/cgm',
- 'chat' => 'application/x-chat',
- 'chm' => 'application/vnd.ms-htmlhelp',
- 'chrt' => 'application/vnd.kde.kchart',
- 'cif' => 'chemical/x-cif',
- 'cii' => 'application/vnd.anser-web-certificate-issue-initiation',
- 'cil' => 'application/vnd.ms-artgalry',
- 'cjs' => 'application/node',
- 'cla' => 'application/vnd.claymore',
- 'class' => 'application/octet-stream',
- 'clkk' => 'application/vnd.crick.clicker.keyboard',
- 'clkp' => 'application/vnd.crick.clicker.palette',
- 'clkt' => 'application/vnd.crick.clicker.template',
- 'clkw' => 'application/vnd.crick.clicker.wordbank',
- 'clkx' => 'application/vnd.crick.clicker',
- 'clp' => 'application/x-msclip',
- 'cmc' => 'application/vnd.cosmocaller',
- 'cmdf' => 'chemical/x-cmdf',
- 'cml' => 'chemical/x-cml',
- 'cmp' => 'application/vnd.yellowriver-custom-menu',
- 'cmx' => 'image/x-cmx',
- 'cod' => 'application/vnd.rim.cod',
- 'coffee' => 'text/coffeescript',
- 'com' => 'application/x-msdownload',
- 'conf' => 'text/plain',
- 'cpio' => 'application/x-cpio',
- 'cpl' => 'application/cpl+xml',
- 'cpp' => 'text/x-c',
- 'cpt' => 'application/mac-compactpro',
- 'crd' => 'application/x-mscardfile',
- 'crl' => 'application/pkix-crl',
- 'crt' => 'application/x-x509-ca-cert',
- 'crx' => 'application/x-chrome-extension',
- 'cryptonote' => 'application/vnd.rig.cryptonote',
- 'csh' => 'application/x-csh',
- 'csl' => 'application/vnd.citationstyles.style+xml',
- 'csml' => 'chemical/x-csml',
- 'csp' => 'application/vnd.commonspace',
- 'csr' => 'application/octet-stream',
- 'css' => 'text/css',
- 'cst' => 'application/x-director',
- 'csv' => 'text/csv',
- 'cu' => 'application/cu-seeme',
- 'curl' => 'text/vnd.curl',
- 'cww' => 'application/prs.cww',
- 'cxt' => 'application/x-director',
- 'cxx' => 'text/x-c',
- 'dae' => 'model/vnd.collada+xml',
- 'daf' => 'application/vnd.mobius.daf',
- 'dart' => 'application/vnd.dart',
- 'dataless' => 'application/vnd.fdsn.seed',
- 'davmount' => 'application/davmount+xml',
- 'dbf' => 'application/vnd.dbf',
- 'dbk' => 'application/docbook+xml',
- 'dcr' => 'application/x-director',
- 'dcurl' => 'text/vnd.curl.dcurl',
- 'dd2' => 'application/vnd.oma.dd2+xml',
- 'ddd' => 'application/vnd.fujixerox.ddd',
- 'ddf' => 'application/vnd.syncml.dmddf+xml',
- 'dds' => 'image/vnd.ms-dds',
- 'deb' => 'application/x-debian-package',
- 'def' => 'text/plain',
- 'deploy' => 'application/octet-stream',
- 'der' => 'application/x-x509-ca-cert',
- 'dfac' => 'application/vnd.dreamfactory',
- 'dgc' => 'application/x-dgc-compressed',
- 'dic' => 'text/x-c',
- 'dir' => 'application/x-director',
- 'dis' => 'application/vnd.mobius.dis',
- 'disposition-notification' => 'message/disposition-notification',
- 'dist' => 'application/octet-stream',
- 'distz' => 'application/octet-stream',
- 'djv' => 'image/vnd.djvu',
- 'djvu' => 'image/vnd.djvu',
- 'dll' => 'application/octet-stream',
- 'dmg' => 'application/x-apple-diskimage',
- 'dmn' => 'application/octet-stream',
- 'dmp' => 'application/vnd.tcpdump.pcap',
- 'dms' => 'application/octet-stream',
- 'dna' => 'application/vnd.dna',
- 'doc' => 'application/msword',
- 'docm' => 'application/vnd.ms-word.template.macroEnabled.12',
- 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
- 'dot' => 'application/msword',
- 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
- 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
- 'dp' => 'application/vnd.osgi.dp',
- 'dpg' => 'application/vnd.dpgraph',
- 'dra' => 'audio/vnd.dra',
- 'drle' => 'image/dicom-rle',
- 'dsc' => 'text/prs.lines.tag',
- 'dssc' => 'application/dssc+der',
- 'dtb' => 'application/x-dtbook+xml',
- 'dtd' => 'application/xml-dtd',
- 'dts' => 'audio/vnd.dts',
- 'dtshd' => 'audio/vnd.dts.hd',
- 'dump' => 'application/octet-stream',
- 'dvb' => 'video/vnd.dvb.file',
- 'dvi' => 'application/x-dvi',
- 'dwd' => 'application/atsc-dwd+xml',
- 'dwf' => 'model/vnd.dwf',
- 'dwg' => 'image/vnd.dwg',
- 'dxf' => 'image/vnd.dxf',
- 'dxp' => 'application/vnd.spotfire.dxp',
- 'dxr' => 'application/x-director',
- 'ear' => 'application/java-archive',
- 'ecelp4800' => 'audio/vnd.nuera.ecelp4800',
- 'ecelp7470' => 'audio/vnd.nuera.ecelp7470',
- 'ecelp9600' => 'audio/vnd.nuera.ecelp9600',
- 'ecma' => 'application/ecmascript',
- 'edm' => 'application/vnd.novadigm.edm',
- 'edx' => 'application/vnd.novadigm.edx',
- 'efif' => 'application/vnd.picsel',
- 'ei6' => 'application/vnd.pg.osasli',
- 'elc' => 'application/octet-stream',
- 'emf' => 'image/emf',
- 'eml' => 'message/rfc822',
- 'emma' => 'application/emma+xml',
- 'emotionml' => 'application/emotionml+xml',
- 'emz' => 'application/x-msmetafile',
- 'eol' => 'audio/vnd.digital-winds',
- 'eot' => 'application/vnd.ms-fontobject',
- 'eps' => 'application/postscript',
- 'epub' => 'application/epub+zip',
- 'es' => 'application/ecmascript',
- 'es3' => 'application/vnd.eszigno3+xml',
- 'esa' => 'application/vnd.osgi.subsystem',
- 'esf' => 'application/vnd.epson.esf',
- 'et3' => 'application/vnd.eszigno3+xml',
- 'etx' => 'text/x-setext',
- 'eva' => 'application/x-eva',
- 'evy' => 'application/x-envoy',
- 'exe' => 'application/octet-stream',
- 'exi' => 'application/exi',
- 'exp' => 'application/express',
- 'exr' => 'image/aces',
- 'ext' => 'application/vnd.novadigm.ext',
- 'ez' => 'application/andrew-inset',
- 'ez2' => 'application/vnd.ezpix-album',
- 'ez3' => 'application/vnd.ezpix-package',
- 'f' => 'text/x-fortran',
- 'f4v' => 'video/mp4',
- 'f77' => 'text/x-fortran',
- 'f90' => 'text/x-fortran',
- 'fbs' => 'image/vnd.fastbidsheet',
- 'fcdt' => 'application/vnd.adobe.formscentral.fcdt',
- 'fcs' => 'application/vnd.isac.fcs',
- 'fdf' => 'application/vnd.fdf',
- 'fdt' => 'application/fdt+xml',
- 'fe_launch' => 'application/vnd.denovo.fcselayout-link',
- 'fg5' => 'application/vnd.fujitsu.oasysgp',
- 'fgd' => 'application/x-director',
- 'fh' => 'image/x-freehand',
- 'fh4' => 'image/x-freehand',
- 'fh5' => 'image/x-freehand',
- 'fh7' => 'image/x-freehand',
- 'fhc' => 'image/x-freehand',
- 'fig' => 'application/x-xfig',
- 'fits' => 'image/fits',
- 'flac' => 'audio/x-flac',
- 'fli' => 'video/x-fli',
- 'flo' => 'application/vnd.micrografx.flo',
- 'flv' => 'video/x-flv',
- 'flw' => 'application/vnd.kde.kivio',
- 'flx' => 'text/vnd.fmi.flexstor',
- 'fly' => 'text/vnd.fly',
- 'fm' => 'application/vnd.framemaker',
- 'fnc' => 'application/vnd.frogans.fnc',
- 'fo' => 'application/vnd.software602.filler.form+xml',
- 'for' => 'text/x-fortran',
- 'fpx' => 'image/vnd.fpx',
- 'frame' => 'application/vnd.framemaker',
- 'fsc' => 'application/vnd.fsc.weblaunch',
- 'fst' => 'image/vnd.fst',
- 'ftc' => 'application/vnd.fluxtime.clip',
- 'fti' => 'application/vnd.anser-web-funds-transfer-initiation',
- 'fvt' => 'video/vnd.fvt',
- 'fxp' => 'application/vnd.adobe.fxp',
- 'fxpl' => 'application/vnd.adobe.fxp',
- 'fzs' => 'application/vnd.fuzzysheet',
- 'g2w' => 'application/vnd.geoplan',
- 'g3' => 'image/g3fax',
- 'g3w' => 'application/vnd.geospace',
- 'gac' => 'application/vnd.groove-account',
- 'gam' => 'application/x-tads',
- 'gbr' => 'application/rpki-ghostbusters',
- 'gca' => 'application/x-gca-compressed',
- 'gdl' => 'model/vnd.gdl',
- 'gdoc' => 'application/vnd.google-apps.document',
- 'ged' => 'text/vnd.familysearch.gedcom',
- 'geo' => 'application/vnd.dynageo',
- 'geojson' => 'application/geo+json',
- 'gex' => 'application/vnd.geometry-explorer',
- 'ggb' => 'application/vnd.geogebra.file',
- 'ggt' => 'application/vnd.geogebra.tool',
- 'ghf' => 'application/vnd.groove-help',
- 'gif' => 'image/gif',
- 'gim' => 'application/vnd.groove-identity-message',
- 'glb' => 'model/gltf-binary',
- 'gltf' => 'model/gltf+json',
- 'gml' => 'application/gml+xml',
- 'gmx' => 'application/vnd.gmx',
- 'gnumeric' => 'application/x-gnumeric',
- 'gpg' => 'application/gpg-keys',
- 'gph' => 'application/vnd.flographit',
- 'gpx' => 'application/gpx+xml',
- 'gqf' => 'application/vnd.grafeq',
- 'gqs' => 'application/vnd.grafeq',
- 'gram' => 'application/srgs',
- 'gramps' => 'application/x-gramps-xml',
- 'gre' => 'application/vnd.geometry-explorer',
- 'grv' => 'application/vnd.groove-injector',
- 'grxml' => 'application/srgs+xml',
- 'gsf' => 'application/x-font-ghostscript',
- 'gsheet' => 'application/vnd.google-apps.spreadsheet',
- 'gslides' => 'application/vnd.google-apps.presentation',
- 'gtar' => 'application/x-gtar',
- 'gtm' => 'application/vnd.groove-tool-message',
- 'gtw' => 'model/vnd.gtw',
- 'gv' => 'text/vnd.graphviz',
- 'gxf' => 'application/gxf',
- 'gxt' => 'application/vnd.geonext',
- 'gz' => 'application/gzip',
- 'gzip' => 'application/gzip',
- 'h' => 'text/x-c',
- 'h261' => 'video/h261',
- 'h263' => 'video/h263',
- 'h264' => 'video/h264',
- 'hal' => 'application/vnd.hal+xml',
- 'hbci' => 'application/vnd.hbci',
- 'hbs' => 'text/x-handlebars-template',
- 'hdd' => 'application/x-virtualbox-hdd',
- 'hdf' => 'application/x-hdf',
- 'heic' => 'image/heic',
- 'heics' => 'image/heic-sequence',
- 'heif' => 'image/heif',
- 'heifs' => 'image/heif-sequence',
- 'hej2' => 'image/hej2k',
- 'held' => 'application/atsc-held+xml',
- 'hh' => 'text/x-c',
- 'hjson' => 'application/hjson',
- 'hlp' => 'application/winhlp',
- 'hpgl' => 'application/vnd.hp-hpgl',
- 'hpid' => 'application/vnd.hp-hpid',
- 'hps' => 'application/vnd.hp-hps',
- 'hqx' => 'application/mac-binhex40',
- 'hsj2' => 'image/hsj2',
- 'htc' => 'text/x-component',
- 'htke' => 'application/vnd.kenameaapp',
- 'htm' => 'text/html',
- 'html' => 'text/html',
- 'hvd' => 'application/vnd.yamaha.hv-dic',
- 'hvp' => 'application/vnd.yamaha.hv-voice',
- 'hvs' => 'application/vnd.yamaha.hv-script',
- 'i2g' => 'application/vnd.intergeo',
- 'icc' => 'application/vnd.iccprofile',
- 'ice' => 'x-conference/x-cooltalk',
- 'icm' => 'application/vnd.iccprofile',
- 'ico' => 'image/x-icon',
- 'ics' => 'text/calendar',
- 'ief' => 'image/ief',
- 'ifb' => 'text/calendar',
- 'ifm' => 'application/vnd.shana.informed.formdata',
- 'iges' => 'model/iges',
- 'igl' => 'application/vnd.igloader',
- 'igm' => 'application/vnd.insors.igm',
- 'igs' => 'model/iges',
- 'igx' => 'application/vnd.micrografx.igx',
- 'iif' => 'application/vnd.shana.informed.interchange',
- 'img' => 'application/octet-stream',
- 'imp' => 'application/vnd.accpac.simply.imp',
- 'ims' => 'application/vnd.ms-ims',
- 'in' => 'text/plain',
- 'ini' => 'text/plain',
- 'ink' => 'application/inkml+xml',
- 'inkml' => 'application/inkml+xml',
- 'install' => 'application/x-install-instructions',
- 'iota' => 'application/vnd.astraea-software.iota',
- 'ipfix' => 'application/ipfix',
- 'ipk' => 'application/vnd.shana.informed.package',
- 'irm' => 'application/vnd.ibm.rights-management',
- 'irp' => 'application/vnd.irepository.package+xml',
- 'iso' => 'application/x-iso9660-image',
- 'itp' => 'application/vnd.shana.informed.formtemplate',
- 'its' => 'application/its+xml',
- 'ivp' => 'application/vnd.immervision-ivp',
- 'ivu' => 'application/vnd.immervision-ivu',
- 'jad' => 'text/vnd.sun.j2me.app-descriptor',
- 'jade' => 'text/jade',
- 'jam' => 'application/vnd.jam',
- 'jar' => 'application/java-archive',
- 'jardiff' => 'application/x-java-archive-diff',
- 'java' => 'text/x-java-source',
- 'jhc' => 'image/jphc',
- 'jisp' => 'application/vnd.jisp',
- 'jls' => 'image/jls',
- 'jlt' => 'application/vnd.hp-jlyt',
- 'jng' => 'image/x-jng',
- 'jnlp' => 'application/x-java-jnlp-file',
- 'joda' => 'application/vnd.joost.joda-archive',
- 'jp2' => 'image/jp2',
- 'jpe' => 'image/jpeg',
- 'jpeg' => 'image/jpeg',
- 'jpf' => 'image/jpx',
- 'jpg' => 'image/jpeg',
- 'jpg2' => 'image/jp2',
- 'jpgm' => 'video/jpm',
- 'jpgv' => 'video/jpeg',
- 'jph' => 'image/jph',
- 'jpm' => 'video/jpm',
- 'jpx' => 'image/jpx',
- 'js' => 'application/javascript',
- 'json' => 'application/json',
- 'json5' => 'application/json5',
- 'jsonld' => 'application/ld+json',
- 'jsonml' => 'application/jsonml+json',
- 'jsx' => 'text/jsx',
- 'jxr' => 'image/jxr',
- 'jxra' => 'image/jxra',
- 'jxrs' => 'image/jxrs',
- 'jxs' => 'image/jxs',
- 'jxsc' => 'image/jxsc',
- 'jxsi' => 'image/jxsi',
- 'jxss' => 'image/jxss',
- 'kar' => 'audio/midi',
- 'karbon' => 'application/vnd.kde.karbon',
- 'kdb' => 'application/octet-stream',
- 'kdbx' => 'application/x-keepass2',
- 'key' => 'application/x-iwork-keynote-sffkey',
- 'kfo' => 'application/vnd.kde.kformula',
- 'kia' => 'application/vnd.kidspiration',
- 'kml' => 'application/vnd.google-earth.kml+xml',
- 'kmz' => 'application/vnd.google-earth.kmz',
- 'kne' => 'application/vnd.kinar',
- 'knp' => 'application/vnd.kinar',
- 'kon' => 'application/vnd.kde.kontour',
- 'kpr' => 'application/vnd.kde.kpresenter',
- 'kpt' => 'application/vnd.kde.kpresenter',
- 'kpxx' => 'application/vnd.ds-keypoint',
- 'ksp' => 'application/vnd.kde.kspread',
- 'ktr' => 'application/vnd.kahootz',
- 'ktx' => 'image/ktx',
- 'ktx2' => 'image/ktx2',
- 'ktz' => 'application/vnd.kahootz',
- 'kwd' => 'application/vnd.kde.kword',
- 'kwt' => 'application/vnd.kde.kword',
- 'lasxml' => 'application/vnd.las.las+xml',
- 'latex' => 'application/x-latex',
- 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop',
- 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml',
- 'les' => 'application/vnd.hhe.lesson-player',
- 'less' => 'text/less',
- 'lgr' => 'application/lgr+xml',
- 'lha' => 'application/octet-stream',
- 'link66' => 'application/vnd.route66.link66+xml',
- 'list' => 'text/plain',
- 'list3820' => 'application/vnd.ibm.modcap',
- 'listafp' => 'application/vnd.ibm.modcap',
- 'litcoffee' => 'text/coffeescript',
- 'lnk' => 'application/x-ms-shortcut',
- 'log' => 'text/plain',
- 'lostxml' => 'application/lost+xml',
- 'lrf' => 'application/octet-stream',
- 'lrm' => 'application/vnd.ms-lrm',
- 'ltf' => 'application/vnd.frogans.ltf',
- 'lua' => 'text/x-lua',
- 'luac' => 'application/x-lua-bytecode',
- 'lvp' => 'audio/vnd.lucent.voice',
- 'lwp' => 'application/vnd.lotus-wordpro',
- 'lzh' => 'application/octet-stream',
- 'm1v' => 'video/mpeg',
- 'm2a' => 'audio/mpeg',
- 'm2v' => 'video/mpeg',
- 'm3a' => 'audio/mpeg',
- 'm3u' => 'text/plain',
- 'm3u8' => 'application/vnd.apple.mpegurl',
- 'm4a' => 'audio/x-m4a',
- 'm4p' => 'application/mp4',
- 'm4s' => 'video/iso.segment',
- 'm4u' => 'application/vnd.mpegurl',
- 'm4v' => 'video/x-m4v',
- 'm13' => 'application/x-msmediaview',
- 'm14' => 'application/x-msmediaview',
- 'm21' => 'application/mp21',
- 'ma' => 'application/mathematica',
- 'mads' => 'application/mads+xml',
- 'maei' => 'application/mmt-aei+xml',
- 'mag' => 'application/vnd.ecowin.chart',
- 'maker' => 'application/vnd.framemaker',
- 'man' => 'text/troff',
- 'manifest' => 'text/cache-manifest',
- 'map' => 'application/json',
- 'mar' => 'application/octet-stream',
- 'markdown' => 'text/markdown',
- 'mathml' => 'application/mathml+xml',
- 'mb' => 'application/mathematica',
- 'mbk' => 'application/vnd.mobius.mbk',
- 'mbox' => 'application/mbox',
- 'mc1' => 'application/vnd.medcalcdata',
- 'mcd' => 'application/vnd.mcd',
- 'mcurl' => 'text/vnd.curl.mcurl',
- 'md' => 'text/markdown',
- 'mdb' => 'application/x-msaccess',
- 'mdi' => 'image/vnd.ms-modi',
- 'mdx' => 'text/mdx',
- 'me' => 'text/troff',
- 'mesh' => 'model/mesh',
- 'meta4' => 'application/metalink4+xml',
- 'metalink' => 'application/metalink+xml',
- 'mets' => 'application/mets+xml',
- 'mfm' => 'application/vnd.mfmp',
- 'mft' => 'application/rpki-manifest',
- 'mgp' => 'application/vnd.osgeo.mapguide.package',
- 'mgz' => 'application/vnd.proteus.magazine',
- 'mid' => 'audio/midi',
- 'midi' => 'audio/midi',
- 'mie' => 'application/x-mie',
- 'mif' => 'application/vnd.mif',
- 'mime' => 'message/rfc822',
- 'mj2' => 'video/mj2',
- 'mjp2' => 'video/mj2',
- 'mjs' => 'application/javascript',
- 'mk3d' => 'video/x-matroska',
- 'mka' => 'audio/x-matroska',
- 'mkd' => 'text/x-markdown',
- 'mks' => 'video/x-matroska',
- 'mkv' => 'video/x-matroska',
- 'mlp' => 'application/vnd.dolby.mlp',
- 'mmd' => 'application/vnd.chipnuts.karaoke-mmd',
- 'mmf' => 'application/vnd.smaf',
- 'mml' => 'text/mathml',
- 'mmr' => 'image/vnd.fujixerox.edmics-mmr',
- 'mng' => 'video/x-mng',
- 'mny' => 'application/x-msmoney',
- 'mobi' => 'application/x-mobipocket-ebook',
- 'mods' => 'application/mods+xml',
- 'mov' => 'video/quicktime',
- 'movie' => 'video/x-sgi-movie',
- 'mp2' => 'audio/mpeg',
- 'mp2a' => 'audio/mpeg',
- 'mp3' => 'audio/mpeg',
- 'mp4' => 'video/mp4',
- 'mp4a' => 'audio/mp4',
- 'mp4s' => 'application/mp4',
- 'mp4v' => 'video/mp4',
- 'mp21' => 'application/mp21',
- 'mpc' => 'application/vnd.mophun.certificate',
- 'mpd' => 'application/dash+xml',
- 'mpe' => 'video/mpeg',
- 'mpeg' => 'video/mpeg',
- 'mpf' => 'application/media-policy-dataset+xml',
- 'mpg' => 'video/mpeg',
- 'mpg4' => 'video/mp4',
- 'mpga' => 'audio/mpeg',
- 'mpkg' => 'application/vnd.apple.installer+xml',
- 'mpm' => 'application/vnd.blueice.multipass',
- 'mpn' => 'application/vnd.mophun.application',
- 'mpp' => 'application/vnd.ms-project',
- 'mpt' => 'application/vnd.ms-project',
- 'mpy' => 'application/vnd.ibm.minipay',
- 'mqy' => 'application/vnd.mobius.mqy',
- 'mrc' => 'application/marc',
- 'mrcx' => 'application/marcxml+xml',
- 'ms' => 'text/troff',
- 'mscml' => 'application/mediaservercontrol+xml',
- 'mseed' => 'application/vnd.fdsn.mseed',
- 'mseq' => 'application/vnd.mseq',
- 'msf' => 'application/vnd.epson.msf',
- 'msg' => 'application/vnd.ms-outlook',
- 'msh' => 'model/mesh',
- 'msi' => 'application/x-msdownload',
- 'msl' => 'application/vnd.mobius.msl',
- 'msm' => 'application/octet-stream',
- 'msp' => 'application/octet-stream',
- 'msty' => 'application/vnd.muvee.style',
- 'mtl' => 'model/mtl',
- 'mts' => 'model/vnd.mts',
- 'mus' => 'application/vnd.musician',
- 'musd' => 'application/mmt-usd+xml',
- 'musicxml' => 'application/vnd.recordare.musicxml+xml',
- 'mvb' => 'application/x-msmediaview',
- 'mvt' => 'application/vnd.mapbox-vector-tile',
- 'mwf' => 'application/vnd.mfer',
- 'mxf' => 'application/mxf',
- 'mxl' => 'application/vnd.recordare.musicxml',
- 'mxmf' => 'audio/mobile-xmf',
- 'mxml' => 'application/xv+xml',
- 'mxs' => 'application/vnd.triscape.mxs',
- 'mxu' => 'video/vnd.mpegurl',
- 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install',
- 'n3' => 'text/n3',
- 'nb' => 'application/mathematica',
- 'nbp' => 'application/vnd.wolfram.player',
- 'nc' => 'application/x-netcdf',
- 'ncx' => 'application/x-dtbncx+xml',
- 'nfo' => 'text/x-nfo',
- 'ngdat' => 'application/vnd.nokia.n-gage.data',
- 'nitf' => 'application/vnd.nitf',
- 'nlu' => 'application/vnd.neurolanguage.nlu',
- 'nml' => 'application/vnd.enliven',
- 'nnd' => 'application/vnd.noblenet-directory',
- 'nns' => 'application/vnd.noblenet-sealer',
- 'nnw' => 'application/vnd.noblenet-web',
- 'npx' => 'image/vnd.net-fpx',
- 'nq' => 'application/n-quads',
- 'nsc' => 'application/x-conference',
- 'nsf' => 'application/vnd.lotus-notes',
- 'nt' => 'application/n-triples',
- 'ntf' => 'application/vnd.nitf',
- 'numbers' => 'application/x-iwork-numbers-sffnumbers',
- 'nzb' => 'application/x-nzb',
- 'oa2' => 'application/vnd.fujitsu.oasys2',
- 'oa3' => 'application/vnd.fujitsu.oasys3',
- 'oas' => 'application/vnd.fujitsu.oasys',
- 'obd' => 'application/x-msbinder',
- 'obgx' => 'application/vnd.openblox.game+xml',
- 'obj' => 'model/obj',
- 'oda' => 'application/oda',
- 'odb' => 'application/vnd.oasis.opendocument.database',
- 'odc' => 'application/vnd.oasis.opendocument.chart',
- 'odf' => 'application/vnd.oasis.opendocument.formula',
- 'odft' => 'application/vnd.oasis.opendocument.formula-template',
- 'odg' => 'application/vnd.oasis.opendocument.graphics',
- 'odi' => 'application/vnd.oasis.opendocument.image',
- 'odm' => 'application/vnd.oasis.opendocument.text-master',
- 'odp' => 'application/vnd.oasis.opendocument.presentation',
- 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
- 'odt' => 'application/vnd.oasis.opendocument.text',
- 'oga' => 'audio/ogg',
- 'ogex' => 'model/vnd.opengex',
- 'ogg' => 'audio/ogg',
- 'ogv' => 'video/ogg',
- 'ogx' => 'application/ogg',
- 'omdoc' => 'application/omdoc+xml',
- 'onepkg' => 'application/onenote',
- 'onetmp' => 'application/onenote',
- 'onetoc' => 'application/onenote',
- 'onetoc2' => 'application/onenote',
- 'opf' => 'application/oebps-package+xml',
- 'opml' => 'text/x-opml',
- 'oprc' => 'application/vnd.palm',
- 'opus' => 'audio/ogg',
- 'org' => 'text/x-org',
- 'osf' => 'application/vnd.yamaha.openscoreformat',
- 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml',
- 'osm' => 'application/vnd.openstreetmap.data+xml',
- 'otc' => 'application/vnd.oasis.opendocument.chart-template',
- 'otf' => 'font/otf',
- 'otg' => 'application/vnd.oasis.opendocument.graphics-template',
- 'oth' => 'application/vnd.oasis.opendocument.text-web',
- 'oti' => 'application/vnd.oasis.opendocument.image-template',
- 'otp' => 'application/vnd.oasis.opendocument.presentation-template',
- 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
- 'ott' => 'application/vnd.oasis.opendocument.text-template',
- 'ova' => 'application/x-virtualbox-ova',
- 'ovf' => 'application/x-virtualbox-ovf',
- 'owl' => 'application/rdf+xml',
- 'oxps' => 'application/oxps',
- 'oxt' => 'application/vnd.openofficeorg.extension',
- 'p' => 'text/x-pascal',
- 'p7a' => 'application/x-pkcs7-signature',
- 'p7b' => 'application/x-pkcs7-certificates',
- 'p7c' => 'application/pkcs7-mime',
- 'p7m' => 'application/pkcs7-mime',
- 'p7r' => 'application/x-pkcs7-certreqresp',
- 'p7s' => 'application/pkcs7-signature',
- 'p8' => 'application/pkcs8',
- 'p10' => 'application/x-pkcs10',
- 'p12' => 'application/x-pkcs12',
- 'pac' => 'application/x-ns-proxy-autoconfig',
- 'pages' => 'application/x-iwork-pages-sffpages',
- 'pas' => 'text/x-pascal',
- 'paw' => 'application/vnd.pawaafile',
- 'pbd' => 'application/vnd.powerbuilder6',
- 'pbm' => 'image/x-portable-bitmap',
- 'pcap' => 'application/vnd.tcpdump.pcap',
- 'pcf' => 'application/x-font-pcf',
- 'pcl' => 'application/vnd.hp-pcl',
- 'pclxl' => 'application/vnd.hp-pclxl',
- 'pct' => 'image/x-pict',
- 'pcurl' => 'application/vnd.curl.pcurl',
- 'pcx' => 'image/x-pcx',
- 'pdb' => 'application/x-pilot',
- 'pde' => 'text/x-processing',
- 'pdf' => 'application/pdf',
- 'pem' => 'application/x-x509-user-cert',
- 'pfa' => 'application/x-font-type1',
- 'pfb' => 'application/x-font-type1',
- 'pfm' => 'application/x-font-type1',
- 'pfr' => 'application/font-tdpfr',
- 'pfx' => 'application/x-pkcs12',
- 'pgm' => 'image/x-portable-graymap',
- 'pgn' => 'application/x-chess-pgn',
- 'pgp' => 'application/pgp',
- 'phar' => 'application/octet-stream',
- 'php' => 'application/x-httpd-php',
- 'php3' => 'application/x-httpd-php',
- 'php4' => 'application/x-httpd-php',
- 'phps' => 'application/x-httpd-php-source',
- 'phtml' => 'application/x-httpd-php',
- 'pic' => 'image/x-pict',
- 'pkg' => 'application/octet-stream',
- 'pki' => 'application/pkixcmp',
- 'pkipath' => 'application/pkix-pkipath',
- 'pkpass' => 'application/vnd.apple.pkpass',
- 'pl' => 'application/x-perl',
- 'plb' => 'application/vnd.3gpp.pic-bw-large',
- 'plc' => 'application/vnd.mobius.plc',
- 'plf' => 'application/vnd.pocketlearn',
- 'pls' => 'application/pls+xml',
- 'pm' => 'application/x-perl',
- 'pml' => 'application/vnd.ctc-posml',
- 'png' => 'image/png',
- 'pnm' => 'image/x-portable-anymap',
- 'portpkg' => 'application/vnd.macports.portpkg',
- 'pot' => 'application/vnd.ms-powerpoint',
- 'potm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
- 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
- 'ppa' => 'application/vnd.ms-powerpoint',
- 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
- 'ppd' => 'application/vnd.cups-ppd',
- 'ppm' => 'image/x-portable-pixmap',
- 'pps' => 'application/vnd.ms-powerpoint',
- 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
- 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
- 'ppt' => 'application/powerpoint',
- 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
- 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
- 'pqa' => 'application/vnd.palm',
- 'prc' => 'model/prc',
- 'pre' => 'application/vnd.lotus-freelance',
- 'prf' => 'application/pics-rules',
- 'provx' => 'application/provenance+xml',
- 'ps' => 'application/postscript',
- 'psb' => 'application/vnd.3gpp.pic-bw-small',
- 'psd' => 'application/x-photoshop',
- 'psf' => 'application/x-font-linux-psf',
- 'pskcxml' => 'application/pskc+xml',
- 'pti' => 'image/prs.pti',
- 'ptid' => 'application/vnd.pvi.ptid1',
- 'pub' => 'application/x-mspublisher',
- 'pvb' => 'application/vnd.3gpp.pic-bw-var',
- 'pwn' => 'application/vnd.3m.post-it-notes',
- 'pya' => 'audio/vnd.ms-playready.media.pya',
- 'pyv' => 'video/vnd.ms-playready.media.pyv',
- 'qam' => 'application/vnd.epson.quickanime',
- 'qbo' => 'application/vnd.intu.qbo',
- 'qfx' => 'application/vnd.intu.qfx',
- 'qps' => 'application/vnd.publishare-delta-tree',
- 'qt' => 'video/quicktime',
- 'qwd' => 'application/vnd.quark.quarkxpress',
- 'qwt' => 'application/vnd.quark.quarkxpress',
- 'qxb' => 'application/vnd.quark.quarkxpress',
- 'qxd' => 'application/vnd.quark.quarkxpress',
- 'qxl' => 'application/vnd.quark.quarkxpress',
- 'qxt' => 'application/vnd.quark.quarkxpress',
- 'ra' => 'audio/x-realaudio',
- 'ram' => 'audio/x-pn-realaudio',
- 'raml' => 'application/raml+yaml',
- 'rapd' => 'application/route-apd+xml',
- 'rar' => 'application/x-rar',
- 'ras' => 'image/x-cmu-raster',
- 'rcprofile' => 'application/vnd.ipunplugged.rcprofile',
- 'rdf' => 'application/rdf+xml',
- 'rdz' => 'application/vnd.data-vision.rdz',
- 'relo' => 'application/p2p-overlay+xml',
- 'rep' => 'application/vnd.businessobjects',
- 'res' => 'application/x-dtbresource+xml',
- 'rgb' => 'image/x-rgb',
- 'rif' => 'application/reginfo+xml',
- 'rip' => 'audio/vnd.rip',
- 'ris' => 'application/x-research-info-systems',
- 'rl' => 'application/resource-lists+xml',
- 'rlc' => 'image/vnd.fujixerox.edmics-rlc',
- 'rld' => 'application/resource-lists-diff+xml',
- 'rm' => 'audio/x-pn-realaudio',
- 'rmi' => 'audio/midi',
- 'rmp' => 'audio/x-pn-realaudio-plugin',
- 'rms' => 'application/vnd.jcp.javame.midlet-rms',
- 'rmvb' => 'application/vnd.rn-realmedia-vbr',
- 'rnc' => 'application/relax-ng-compact-syntax',
- 'rng' => 'application/xml',
- 'roa' => 'application/rpki-roa',
- 'roff' => 'text/troff',
- 'rp9' => 'application/vnd.cloanto.rp9',
- 'rpm' => 'audio/x-pn-realaudio-plugin',
- 'rpss' => 'application/vnd.nokia.radio-presets',
- 'rpst' => 'application/vnd.nokia.radio-preset',
- 'rq' => 'application/sparql-query',
- 'rs' => 'application/rls-services+xml',
- 'rsa' => 'application/x-pkcs7',
- 'rsat' => 'application/atsc-rsat+xml',
- 'rsd' => 'application/rsd+xml',
- 'rsheet' => 'application/urc-ressheet+xml',
- 'rss' => 'application/rss+xml',
- 'rtf' => 'text/rtf',
- 'rtx' => 'text/richtext',
- 'run' => 'application/x-makeself',
- 'rusd' => 'application/route-usd+xml',
- 'rv' => 'video/vnd.rn-realvideo',
- 's' => 'text/x-asm',
- 's3m' => 'audio/s3m',
- 'saf' => 'application/vnd.yamaha.smaf-audio',
- 'sass' => 'text/x-sass',
- 'sbml' => 'application/sbml+xml',
- 'sc' => 'application/vnd.ibm.secure-container',
- 'scd' => 'application/x-msschedule',
- 'scm' => 'application/vnd.lotus-screencam',
- 'scq' => 'application/scvp-cv-request',
- 'scs' => 'application/scvp-cv-response',
- 'scss' => 'text/x-scss',
- 'scurl' => 'text/vnd.curl.scurl',
- 'sda' => 'application/vnd.stardivision.draw',
- 'sdc' => 'application/vnd.stardivision.calc',
- 'sdd' => 'application/vnd.stardivision.impress',
- 'sdkd' => 'application/vnd.solent.sdkm+xml',
- 'sdkm' => 'application/vnd.solent.sdkm+xml',
- 'sdp' => 'application/sdp',
- 'sdw' => 'application/vnd.stardivision.writer',
- 'sea' => 'application/octet-stream',
- 'see' => 'application/vnd.seemail',
- 'seed' => 'application/vnd.fdsn.seed',
- 'sema' => 'application/vnd.sema',
- 'semd' => 'application/vnd.semd',
- 'semf' => 'application/vnd.semf',
- 'senmlx' => 'application/senml+xml',
- 'sensmlx' => 'application/sensml+xml',
- 'ser' => 'application/java-serialized-object',
- 'setpay' => 'application/set-payment-initiation',
- 'setreg' => 'application/set-registration-initiation',
- 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data',
- 'sfs' => 'application/vnd.spotfire.sfs',
- 'sfv' => 'text/x-sfv',
- 'sgi' => 'image/sgi',
- 'sgl' => 'application/vnd.stardivision.writer-global',
- 'sgm' => 'text/sgml',
- 'sgml' => 'text/sgml',
- 'sh' => 'application/x-sh',
- 'shar' => 'application/x-shar',
- 'shex' => 'text/shex',
- 'shf' => 'application/shf+xml',
- 'shtml' => 'text/html',
- 'sid' => 'image/x-mrsid-image',
- 'sieve' => 'application/sieve',
- 'sig' => 'application/pgp-signature',
- 'sil' => 'audio/silk',
- 'silo' => 'model/mesh',
- 'sis' => 'application/vnd.symbian.install',
- 'sisx' => 'application/vnd.symbian.install',
- 'sit' => 'application/x-stuffit',
- 'sitx' => 'application/x-stuffitx',
- 'siv' => 'application/sieve',
- 'skd' => 'application/vnd.koan',
- 'skm' => 'application/vnd.koan',
- 'skp' => 'application/vnd.koan',
- 'skt' => 'application/vnd.koan',
- 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12',
- 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
- 'slim' => 'text/slim',
- 'slm' => 'text/slim',
- 'sls' => 'application/route-s-tsid+xml',
- 'slt' => 'application/vnd.epson.salt',
- 'sm' => 'application/vnd.stepmania.stepchart',
- 'smf' => 'application/vnd.stardivision.math',
- 'smi' => 'application/smil',
- 'smil' => 'application/smil',
- 'smv' => 'video/x-smv',
- 'smzip' => 'application/vnd.stepmania.package',
- 'snd' => 'audio/basic',
- 'snf' => 'application/x-font-snf',
- 'so' => 'application/octet-stream',
- 'spc' => 'application/x-pkcs7-certificates',
- 'spdx' => 'text/spdx',
- 'spf' => 'application/vnd.yamaha.smaf-phrase',
- 'spl' => 'application/x-futuresplash',
- 'spot' => 'text/vnd.in3d.spot',
- 'spp' => 'application/scvp-vp-response',
- 'spq' => 'application/scvp-vp-request',
- 'spx' => 'audio/ogg',
- 'sql' => 'application/x-sql',
- 'src' => 'application/x-wais-source',
- 'srt' => 'application/x-subrip',
- 'sru' => 'application/sru+xml',
- 'srx' => 'application/sparql-results+xml',
- 'ssdl' => 'application/ssdl+xml',
- 'sse' => 'application/vnd.kodak-descriptor',
- 'ssf' => 'application/vnd.epson.ssf',
- 'ssml' => 'application/ssml+xml',
- 'sst' => 'application/octet-stream',
- 'st' => 'application/vnd.sailingtracker.track',
- 'stc' => 'application/vnd.sun.xml.calc.template',
- 'std' => 'application/vnd.sun.xml.draw.template',
- 'stf' => 'application/vnd.wt.stf',
- 'sti' => 'application/vnd.sun.xml.impress.template',
- 'stk' => 'application/hyperstudio',
- 'stl' => 'model/stl',
- 'stpx' => 'model/step+xml',
- 'stpxz' => 'model/step-xml+zip',
- 'stpz' => 'model/step+zip',
- 'str' => 'application/vnd.pg.format',
- 'stw' => 'application/vnd.sun.xml.writer.template',
- 'styl' => 'text/stylus',
- 'stylus' => 'text/stylus',
- 'sub' => 'text/vnd.dvb.subtitle',
- 'sus' => 'application/vnd.sus-calendar',
- 'susp' => 'application/vnd.sus-calendar',
- 'sv4cpio' => 'application/x-sv4cpio',
- 'sv4crc' => 'application/x-sv4crc',
- 'svc' => 'application/vnd.dvb.service',
- 'svd' => 'application/vnd.svd',
- 'svg' => 'image/svg+xml',
- 'svgz' => 'image/svg+xml',
- 'swa' => 'application/x-director',
- 'swf' => 'application/x-shockwave-flash',
- 'swi' => 'application/vnd.aristanetworks.swi',
- 'swidtag' => 'application/swid+xml',
- 'sxc' => 'application/vnd.sun.xml.calc',
- 'sxd' => 'application/vnd.sun.xml.draw',
- 'sxg' => 'application/vnd.sun.xml.writer.global',
- 'sxi' => 'application/vnd.sun.xml.impress',
- 'sxm' => 'application/vnd.sun.xml.math',
- 'sxw' => 'application/vnd.sun.xml.writer',
- 't' => 'text/troff',
- 't3' => 'application/x-t3vm-image',
- 't38' => 'image/t38',
- 'taglet' => 'application/vnd.mynfc',
- 'tao' => 'application/vnd.tao.intent-module-archive',
- 'tap' => 'image/vnd.tencent.tap',
- 'tar' => 'application/x-tar',
- 'tcap' => 'application/vnd.3gpp2.tcap',
- 'tcl' => 'application/x-tcl',
- 'td' => 'application/urc-targetdesc+xml',
- 'teacher' => 'application/vnd.smart.teacher',
- 'tei' => 'application/tei+xml',
- 'teicorpus' => 'application/tei+xml',
- 'tex' => 'application/x-tex',
- 'texi' => 'application/x-texinfo',
- 'texinfo' => 'application/x-texinfo',
- 'text' => 'text/plain',
- 'tfi' => 'application/thraud+xml',
- 'tfm' => 'application/x-tex-tfm',
- 'tfx' => 'image/tiff-fx',
- 'tga' => 'image/x-tga',
- 'tgz' => 'application/x-tar',
- 'thmx' => 'application/vnd.ms-officetheme',
- 'tif' => 'image/tiff',
- 'tiff' => 'image/tiff',
- 'tk' => 'application/x-tcl',
- 'tmo' => 'application/vnd.tmobile-livetv',
- 'toml' => 'application/toml',
- 'torrent' => 'application/x-bittorrent',
- 'tpl' => 'application/vnd.groove-tool-template',
- 'tpt' => 'application/vnd.trid.tpt',
- 'tr' => 'text/troff',
- 'tra' => 'application/vnd.trueapp',
- 'trig' => 'application/trig',
- 'trm' => 'application/x-msterminal',
- 'ts' => 'video/mp2t',
- 'tsd' => 'application/timestamped-data',
- 'tsv' => 'text/tab-separated-values',
- 'ttc' => 'font/collection',
- 'ttf' => 'font/ttf',
- 'ttl' => 'text/turtle',
- 'ttml' => 'application/ttml+xml',
- 'twd' => 'application/vnd.simtech-mindmapper',
- 'twds' => 'application/vnd.simtech-mindmapper',
- 'txd' => 'application/vnd.genomatix.tuxedo',
- 'txf' => 'application/vnd.mobius.txf',
- 'txt' => 'text/plain',
- 'u3d' => 'model/u3d',
- 'u8dsn' => 'message/global-delivery-status',
- 'u8hdr' => 'message/global-headers',
- 'u8mdn' => 'message/global-disposition-notification',
- 'u8msg' => 'message/global',
- 'u32' => 'application/x-authorware-bin',
- 'ubj' => 'application/ubjson',
- 'udeb' => 'application/x-debian-package',
- 'ufd' => 'application/vnd.ufdl',
- 'ufdl' => 'application/vnd.ufdl',
- 'ulx' => 'application/x-glulx',
- 'umj' => 'application/vnd.umajin',
- 'unityweb' => 'application/vnd.unity',
- 'uoml' => 'application/vnd.uoml+xml',
- 'uri' => 'text/uri-list',
- 'uris' => 'text/uri-list',
- 'urls' => 'text/uri-list',
- 'usdz' => 'model/vnd.usdz+zip',
- 'ustar' => 'application/x-ustar',
- 'utz' => 'application/vnd.uiq.theme',
- 'uu' => 'text/x-uuencode',
- 'uva' => 'audio/vnd.dece.audio',
- 'uvd' => 'application/vnd.dece.data',
- 'uvf' => 'application/vnd.dece.data',
- 'uvg' => 'image/vnd.dece.graphic',
- 'uvh' => 'video/vnd.dece.hd',
- 'uvi' => 'image/vnd.dece.graphic',
- 'uvm' => 'video/vnd.dece.mobile',
- 'uvp' => 'video/vnd.dece.pd',
- 'uvs' => 'video/vnd.dece.sd',
- 'uvt' => 'application/vnd.dece.ttml+xml',
- 'uvu' => 'video/vnd.uvvu.mp4',
- 'uvv' => 'video/vnd.dece.video',
- 'uvva' => 'audio/vnd.dece.audio',
- 'uvvd' => 'application/vnd.dece.data',
- 'uvvf' => 'application/vnd.dece.data',
- 'uvvg' => 'image/vnd.dece.graphic',
- 'uvvh' => 'video/vnd.dece.hd',
- 'uvvi' => 'image/vnd.dece.graphic',
- 'uvvm' => 'video/vnd.dece.mobile',
- 'uvvp' => 'video/vnd.dece.pd',
- 'uvvs' => 'video/vnd.dece.sd',
- 'uvvt' => 'application/vnd.dece.ttml+xml',
- 'uvvu' => 'video/vnd.uvvu.mp4',
- 'uvvv' => 'video/vnd.dece.video',
- 'uvvx' => 'application/vnd.dece.unspecified',
- 'uvvz' => 'application/vnd.dece.zip',
- 'uvx' => 'application/vnd.dece.unspecified',
- 'uvz' => 'application/vnd.dece.zip',
- 'vbox' => 'application/x-virtualbox-vbox',
- 'vbox-extpack' => 'application/x-virtualbox-vbox-extpack',
- 'vcard' => 'text/vcard',
- 'vcd' => 'application/x-cdlink',
- 'vcf' => 'text/x-vcard',
- 'vcg' => 'application/vnd.groove-vcard',
- 'vcs' => 'text/x-vcalendar',
- 'vcx' => 'application/vnd.vcx',
- 'vdi' => 'application/x-virtualbox-vdi',
- 'vds' => 'model/vnd.sap.vds',
- 'vhd' => 'application/x-virtualbox-vhd',
- 'vis' => 'application/vnd.visionary',
- 'viv' => 'video/vnd.vivo',
- 'vlc' => 'application/videolan',
- 'vmdk' => 'application/x-virtualbox-vmdk',
- 'vob' => 'video/x-ms-vob',
- 'vor' => 'application/vnd.stardivision.writer',
- 'vox' => 'application/x-authorware-bin',
- 'vrml' => 'model/vrml',
- 'vsd' => 'application/vnd.visio',
- 'vsf' => 'application/vnd.vsf',
- 'vss' => 'application/vnd.visio',
- 'vst' => 'application/vnd.visio',
- 'vsw' => 'application/vnd.visio',
- 'vtf' => 'image/vnd.valve.source.texture',
- 'vtt' => 'text/vtt',
- 'vtu' => 'model/vnd.vtu',
- 'vxml' => 'application/voicexml+xml',
- 'w3d' => 'application/x-director',
- 'wad' => 'application/x-doom',
- 'wadl' => 'application/vnd.sun.wadl+xml',
- 'war' => 'application/java-archive',
- 'wasm' => 'application/wasm',
- 'wav' => 'audio/x-wav',
- 'wax' => 'audio/x-ms-wax',
- 'wbmp' => 'image/vnd.wap.wbmp',
- 'wbs' => 'application/vnd.criticaltools.wbs+xml',
- 'wbxml' => 'application/wbxml',
- 'wcm' => 'application/vnd.ms-works',
- 'wdb' => 'application/vnd.ms-works',
- 'wdp' => 'image/vnd.ms-photo',
- 'weba' => 'audio/webm',
- 'webapp' => 'application/x-web-app-manifest+json',
- 'webm' => 'video/webm',
- 'webmanifest' => 'application/manifest+json',
- 'webp' => 'image/webp',
- 'wg' => 'application/vnd.pmi.widget',
- 'wgt' => 'application/widget',
- 'wif' => 'application/watcherinfo+xml',
- 'wks' => 'application/vnd.ms-works',
- 'wm' => 'video/x-ms-wm',
- 'wma' => 'audio/x-ms-wma',
- 'wmd' => 'application/x-ms-wmd',
- 'wmf' => 'image/wmf',
- 'wml' => 'text/vnd.wap.wml',
- 'wmlc' => 'application/wmlc',
- 'wmls' => 'text/vnd.wap.wmlscript',
- 'wmlsc' => 'application/vnd.wap.wmlscriptc',
- 'wmv' => 'video/x-ms-wmv',
- 'wmx' => 'video/x-ms-wmx',
- 'wmz' => 'application/x-msmetafile',
- 'woff' => 'font/woff',
- 'woff2' => 'font/woff2',
- 'word' => 'application/msword',
- 'wpd' => 'application/vnd.wordperfect',
- 'wpl' => 'application/vnd.ms-wpl',
- 'wps' => 'application/vnd.ms-works',
- 'wqd' => 'application/vnd.wqd',
- 'wri' => 'application/x-mswrite',
- 'wrl' => 'model/vrml',
- 'wsc' => 'message/vnd.wfa.wsc',
- 'wsdl' => 'application/wsdl+xml',
- 'wspolicy' => 'application/wspolicy+xml',
- 'wtb' => 'application/vnd.webturbo',
- 'wvx' => 'video/x-ms-wvx',
- 'x3d' => 'model/x3d+xml',
- 'x3db' => 'model/x3d+fastinfoset',
- 'x3dbz' => 'model/x3d+binary',
- 'x3dv' => 'model/x3d-vrml',
- 'x3dvz' => 'model/x3d+vrml',
- 'x3dz' => 'model/x3d+xml',
- 'x32' => 'application/x-authorware-bin',
- 'x_b' => 'model/vnd.parasolid.transmit.binary',
- 'x_t' => 'model/vnd.parasolid.transmit.text',
- 'xaml' => 'application/xaml+xml',
- 'xap' => 'application/x-silverlight-app',
- 'xar' => 'application/vnd.xara',
- 'xav' => 'application/xcap-att+xml',
- 'xbap' => 'application/x-ms-xbap',
- 'xbd' => 'application/vnd.fujixerox.docuworks.binder',
- 'xbm' => 'image/x-xbitmap',
- 'xca' => 'application/xcap-caps+xml',
- 'xcs' => 'application/calendar+xml',
- 'xdf' => 'application/xcap-diff+xml',
- 'xdm' => 'application/vnd.syncml.dm+xml',
- 'xdp' => 'application/vnd.adobe.xdp+xml',
- 'xdssc' => 'application/dssc+xml',
- 'xdw' => 'application/vnd.fujixerox.docuworks',
- 'xel' => 'application/xcap-el+xml',
- 'xenc' => 'application/xenc+xml',
- 'xer' => 'application/patch-ops-error+xml',
- 'xfdf' => 'application/vnd.adobe.xfdf',
- 'xfdl' => 'application/vnd.xfdl',
- 'xht' => 'application/xhtml+xml',
- 'xhtml' => 'application/xhtml+xml',
- 'xhvml' => 'application/xv+xml',
- 'xif' => 'image/vnd.xiff',
- 'xl' => 'application/excel',
- 'xla' => 'application/vnd.ms-excel',
- 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
- 'xlc' => 'application/vnd.ms-excel',
- 'xlf' => 'application/xliff+xml',
- 'xlm' => 'application/vnd.ms-excel',
- 'xls' => 'application/vnd.ms-excel',
- 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
- 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
- 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
- 'xlt' => 'application/vnd.ms-excel',
- 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
- 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
- 'xlw' => 'application/vnd.ms-excel',
- 'xm' => 'audio/xm',
- 'xml' => 'application/xml',
- 'xns' => 'application/xcap-ns+xml',
- 'xo' => 'application/vnd.olpc-sugar',
- 'xop' => 'application/xop+xml',
- 'xpi' => 'application/x-xpinstall',
- 'xpl' => 'application/xproc+xml',
- 'xpm' => 'image/x-xpixmap',
- 'xpr' => 'application/vnd.is-xpr',
- 'xps' => 'application/vnd.ms-xpsdocument',
- 'xpw' => 'application/vnd.intercon.formnet',
- 'xpx' => 'application/vnd.intercon.formnet',
- 'xsd' => 'application/xml',
- 'xsl' => 'application/xml',
- 'xslt' => 'application/xslt+xml',
- 'xsm' => 'application/vnd.syncml+xml',
- 'xspf' => 'application/xspf+xml',
- 'xul' => 'application/vnd.mozilla.xul+xml',
- 'xvm' => 'application/xv+xml',
- 'xvml' => 'application/xv+xml',
- 'xwd' => 'image/x-xwindowdump',
- 'xyz' => 'chemical/x-xyz',
- 'xz' => 'application/x-xz',
- 'yaml' => 'text/yaml',
- 'yang' => 'application/yang',
- 'yin' => 'application/yin+xml',
- 'yml' => 'text/yaml',
- 'ymp' => 'text/x-suse-ymp',
- 'z' => 'application/x-compress',
- 'z1' => 'application/x-zmachine',
- 'z2' => 'application/x-zmachine',
- 'z3' => 'application/x-zmachine',
- 'z4' => 'application/x-zmachine',
- 'z5' => 'application/x-zmachine',
- 'z6' => 'application/x-zmachine',
- 'z7' => 'application/x-zmachine',
- 'z8' => 'application/x-zmachine',
- 'zaz' => 'application/vnd.zzazz.deck+xml',
- 'zip' => 'application/zip',
- 'zir' => 'application/vnd.zul',
- 'zirz' => 'application/vnd.zul',
- 'zmm' => 'application/vnd.handheld-entertainment+xml',
- 'zsh' => 'text/x-scriptzsh',
- ];
-
- public function lookupMimeType(string $extension): ?string
- {
- return self::MIME_TYPES_FOR_EXTENSIONS[$extension] ?? null;
- }
-}
diff --git a/vendor/league/mime-type-detection/src/MimeTypeDetector.php b/vendor/league/mime-type-detection/src/MimeTypeDetector.php
deleted file mode 100644
index 5d799d2..0000000
--- a/vendor/league/mime-type-detection/src/MimeTypeDetector.php
+++ /dev/null
@@ -1,19 +0,0 @@
- $overrides
- */
- public function __construct(ExtensionToMimeTypeMap $innerMap, array $overrides)
- {
- $this->innerMap = $innerMap;
- $this->overrides = $overrides;
- }
-
- public function lookupMimeType(string $extension): ?string
- {
- return $this->overrides[$extension] ?? $this->innerMap->lookupMimeType($extension);
- }
-}
diff --git a/vendor/liliuwei/thinkphp-social/.gitignore b/vendor/liliuwei/thinkphp-social/.gitignore
deleted file mode 100644
index e69de29..0000000
diff --git a/vendor/liliuwei/thinkphp-social/LICENSE b/vendor/liliuwei/thinkphp-social/LICENSE
deleted file mode 100644
index 8dada3e..0000000
--- a/vendor/liliuwei/thinkphp-social/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/vendor/liliuwei/thinkphp-social/README.md b/vendor/liliuwei/thinkphp-social/README.md
deleted file mode 100644
index 304f0bc..0000000
--- a/vendor/liliuwei/thinkphp-social/README.md
+++ /dev/null
@@ -1,99 +0,0 @@
-## thinkphp-social
-适用于thinkphp5.1 thinkphp6.0的社会化登录扩展
-
-目前已支持:QQ、微信、新浪、百度、Gitee、Github、Oschina、Google、Facebook、淘宝、抖音、小米、钉钉
-
-欢迎提交pr或者建议!
-
-有问题可以联系邮箱:974829947@qq.com
-
-## 安装(扩展包)
-```php
-composer require liliuwei/thinkphp-social
-```
-
-# 配置Config信息
-```php
-// 安装之后会在config目录里自动生成social.php配置文件
- [
- 'app_key' => '*******', //应用注册成功后分配的 APP ID
- 'app_secret' => '*******', //应用注册成功后分配的KEY
- 'callback' => 'http://www.youquanya.com/oauth/callback/type/qq', // 应用回调地址
- ],
- //微信扫码登录配置
- 'weixin' => [
- 'app_key' => '*******', //应用注册成功后分配的 APP ID
- 'app_secret' => '*******', //应用注册成功后分配的KEY
- 'callback' => 'http://www.youquanya.com/oauth/callback/type/weixin', // 应用回调地址
- ],
-];
-
-```
-
-## 用法示例
-````
-QQ登录
-新浪微博登录
-微信登录
-百度登录
-gitee登录
-github登录
-oschaina登录
-google登录
-facebook登录
-淘宝登录
-抖音登录
-小米登录
-钉钉登录
- ````
-```php
-//设置路由
-Route::get('oauth/callback','index/oauth/callback');
-```
-
-```php
-error('参数错误');
- }
- // 获取对象实例
- $sns = \liliuwei\social\Oauth::getInstance($type);
- //跳转到授权页面
- $this->redirect($sns->getRequestCodeURL());
- }
-
- //授权回调地址
- public function callback($type = null, $code = null)
- {
- if ($type == null || $code == null) {
- $this->error('参数错误');
- }
- $sns = \liliuwei\social\Oauth::getInstance($type);
- // 获取TOKEN
- $token = $sns->getAccessToken($code);
- //获取当前第三方登录用户信息
- if (is_array($token)) {
- $user_info = \liliuwei\social\GetInfo::getInstance($type, $token);
- dump($user_info);// 获取第三方用户资料
- $sns->openid();//统一使用$sns->openid()获取openid
- //$sns->unionid();//QQ和微信、淘宝可以获取unionid
- dump($sns->openid());
- echo '登录成功!!';
- echo '正在持续开发中,敬请期待!!';
- } else {
- echo "获取第三方用户的基本信息失败";
- }
- }
-}
-```
diff --git a/vendor/liliuwei/thinkphp-social/composer.json b/vendor/liliuwei/thinkphp-social/composer.json
deleted file mode 100644
index b9673f3..0000000
--- a/vendor/liliuwei/thinkphp-social/composer.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "liliuwei/thinkphp-social",
- "description": "适用于thinkphp5.1和6.0的社会化登录扩展",
- "keywords": ["第三方授权登录","QQ登录","微信登录","新浪登录","百度登录","谷歌登录","Google登录","Facebook登录","Gitee登录","Github登录","Oschina登录","淘宝登录","抖音登录","小米登录","钉钉登录","think-social","thinkphp-social","oauth", "thinkphp","thinkphp5.1","thinkphp6.0"],
- "license": "Apache-2.0",
- "type": "think-extend",
- "require": {
- "php": ">=5.6.0",
- "topthink/think-installer": "^2.0",
- "topthink/framework": "^5.1 || ^6.0"
- },
- "authors": [
- {
- "name": "liliuwei",
- "email": "974829947@qq.com"
- }
- ],
- "autoload" : {
- "psr-4" : {
- "liliuwei\\social\\" : "src/"
- }
- },
- "extra": {
- "think-config": {
- "social": "src/config/config.php"
- },
- "think": {
- "config": {
- "social": "src/config/config.php"
- }
- }
- }
-}
diff --git a/vendor/liliuwei/thinkphp-social/src/GetInfo.php b/vendor/liliuwei/thinkphp-social/src/GetInfo.php
deleted file mode 100644
index 46823c1..0000000
--- a/vendor/liliuwei/thinkphp-social/src/GetInfo.php
+++ /dev/null
@@ -1,280 +0,0 @@
-call('user/get_user_info');
- if ($data['ret'] == 0) {
- $userInfo['type'] = 'qq';
- $userInfo['name'] = $data['nickname'];
- $userInfo['nickname'] = $data['nickname'];
- $userInfo['avatar'] = $data['figureurl_2'];
- $userInfo['gender'] = $data['gender'];
- return $userInfo;
- } else {
- throw new \Exception("获取腾讯QQ用户信息失败:{$data['msg']}");
- }
- }
-
- //微信用户信息
- public static function weixin($token)
- {
- $weixin = Oauth::getInstance('weixin', $token);
- $data = $weixin->call('sns/userinfo');
- if (isset($data['errcode'])) {
- throw new \Exception("获取微信用户信息失败:errcode:{$data['errcode']} errmsg: {$data['errmsg']}");
- }
- if ($data['openid']) {
- $userInfo['type'] = 'weixin';
- $userInfo['name'] = $data['nickname'];
- $userInfo['nickname'] = $data['nickname'];
- $userInfo['avatar'] = $data['headimgurl'];
- $userInfo['openid'] = $data['openid'];
- $userInfo['unionid'] = $data['unionid'];
- $userInfo['province'] = $data['province'];
- $userInfo['city'] = $data['city'];
- $userInfo['country'] = $data['country'];
- $userInfo['sex'] = $data['sex']==1?'男':'女';
- return $userInfo;
- } else {
- throw new \Exception("获取微信用户信息失败");
- }
- }
-
- //新浪微博用户信息
- public static function sina($token)
- {
- $sina = Oauth::getInstance('sina', $token);
- $data = $sina->call('users/show',"uid={$sina->openid()}");
- if ($data['id']) {
- $userInfo['type'] = 'sina';
- $userInfo['name'] = $data['name'];
- $userInfo['nickname'] = $data['screen_name'];
- $userInfo['avatar'] = $data['avatar_large'];
- $userInfo['openid'] = $data['id'];
- $userInfo['idstr'] = $data['idstr'];
- $userInfo['province'] = $data['province'];
- $userInfo['city'] = $data['city'];
- $userInfo['location'] = $data['location'];
- $userInfo['created_at'] = $data['created_at'];
- $userInfo['gender'] = $data['gender']=='m'?'男':($data['gender']=='f'?'女':'未知');
- $userInfo['followers_count'] = $data['followers_count'];
- $userInfo['friends_count'] = $data['friends_count'];
- $userInfo['statuses_count'] = $data['statuses_count'];
- $userInfo['favourites_count'] = $data['favourites_count'];
- $userInfo['description'] = $data['description'];
- $userInfo['url'] = $data['url'];
- $userInfo['profile_url'] = $data['profile_url'];
- return $userInfo;
- } else {
- throw new \Exception("获取新浪微博用户信息失败:{$data['error']}");
- }
- }
-
- //Baidu用户信息
- public static function baidu($token)
- {
- $baidu = Oauth::getInstance('baidu', $token);
- $data = $baidu->call('passport/users/getInfo');
- if (isset($data['userid'])) {
- $userInfo['type'] = 'baidu';
- $userInfo['name'] = $data['username'];
- $userInfo['nickname'] = isset($data['realname'])?$data['realname']:'';
- $userInfo['avatar'] = 'http://tb.himg.baidu.com/sys/portrait/item/'.$data['portrait'];
- $userInfo['openid'] = $data['userid'];
- $userInfo['sex'] = $data['sex']==1?'男':'女';
- return $userInfo;
- } else {
- throw new \Exception("获取Baidu用户信息失败");
- }
- }
-
- //Gitee用户信息
- public static function gitee($token)
- {
- $google = Oauth::getInstance('gitee', $token);
- $data = $google->call('user');
- if (isset($data['id'])) {
- $userInfo['type'] = 'gitee';
- $userInfo['name'] = $data['name'];
- $userInfo['nickname'] = $data['login'];
- $userInfo['avatar'] = $data['avatar_url'];
- $userInfo['openid'] = $data['id'];
- $userInfo['html_url'] = $data['html_url'];
- $userInfo['blog'] = $data['blog'];
- $userInfo['email'] = $data['email'];
- return $userInfo;
- } else {
- throw new \Exception("获取Gitee用户信息失败");
- }
- }
-
- //Github用户信息
- public static function github($token)
- {
- $google = Oauth::getInstance('github', $token);
- $data = $google->call('user');
- if (isset($data['id'])) {
- $userInfo['type'] = 'github';
- $userInfo['name'] = $data['name'];
- $userInfo['nickname'] = $data['login'];
- $userInfo['avatar'] = $data['avatar_url'];
- $userInfo['openid'] = $data['id'];
- $userInfo['html_url'] = $data['html_url'];
- $userInfo['blog'] = $data['blog'];
- $userInfo['email'] = $data['email'];
- return $userInfo;
- } else {
- throw new \Exception("获取Gitee用户信息失败");
- }
- }
-
- //Google用户信息
- public static function google($token)
- {
- $google = Oauth::getInstance('google', $token);
- $data = $google->call('userinfo');
- if (isset($data['id'])) {
- $userInfo['type'] = 'google';
- $userInfo['name'] = $data['name'];
- $userInfo['nickname'] = $data['name'];
- $userInfo['avatar'] = $data['picture'];
- $userInfo['openid'] = $data['id'];
- $userInfo['given_name'] = $data['given_name'];
- $userInfo['family_name'] = $data['family_name'];
- $userInfo['locale'] = $data['locale'];
- $userInfo['email'] = $data['email'];
- return $userInfo;
- } else {
- throw new \Exception("获取Google用户信息失败");
- }
- }
-
- //Facebook用户信息
- public static function facebook($token)
- {
- $facebook = Oauth::getInstance('facebook', $token);
- $data = $facebook->call('me', 'fields=name,picture,first_name,last_name,short_name,email');
- if (isset($data['id'])) {
- $userInfo['type'] = 'facebook';
- $userInfo['name'] = $data['name'];
- $userInfo['nickname'] = $data['name'];
- $userInfo['avatar'] = $data['picture']['data']['url'];
- $userInfo['openid'] = $data['id'];
- $userInfo['first_name'] = $data['first_name'];
- $userInfo['last_name'] = $data['last_name'];
- $userInfo['short_name'] = $data['short_name'];
- $userInfo['email'] = $data['email'];
- return $userInfo;
- } else {
- throw new \Exception("获取Facebook用户信息失败");
- }
- }
-
- //Oschina用户信息
- public static function oschina($token)
- {
- $oschina = Oauth::getInstance('oschina', $token);
- $data = $oschina->call('action/openapi/user');
- if (isset($data['id'])) {
- $userInfo['type'] = 'gitee';
- $userInfo['name'] = $data['name'];
- $userInfo['nickname'] = $data['name'];
- $userInfo['avatar'] = $data['avatar'];
- $userInfo['openid'] = $data['id'];
- $userInfo['email'] = $data['email'];
- $userInfo['location'] = $data['location'];
- return $userInfo;
- } else {
- throw new \Exception("获取Gitee用户信息失败");
- }
- }
-
- //Taobao用户信息
- public static function taobao($token)
- {
- $data = $token;
- if (isset($data['taobao_user_id'])) {
- $userInfo['type'] = 'taobao';
- $userInfo['name'] = urldecode($data['taobao_user_nick']);
- $userInfo['nickname'] = urldecode($data['taobao_user_nick']);
- $userInfo['avatar'] = '';
- $userInfo['openid'] = $data['taobao_user_id'];
- $userInfo['taobao_open_uid'] = $data['taobao_open_uid'];
- return $userInfo;
- } else {
- throw new \Exception("获取淘宝用户信息失败");
- }
- }
-
- //Douyin用户信息
- public static function douyin($token)
- {
- $douyin = Oauth::getInstance('douyin', $token);
- $data = $douyin->call('oauth/userinfo');
- $data = $data['data'];
- if (isset($data['open_id'])) {
- $userInfo['type'] = 'douyin';
- $userInfo['name'] = $data['nickname'];
- $userInfo['nickname'] = $data['nickname'];
- $userInfo['avatar'] = $data['avatar'];
- $userInfo['openid'] = $data['open_id'];
- $userInfo['unionid'] = $data['union_id'];
- $userInfo['gender'] = $data['sex']==1?'男':'女';
- $userInfo['city'] = $data['city'];
- $userInfo['province'] = $data['province'];
- $userInfo['country'] = $data['country'];
- return $userInfo;
- } else {
- throw new \Exception("获取抖音用户信息失败");
- }
- }
-
- //Xiaomi用户信息
- public static function xiaomi($token)
- {
- $xiaomi = Oauth::getInstance('xiaomi', $token);
- $data = $xiaomi->call('user/profile');
- $data = $data['data'];
- if (isset($data['unionId'])) {
- $userInfo['type'] = 'xiaomi';
- $userInfo['name'] = $data['miliaoNick'];
- $userInfo['nickname'] = $data['miliaoNick'];
- $userInfo['avatar'] = $data['miliaoIcon'];
- $userInfo['openid'] = array_key_exists('userId',$data)?$data['userId']:$data['unionId'];
- $userInfo['unionid'] = $data['unionId'];
- return $userInfo;
- } else {
- throw new \Exception("获取小米用户信息失败");
- }
- }
-
- //Dingtalk用户信息
- public static function dingtalk($token)
- {
- $data = $token;
- if ($data['openid']) {
- $userInfo['type'] = 'dingtalk';
- $userInfo['name'] = $data['nick'];
- $userInfo['nickname'] = $data['nick'];
- $userInfo['avatar'] = '';
- $userInfo['openid'] = $data['openid'];
- $userInfo['unionid'] = $data['unionid'];
- return $userInfo;
- } else {
- throw new \Exception("获取钉钉用户信息失败");
- }
- }
-}
\ No newline at end of file
diff --git a/vendor/liliuwei/thinkphp-social/src/Oauth.php b/vendor/liliuwei/thinkphp-social/src/Oauth.php
deleted file mode 100644
index 7c251d1..0000000
--- a/vendor/liliuwei/thinkphp-social/src/Oauth.php
+++ /dev/null
@@ -1,267 +0,0 @@
-Type = strtolower($re_str);
-
- //获取应用配置
- $config = config("social.{$this->Type}");
- if (empty($config['app_key']) || empty($config['app_secret'])) {
- throw new \Exception('请配置您申请的app_key和app_secret');
- } else {
- $this->AppKey = $config['app_key'];
- $this->AppSecret = $config['app_secret'];
- $this->Token = $token; //设置获取到的TOKEN
- }
- }
-
- /**
- * 取得Oauth实例
- * @static
- * @return mixed 返回Oauth
- */
- public static function getInstance($type, $token = null)
- {
- $sdk = [
- 'Qq', 'Weixin', 'Sina', 'Baidu', 'Gitee', 'Github', 'Google', 'Facebook', 'Taobao', 'Oschina', 'Douyin', 'Xiaomi', 'Dingtalk'
- ];
- $name = ucfirst(strtolower($type));
- if (in_array($name, $sdk)) {
- $class = '\\liliuwei\\social\\sdk\\' . $name;
- return new $class($token);
- } else {
- header('content-type:text/html;charset=utf-8');
- throw new \Exception('暂时还不支持该' . $name . '的扩展');
- }
- }
-
- /**
- * 初始化配置
- */
- protected function config()
- {
- $config = config("social.{$this->Type}");
- if (!empty($config['authorize']))
- $this->Authorize = $config['authorize'];
- if (!empty($config['callback']))
- $this->Callback = $config['callback'];
- else
- throw new \Exception('请配置回调页面地址');
- }
-
- /**
- * 请求code
- */
- public function getRequestCodeURL()
- {
- $this->config();
- //Oauth 标准参数
- $params = array(
- 'client_id' => $this->AppKey,
- 'redirect_uri' => $this->Callback,
- 'response_type' => $this->ResponseType,
- );
-
- //获取额外参数
- if ($this->Authorize) {
- parse_str($this->Authorize, $_param);
- if (is_array($_param)) {
- $params = array_merge($params, $_param);
- } else {
- throw new \Exception('AUTHORIZE配置不正确!');
- }
- }
- return $this->GetRequestCodeURL . '?' . http_build_query($params);
- }
-
- /**
- * 获取access_token
- * @param string $code 上一步请求到的code
- */
- public function getAccessToken($code, $extend = null)
- {
- $this->config();
- $params = array(
- 'client_id' => $this->AppKey,
- 'client_secret' => $this->AppSecret,
- 'grant_type' => $this->GrantType,
- 'code' => $code,
- 'redirect_uri' => $this->Callback,
- );
-
- $data = $this->http($this->GetAccessTokenURL, $params, 'POST');
- $this->Token = $this->parseToken($data, $extend);
- return $this->Token;
- }
-
- /**
- * 合并默认参数和额外参数
- * @param array $params 默认参数
- * @param array/string $param 额外参数
- * @return array:
- */
- protected function param($params, $param)
- {
- if (is_string($param))
- parse_str($param, $param);
- return array_merge($params, $param);
- }
-
- /**
- * 获取指定API请求的URL
- * @param string $api API名称
- * @param string $fix api后缀
- * @return string 请求的完整URL
- */
- protected function url($api = '', $fix = '')
- {
- return $this->ApiBase . $api . $fix;
- }
-
- /**
- * 发送HTTP请求方法,目前只支持CURL发送请求
- * @param string $url 请求URL
- * @param array $params 请求参数
- * @param string $method 请求方法GET/POST
- * @return array $data 响应数据
- */
- protected function http($url, $params, $method = 'GET', $header = array(), $multi = false)
- {
- $opts = array(
- CURLOPT_TIMEOUT => 30,
- CURLOPT_RETURNTRANSFER => 1,
- CURLOPT_SSL_VERIFYPEER => false,
- CURLOPT_SSL_VERIFYHOST => false,
- CURLOPT_HTTPHEADER => $header
- );
-
- /* 根据请求类型设置特定参数 */
- switch (strtoupper($method)) {
- case 'GET':
- $opts[CURLOPT_URL] = $url . '?' . http_build_query($params);
- break;
- case 'POST':
- //判断是否传输文件
- $params = $multi ? $params : http_build_query($params);
- $opts[CURLOPT_URL] = $url;
- $opts[CURLOPT_POST] = 1;
- $opts[CURLOPT_POSTFIELDS] = $params;
- break;
- default:
- throw new \Exception('不支持的请求方式!');
- }
-
- /* 初始化并执行curl请求 */
- $ch = curl_init();
- curl_setopt_array($ch, $opts);
- $data = curl_exec($ch);
- $error = curl_error($ch);
- curl_close($ch);
- if ($error) throw new \Exception('请求发生错误:' . $error);
- return $data;
- }
-
- /**
- * 抽象方法,在SNSSDK中实现
- * 组装接口调用参数 并调用接口
- */
- abstract protected function call($api, $param = '', $method = 'GET', $multi = false);
-
- /**
- * 抽象方法,在SNSSDK中实现
- * 解析access_token方法请求后的返回值
- */
- abstract protected function parseToken($result, $extend);
-
- /**
- * 抽象方法,在SNSSDK中实现
- * 获取当前授权用户的SNS标识
- */
- abstract public function openid();
-}
\ No newline at end of file
diff --git a/vendor/liliuwei/thinkphp-social/src/config/config.php b/vendor/liliuwei/thinkphp-social/src/config/config.php
deleted file mode 100644
index 4f1cc58..0000000
--- a/vendor/liliuwei/thinkphp-social/src/config/config.php
+++ /dev/null
@@ -1,85 +0,0 @@
- [
- 'app_key' => '', //应用注册成功后分配的 APP ID
- 'app_secret' => '', //应用注册成功后分配的KEY
- 'callback' => '', // 应用回调地址
- ],
- //微信扫码登录配置
- 'weixin' => [
- 'app_key' => '', //应用注册成功后分配的 APP ID
- 'app_secret' => '', //应用注册成功后分配的KEY
- 'callback' => '', // 应用回调地址
- ],
- //新浪登录配置
- 'sina' => [
- 'app_key' => '', //应用注册成功后分配的 APP ID
- 'app_secret' => '', //应用注册成功后分配的KEY
- 'callback' => '', // 应用回调地址
- ],
- //Baidu登录配置
- 'baidu' => [
- 'app_key' => '', //应用注册成功后分配的 APP ID
- 'app_secret' => '', //应用注册成功后分配的KEY
- 'callback' => '', // 应用回调地址
- ],
- //Gitee登录配置
- 'gitee' => [
- 'app_key' => '', //应用注册成功后分配的 APP ID
- 'app_secret' => '', //应用注册成功后分配的KEY
- 'callback' => '', // 应用回调地址
- ],
- //Github登录配置
- 'github' => [
- 'app_key' => '', //应用注册成功后分配的 APP ID
- 'app_secret' => '', //应用注册成功后分配的KEY
- 'callback' => '', // 应用回调地址
- ],
- //Google登录配置
- 'google' => [
- 'app_key' => '', //应用注册成功后分配的 APP ID
- 'app_secret' => '', //应用注册成功后分配的KEY
- 'callback' => '', // 应用回调地址
- ],
- //Facebook登录配置
- 'facebook' => [
- 'app_key' => '', //应用注册成功后分配的 APP ID
- 'app_secret' => '', //应用注册成功后分配的KEY
- 'callback' => '', // 应用回调地址
- ],
- //Oschina登录配置
- 'oschina' => [
- 'app_key' => '', //应用注册成功后分配的 APP ID
- 'app_secret' => '', //应用注册成功后分配的KEY
- 'callback' => '', // 应用回调地址
- ],
- //Taobao登录配置
- 'taobao' => [
- 'app_key' => '', //应用注册成功后分配的 APP ID
- 'app_secret' => '', //应用注册成功后分配的KEY
- 'callback' => '', // 应用回调地址
- ],
- //Douyin登录配置
- 'douyin' => [
- 'app_key' => '', //应用注册成功后分配的 APP ID
- 'app_secret' => '', //应用注册成功后分配的KEY
- 'callback' => '', // 应用回调地址
- ],
- //Xiaomi登录配置
- 'xiaomi' => [
- 'app_key' => '', //应用注册成功后分配的 APP ID
- 'app_secret' => '', //应用注册成功后分配的KEY
- 'callback' => '', // 应用回调地址
- ],
- //Dingtalk登录配置
- 'dingtalk' => [
- 'app_key' => '', //应用注册成功后分配的 APP ID
- 'app_secret' => '', //应用注册成功后分配的KEY
- 'callback' => '', // 应用回调地址
- ]
-];
diff --git a/vendor/liliuwei/thinkphp-social/src/sdk/Baidu.php b/vendor/liliuwei/thinkphp-social/src/sdk/Baidu.php
deleted file mode 100644
index 8e9e86a..0000000
--- a/vendor/liliuwei/thinkphp-social/src/sdk/Baidu.php
+++ /dev/null
@@ -1,74 +0,0 @@
- $this->Token['access_token'],
- );
- $data = $this->http($this->url($api), $this->param($params, $param), $method);
- return json_decode($data, true);
- }
-
- /**
- * 解析access_token方法请求后的返回值
- * @param string $result 获取access_token的方法的返回值
- */
- protected function parseToken($result, $extend)
- {
- $data = json_decode($result, true);
- if ($data['access_token'] && $data['expires_in'] && $data['refresh_token']) {
- $this->Token = $data;
- $data['openid'] = $this->openid();
- return $data;
- } else
- throw new \Exception("获取百度ACCESS_TOKEN出错:{$data['error']}");
- }
-
- /**
- * 获取当前授权应用的openid
- * @return string
- */
- public function openid()
- {
- $data = $this->call('passport/users/getInfo');
- if (isset($data['userid']))
- return $data['userid'];
- else
- throw new \Exception('没有获取到百度用户ID!');
- }
-}
\ No newline at end of file
diff --git a/vendor/liliuwei/thinkphp-social/src/sdk/Dingtalk.php b/vendor/liliuwei/thinkphp-social/src/sdk/Dingtalk.php
deleted file mode 100644
index c2bda4b..0000000
--- a/vendor/liliuwei/thinkphp-social/src/sdk/Dingtalk.php
+++ /dev/null
@@ -1,170 +0,0 @@
-getMicrotime();
- // 根据timestamp, appSecret计算签名值
- $s = hash_hmac('sha256', $time, $this->AppSecret, true);
- $signature = base64_encode($s);
- $urlencode_signature = urlencode($signature);
- /* Dingtalk 调用公共参数 */
- $params = array(
- 'tmp_auth_code'=>$param['code'],
- );
- $data = $this->http($this->url($api.'?signature='.$urlencode_signature.'×tamp='.$time.'&accessKey='.$this->AppKey), $this->param($params, $param), $method);
- return json_decode($data, true);
- }
-
- /**
- * 发送HTTP请求方法,目前只支持CURL发送请求
- * @param string $url 请求URL
- * @param array $params 请求参数
- * @param string $method 请求方法GET/POST
- * @return array $data 响应数据
- */
- public function http($url, $params, $method = 'POST', $header = array(), $multi = false)
- {
- $data_string = json_encode($params);
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($ch, CURLOPT_POSTFIELDS,$data_string);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array(
- 'Content-Type: application/json',
- 'Content-Length: ' . strlen($data_string))
- );
-
- $result = curl_exec($ch);
- return $result;
- }
-
- /**
- * 时间戳 - 精确到毫秒
- * @return float
- */
- public function getMicrotime()
- {
- list($t1, $t2) = explode(' ', microtime());
- return (float)sprintf('%.0f', (floatval($t1) + floatval($t2)) * 1000);
- }
-
- /**
- * 请求code
- */
- public function getRequestCodeURL()
- {
- $this->config();
- //Oauth 标准参数
- $params = array(
- 'appid' => $this->AppKey,
- 'redirect_uri' => $this->Callback,
- 'response_type' => $this->ResponseType,
- );
-
- //获取额外参数
- if ($this->Authorize) {
- parse_str($this->Authorize, $_param);
- if (is_array($_param)) {
- $params = array_merge($params, $_param);
- } else {
- throw new \Exception('AUTHORIZE配置不正确!');
- }
- }
- return $this->GetRequestCodeURL . '?' . http_build_query($params);
- }
-
- /**
- * 获取access_token
- * @param string $code 上一步请求到的code
- */
- public function getAccessToken($code, $extend = null)
- {
- $result = $this->call('sns/getuserinfo_bycode',['code'=>$code]);
- $data = $result['user_info'];
- $this->Token = [
- 'nick'=>$data['nick'],
- 'openid'=>$data['openid'],
- 'unionid'=>$data['unionid'],
- ];
- return $this->Token;
- }
-
- /**
- * 解析access_token方法请求后的返回值
- * @param string $result 获取access_token的方法的返回值
- */
- protected function parseToken($result, $extend){}
-
- /**
- * 获取当前授权应用的openid
- * @return string
- */
- public function openid($unionid=false)
- {
- if ($unionid){
- return $this->unionid();
- }
- $data = $this->Token;
- if (isset($data['openid'])){
- return $data['openid'];
- }else{
- throw new \Exception('没有获取到 Dingtalk 用户openid!');
- }
- }
-
- /**
- * 获取当前授权应用的unionid
- */
- public function unionid()
- {
- $data = $this->Token;
- if (isset($data['unionid'])){
- return $data['unionid'];
- }else{
- throw new \Exception('没有获取到 Dingtalk 用户unionid!');
- }
- }
-
-}
\ No newline at end of file
diff --git a/vendor/liliuwei/thinkphp-social/src/sdk/Douyin.php b/vendor/liliuwei/thinkphp-social/src/sdk/Douyin.php
deleted file mode 100644
index 834f609..0000000
--- a/vendor/liliuwei/thinkphp-social/src/sdk/Douyin.php
+++ /dev/null
@@ -1,141 +0,0 @@
-config();
- $params = array(
- 'client_key ' => $this->AppKey,
- 'redirect_uri' => $this->Callback,
- 'response_type' => $this->ResponseType,
- );
-
- //获取额外参数
- if ($this->Authorize) {
- parse_str($this->Authorize, $_param);
- if (is_array($_param)) {
- $params = array_merge($params, $_param);
- } else {
- throw new \Exception('AUTHORIZE配置不正确!');
- }
- }
- return $this->GetRequestCodeURL . '?' . http_build_query($params);
- }
-
- /**
- * 获取access_token
- * @param string $code 上一步请求到的code
- */
- public function getAccessToken($code, $extend = null)
- {
- $this->config();
- $params = array(
- 'client_key' => $this->AppKey,
- 'client_secret ' => $this->AppSecret,
- 'grant_type' => $this->GrantType,
- 'code' => $code,
- );
- $data = $this->http($this->GetAccessTokenURL, $params, 'GET');
- $this->Token = $this->parseToken($data, $extend);
- return $this->Token;
- }
-
- /**
- * 组装接口调用参数 并调用接口
- * @param string $api Douyin API
- * @param string $param 调用API的额外参数
- * @param string $method HTTP请求方法 默认为GET
- * @return json
- */
- public function call($api, $param = '', $method = 'GET', $multi = false)
- {
- /* Douyin 调用公共参数 */
- $params = array(
- 'access_token' => $this->Token['access_token'],
- 'open_id' => $this->openid(),
- );
- $data = $this->http($this->url($api), $this->param($params, $param), $method);
- return json_decode($data, true);
- }
-
- /**
- * 解析access_token方法请求后的返回值
- * @param string $result 获取access_token的方法的返回值
- */
- protected function parseToken($result, $extend)
- {
- $data = json_decode($result, true);
- $data = $data['data'];
- if ($data['access_token'] && $data['expires_in']) {
- $this->Token = $data;
- $data['openid'] = $this->openid();
- return $data;
- } else
- throw new \Exception("获取 抖音 ACCESS_TOKEN出错:未知错误");
- }
-
- /**
- * 获取当前授权应用的openid
- * @return string
- */
- public function openid($unionid=false)
- {
- if ($unionid){
- return $this->unionid();
- }
- $data = $this->call('oauth/userinfo');
- $data = $data['data'];
- if (isset($data['open_id']))
- return $data['open_id'];
- else
- throw new \Exception('没有获取到 抖音 用户openid!');
- }
-
- /**
- * 获取当前授权应用的unionid
- */
- public function unionid()
- {
- $data = $this->call('oauth/userinfo');
- $data = $data['data'];
- if (isset($data['union_id']))
- return $data['union_id'];
- else
- exit('没有获取到 抖音 用户unionid!');
- }
-}
\ No newline at end of file
diff --git a/vendor/liliuwei/thinkphp-social/src/sdk/Facebook.php b/vendor/liliuwei/thinkphp-social/src/sdk/Facebook.php
deleted file mode 100644
index 58dd342..0000000
--- a/vendor/liliuwei/thinkphp-social/src/sdk/Facebook.php
+++ /dev/null
@@ -1,83 +0,0 @@
- $this->Token['access_token']);
- $data = $this->http($this->url($api), $this->param($params, $param), $method);
- return json_decode($data, true);
- }
-
- /**
- * 解析access_token方法请求后的返回值
- * @param string $result 获取access_token的方法的返回值
- * @param mix $extend
- * @return array
- */
- protected function parseToken($result, $extend)
- {
- $data = json_decode($result, true);
- if (is_array($data) && $data['access_token'] && $data['expires_in']) {
- $this->Token = $data;
- $data['openid'] = $this->openid();
- return $data;
- } else {
- throw new \Exception("获取 facebook ACCESS_TOKEN出错:未知错误");
- }
-
- }
-
- /**
- * 获取当前授权应用的openid
- * @return string
- */
- public function openid()
- {
- $data = $this->call('me');
- if (isset($data['id']))
- return $data['id'];
- else
- throw new \Exception('没有获取到 facebook 用户ID!');
- }
-}
\ No newline at end of file
diff --git a/vendor/liliuwei/thinkphp-social/src/sdk/Gitee.php b/vendor/liliuwei/thinkphp-social/src/sdk/Gitee.php
deleted file mode 100644
index 5fcd481..0000000
--- a/vendor/liliuwei/thinkphp-social/src/sdk/Gitee.php
+++ /dev/null
@@ -1,79 +0,0 @@
-Token['access_token']}");
- $data = $this->http($this->url($api), $this->param($params, $param), $method, $header);
- return json_decode($data, true);
- }
-
- /**
- * 解析access_token方法请求后的返回值
- * @param string $result 获取access_token的方法的返回值
- */
- protected function parseToken($result, $extend)
- {
- $data = json_decode($result, true);
- if ($data['access_token'] && $data['token_type']) {
- $this->Token = $data;
- $data['openid'] = $this->openid();
- return $data;
- } else
- throw new \Exception("获取 Gitee ACCESS_TOKEN出错:未知错误");
- }
-
- /**
- * 获取当前授权应用的openid
- * @return string
- */
- public function openid()
- {
- $data = $this->call('user');
- if (isset($data['id']))
- return $data['id'];
- else
- throw new \Exception('没有获取到 Gitee 用户ID!');
- }
-}
\ No newline at end of file
diff --git a/vendor/liliuwei/thinkphp-social/src/sdk/Github.php b/vendor/liliuwei/thinkphp-social/src/sdk/Github.php
deleted file mode 100644
index d821e05..0000000
--- a/vendor/liliuwei/thinkphp-social/src/sdk/Github.php
+++ /dev/null
@@ -1,73 +0,0 @@
-Token['access_token']}","User-Agent:thinkphp-social");
- $data = $this->http($this->url($api), $this->param($params, $param), $method, $header);
- return json_decode($data, true);
- }
-
- /**
- * 解析access_token方法请求后的返回值
- * @param string $result 获取access_token的方法的返回值
- */
- protected function parseToken($result, $extend)
- {
- parse_str($result, $data);
- if ($data['access_token'] && $data['token_type']) {
- $this->Token = $data;
- $data['openid'] = $this->openid();
- return $data;
- } else
- throw new \Exception("获取 Github ACCESS_TOKEN出错:未知错误");
- }
-
- /**
- * 获取当前授权应用的openid
- * @return string
- */
- public function openid()
- {
- $data = $this->call('user');
- if (isset($data['id']))
- return $data['id'];
- else
- throw new \Exception('没有获取到 Github 用户ID!');
- }
-}
\ No newline at end of file
diff --git a/vendor/liliuwei/thinkphp-social/src/sdk/Google.php b/vendor/liliuwei/thinkphp-social/src/sdk/Google.php
deleted file mode 100644
index 4502807..0000000
--- a/vendor/liliuwei/thinkphp-social/src/sdk/Google.php
+++ /dev/null
@@ -1,80 +0,0 @@
- $this->Token['access_token'],
- );
- $data = $this->http($this->url($api), $this->param($params, $param), $method);
- return json_decode($data, true);
- }
-
- /**
- * 解析access_token方法请求后的返回值
- * @param string $result 获取access_token的方法的返回值
- */
- protected function parseToken($result, $extend)
- {
- $data = json_decode($result, true);
- if ($data['access_token'] && $data['expires_in']) {
- $this->Token = $data;
- $data['openid'] = $this->openid();
- return $data;
- } else
- throw new \Exception("获取Google ACCESS_TOKEN 出错:{$result}");
- }
-
- /**
- * 获取当前授权应用的openid
- * @return string
- */
- public function openid()
- {
- $data = $this->call('userinfo');
- if (isset($data['id']))
- return $data['id'];
- else
- throw new \Exception('没有获取到 Google 用户ID!');
- }
-}
\ No newline at end of file
diff --git a/vendor/liliuwei/thinkphp-social/src/sdk/Oschina.php b/vendor/liliuwei/thinkphp-social/src/sdk/Oschina.php
deleted file mode 100644
index feac8f1..0000000
--- a/vendor/liliuwei/thinkphp-social/src/sdk/Oschina.php
+++ /dev/null
@@ -1,81 +0,0 @@
- $this->Token['access_token'],
- 'dataType' => 'json'
- );
- $data = $this->http($this->url($api), $this->param($params, $param), $method);
- return json_decode($data, true);
- }
-
- /**
- * 解析access_token方法请求后的返回值
- * @param string $result 获取access_token的方法的返回值
- */
- protected function parseToken($result, $extend)
- {
- $data = json_decode($result, true);
- if ($data['access_token'] && $data['token_type']) {
- $this->Token = $data;
- $data['openid'] = $this->openid();
- return $data;
- } else
- throw new \Exception("获取 Oschina ACCESS_TOKEN出错:未知错误");
- }
-
- /**
- * 获取当前授权应用的openid
- * @return string
- */
- public function openid()
- {
- $data = $this->call('action/openapi/user');
- if (isset($data['id']))
- return $data['id'];
- else
- throw new \Exception('没有获取到 Oschina 用户ID!');
- }
-}
\ No newline at end of file
diff --git a/vendor/liliuwei/thinkphp-social/src/sdk/Qq.php b/vendor/liliuwei/thinkphp-social/src/sdk/Qq.php
deleted file mode 100644
index e81f00a..0000000
--- a/vendor/liliuwei/thinkphp-social/src/sdk/Qq.php
+++ /dev/null
@@ -1,111 +0,0 @@
- $this->AppKey,
- 'access_token' => $this->Token['access_token'],
- 'openid' => $this->openid(),
- 'format' => 'json'
- );
- $data = $this->http($this->url($api), $this->param($params, $param), $method);
- return json_decode($data, true);
- }
-
- /**
- * 解析access_token方法请求后的返回值
- * @param string $result 获取access_token的方法的返回值
- */
- protected function parseToken($result, $extend)
- {
- parse_str($result, $data);
- if ($data['access_token'] && $data['expires_in']) {
- $this->Token = $data;
- $data['openid'] = $this->openid();
- return $data;
- } else
- throw new \Exception("获取腾讯QQ ACCESS_TOKEN 出错:{$result}");
- }
-
- /**
- * 获取当前授权应用的openid
- * @return string
- */
- public function openid($unionid=false)
- {
- if ($unionid){
- return $this->unionid();
- }
- $data = $this->Token;
- if ($data['access_token']) {
- $data = $this->http($this->url('oauth2.0/me'), array('access_token' => $data['access_token']));
- $data = json_decode(trim(substr($data, 9), " );\n"), true);
- if (isset($data['openid']))
- return $data['openid'];
- else
- throw new \Exception("获取用户openid出错:{$data['error_description']}");
- } else {
- throw new \Exception('没有获取到openid!');
- }
- }
-
- /**
- * 获取当前授权应用的unionid
- * @return string
- */
- public function unionid()
- {
- $data = $this->Token;
- if ($data['access_token']) {
- $data = $this->http($this->url('oauth2.0/me'), array('access_token' => $data['access_token'],'unionid'=>1));
- $data = json_decode(trim(substr($data, 9), " );\n"), true);
- if (isset($data['unionid']))
- return $data['unionid'];
- else
- throw new \Exception("获取用户unionid出错:{$data['error_description']}");
- } else {
- throw new \Exception('没有获取到unionid!');
- }
- }
-}
\ No newline at end of file
diff --git a/vendor/liliuwei/thinkphp-social/src/sdk/Sina.php b/vendor/liliuwei/thinkphp-social/src/sdk/Sina.php
deleted file mode 100644
index d9ea774..0000000
--- a/vendor/liliuwei/thinkphp-social/src/sdk/Sina.php
+++ /dev/null
@@ -1,74 +0,0 @@
- $this->Token['access_token'],
- );
- $data = $this->http($this->url($api, '.json'), $this->param($params, $param), $method);
- return json_decode($data, true);
- }
-
- /**
- * 解析access_token方法请求后的返回值
- * @param string $result 获取access_token的方法的返回值
- */
- protected function parseToken($result, $extend)
- {
- $data = json_decode($result, true);
- if ($data['access_token'] && $data['expires_in'] && $data['remind_in'] && $data['uid']) {
- $this->Token = $data;
- $data['openid'] = $this->openid();
- return $data;
- } else
- throw new \Exception("获取新浪微博ACCESS_TOKEN出错:{$data['error']}");
- }
-
- /**
- * 获取当前授权应用的openid
- * @return string
- */
- public function openid()
- {
- $data = $this->Token;
- if (isset($data['uid']))
- return $data['uid'];
- else
- throw new \Exception('没有获取到新浪微博用户ID!');
- }
-}
\ No newline at end of file
diff --git a/vendor/liliuwei/thinkphp-social/src/sdk/Taobao.php b/vendor/liliuwei/thinkphp-social/src/sdk/Taobao.php
deleted file mode 100644
index bb76551..0000000
--- a/vendor/liliuwei/thinkphp-social/src/sdk/Taobao.php
+++ /dev/null
@@ -1,106 +0,0 @@
- $api,
- 'access_token' => $this->Token['access_token'],
- 'format' => 'json',
- 'v' => '2.0',
- );
- $paramsAll = $this->param($params, $param);
- ksort($paramsAll);
- $str = '';
- foreach ($paramsAll as $key => $value) {
- $str .= $key . $value;
- }
- $sign = strtoupper(md5($this->AppSecret . $str . $this->AppSecret));
- $params_sign = array(
- 'sign' => $sign,
- );
- $data = $this->http($this->url(), array_merge($paramsAll, $params_sign), $method);
- return json_decode($data, true);
- }
-
- /**
- * 解析access_token方法请求后的返回值
- * @param string $result 获取access_token的方法的返回值
- */
- protected function parseToken($result, $extend)
- {
- $data = json_decode($result, true);
- if ($data['access_token'] && $data['expires_in'] && $data['taobao_user_id']) {
- $this->Token = $data;
- $data['openid'] = $this->openid();
- return $data;
- } else {
- throw new \Exception("获取淘宝网ACCESS_TOKEN出错:{$data['error']}");
- }
- }
-
- /**
- * 获取当前授权应用的openid
- * @return string
- */
- public function openid($unionid = false)
- {
- if ($unionid) {
- return $this->unionid();
- }
- $data = $this->Token;
- if (isset($data['taobao_user_id'])) {
- return $data['taobao_user_id'];
- } else {
- throw new \Exception('没有获取到淘宝网用户openid!');
- }
- }
-
- /**
- * 获取当前授权应用的unionid
- * @return string
- */
- public function unionid()
- {
- $data = $this->Token;
- if (isset($data['taobao_open_uid'])) {
- return $data['taobao_open_uid'];
- } else {
- throw new \Exception('没有获取到淘宝网用户unionid!');
- }
- }
-}
\ No newline at end of file
diff --git a/vendor/liliuwei/thinkphp-social/src/sdk/Weixin.php b/vendor/liliuwei/thinkphp-social/src/sdk/Weixin.php
deleted file mode 100644
index 9582d2a..0000000
--- a/vendor/liliuwei/thinkphp-social/src/sdk/Weixin.php
+++ /dev/null
@@ -1,137 +0,0 @@
-config();
- $params = array(
- 'appid' => $this->AppKey,
- 'redirect_uri' => $this->Callback,
- 'response_type' => $this->ResponseType,
- );
-
- //获取额外参数
- if ($this->Authorize) {
- parse_str($this->Authorize, $_param);
- if (is_array($_param)) {
- $params = array_merge($params, $_param);
- } else {
- throw new \Exception('AUTHORIZE配置不正确!');
- }
- }
- return $this->GetRequestCodeURL . '?' . http_build_query($params) . "#wechat_redirect";
- }
-
- /**
- * 获取access_token
- * @param string $code 上一步请求到的code
- */
- public function getAccessToken($code, $extend = null)
- {
- $this->config();
- $params = array(
- 'appid' => $this->AppKey,
- 'secret' => $this->AppSecret,
- 'grant_type' => $this->GrantType,
- 'code' => $code,
- );
- $data = $this->http($this->GetAccessTokenURL, $params, 'POST');
- $this->Token = $this->parseToken($data, $extend);
- return $this->Token;
- }
-
- /**
- * 组装接口调用参数 并调用接口
- * @param string $api 微信 API
- * @param string $param 调用API的额外参数
- * @param string $method HTTP请求方法 默认为GET
- * @return json
- */
- public function call($api, $param = '', $method = 'GET', $multi = false)
- {
- /* 微信调用公共参数 */
- $params = array(
- 'access_token' => $this->Token['access_token'],
- 'openid' => $this->openid(),
- 'lang' => 'zh_CN',
- );
- $data = $this->http($this->url($api), $this->param($params, $param), $method);
- return json_decode($data, true);
- }
-
- /**
- * 解析access_token方法请求后的返回值
- */
- protected function parseToken($result, $extend)
- {
- $data = json_decode($result, true);
- if ($data['access_token'] && $data['expires_in']) {
- $this->Token = $data;
- $data['openid'] = $this->openid();
- return $data;
- } else
- throw new \Exception("获取微信 ACCESS_TOKEN 出错:{$result}");
- }
-
- /**
- * 获取当前授权应用的openid
- */
- public function openid($unionid=false)
- {
- if ($unionid){
- return $this->unionid();
- }
- $data = $this->Token;
- if (isset($data['openid']))
- return $data['openid'];
- else
- exit('没有获取到微信用户openid!');
- }
-
- /**
- * 获取当前授权应用的unionid
- */
- public function unionid()
- {
- $data = $this->Token;
- if (isset($data['unionid']))
- return $data['unionid'];
- else
- exit('没有获取到微信用户unionid!');
- }
-}
\ No newline at end of file
diff --git a/vendor/liliuwei/thinkphp-social/src/sdk/Xiaomi.php b/vendor/liliuwei/thinkphp-social/src/sdk/Xiaomi.php
deleted file mode 100644
index f38366e..0000000
--- a/vendor/liliuwei/thinkphp-social/src/sdk/Xiaomi.php
+++ /dev/null
@@ -1,104 +0,0 @@
- $this->Token['access_token'],
- 'clientId' => $this->AppKey
- );
- $data = $this->http($this->url($api), $this->param($params, $param), $method);
- return json_decode($data, true);
- }
-
- /**
- * 解析access_token方法请求后的返回值
- * @param string $result 获取access_token的方法的返回值
- */
- protected function parseToken($result, $extend)
- {
- $data = json_decode($result, true);
- if ($data['access_token'] && $data['token_type']) {
- $this->Token = $data;
- $data['openid'] = $this->openid();
- return $data;
- } else
- throw new \Exception("获取 Xiaomi ACCESS_TOKEN出错:未知错误");
- }
-
- /**
- * 获取当前授权应用的openid
- * @return string
- */
- public function openid($unionid=false)
- {
- if ($unionid){
- return $this->unionid();
- }
- $data = $this->call('user/profile');
- if ($data['result']=='ok'){
- $data = $data['data'];
- if (isset($data['userId'])){
- return $data['userId'];
- }else{
- return $this->unionid();
- }
- }else{
- throw new \Exception('没有获取到 Xiaomi 用户openid!');
- }
- }
-
- /**
- * 获取当前授权应用的unionid
- * @return string
- */
- public function unionid()
- {
- $data = $this->call('user/profile');
- $data = $data['data'];
- if (isset($data['unionId']))
- return $data['unionId'];
- else
- throw new \Exception('没有获取到 Xiaomi 用户unionid!');
- }
-}
\ No newline at end of file
diff --git a/vendor/lotofbadcode/phpspirit_databackup/.gitignore b/vendor/lotofbadcode/phpspirit_databackup/.gitignore
deleted file mode 100644
index bfcd881..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-/.idea
-/.vscode
-/vendor
-*.log
-.env
-*.sql
-*.rar
-*.zip
-*.7z
-/demo/backup
\ No newline at end of file
diff --git a/vendor/lotofbadcode/phpspirit_databackup/README.md b/vendor/lotofbadcode/phpspirit_databackup/README.md
deleted file mode 100644
index f70da54..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/README.md
+++ /dev/null
@@ -1 +0,0 @@
-# 一个php备份恢复数据库的扩展 相关文档:https://www.kancloud.cn/lotofbadcode/php_spirit/content
diff --git a/vendor/lotofbadcode/phpspirit_databackup/composer.json b/vendor/lotofbadcode/phpspirit_databackup/composer.json
deleted file mode 100644
index e4ee82d..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/composer.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "lotofbadcode/phpspirit_databackup",
- "description": "一个PHP数据库备份恢复的插件",
- "license": "Apache-2.0",
- "type": "library",
- "keywords": [
- "php",
- "library"
- ],
- "authors": [
- {
- "name": "代码庸医",
- "email": "3359964266@qq.com"
- }
- ],
- "require": {
- "php": ">=7.0"
- },
- "autoload": {
- "psr-4": {
- "phpspirit\\databackup\\": "src/"
- }
- }
-}
\ No newline at end of file
diff --git a/vendor/lotofbadcode/phpspirit_databackup/demo/.htaccess b/vendor/lotofbadcode/phpspirit_databackup/demo/.htaccess
deleted file mode 100644
index e69de29..0000000
diff --git a/vendor/lotofbadcode/phpspirit_databackup/demo/backup.gif b/vendor/lotofbadcode/phpspirit_databackup/demo/backup.gif
deleted file mode 100644
index 8ac0914..0000000
Binary files a/vendor/lotofbadcode/phpspirit_databackup/demo/backup.gif and /dev/null differ
diff --git a/vendor/lotofbadcode/phpspirit_databackup/demo/backup.html b/vendor/lotofbadcode/phpspirit_databackup/demo/backup.html
deleted file mode 100644
index 01fad4c..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/demo/backup.html
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
- 数据备份
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/vendor/lotofbadcode/phpspirit_databackup/demo/backup.php b/vendor/lotofbadcode/phpspirit_databackup/demo/backup.php
deleted file mode 100644
index dda5565..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/demo/backup.php
+++ /dev/null
@@ -1,35 +0,0 @@
-setbackdir($backupdir)
- ->settablelist(['md_menu', 'md_api_group'])
- ->setstructuretable(['md_api_group'])
- ->setvolsize(0.2);
-do {
- $result = $backup->backup();
- echo str_repeat(' ', 1000); //这里会把浏览器缓存装满
- ob_flush(); //把php缓存写入apahce缓存
- flush(); //把apahce缓存写入浏览器缓存
- if ($result['totalpercentage'] > 0) {
- echo '完成' . $result['totalpercentage'] . '% ';
- }
-} while ($result['totalpercentage'] < 100);
diff --git a/vendor/lotofbadcode/phpspirit_databackup/demo/backupajax.php b/vendor/lotofbadcode/phpspirit_databackup/demo/backupajax.php
deleted file mode 100644
index 0135d25..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/demo/backupajax.php
+++ /dev/null
@@ -1,31 +0,0 @@
-setbackdir($backupdir)
- ->setvolsize(0.2)
- ->setonlystructure(false) //设置是否只备份目录结构
- //->settablelist(['md_menu', 'md_api_group','cmseasy_b_category']) //设置要备份的表, 默认全部表
- //->setstructuretable(['md_api_group']) //设置哪些表只备份结构不备份数据
- ->ajaxbackup($_POST);
-
-echo json_encode($result);
diff --git a/vendor/lotofbadcode/phpspirit_databackup/demo/css/jquery.circliful.css b/vendor/lotofbadcode/phpspirit_databackup/demo/css/jquery.circliful.css
deleted file mode 100644
index d4ea801..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/demo/css/jquery.circliful.css
+++ /dev/null
@@ -1,20 +0,0 @@
-.circliful {
- position: relative;
-}
-
-.circle-text, .circle-info, .circle-text-half, .circle-info-half {
- width: 100%;
- position: absolute;
- text-align: center;
- display: inline-block;
-}
-
-.circle-info, .circle-info-half {
- color: #999;
-}
-
-.circliful .fa {
- margin: -10px 3px 0 3px;
- position: relative;
- bottom: 4px;
-}
diff --git a/vendor/lotofbadcode/phpspirit_databackup/demo/js/jquery.circliful.js b/vendor/lotofbadcode/phpspirit_databackup/demo/js/jquery.circliful.js
deleted file mode 100644
index 3b81a5f..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/demo/js/jquery.circliful.js
+++ /dev/null
@@ -1,191 +0,0 @@
- (function( $ ) {
-
- $.fn.circliful = function(options) {
-
- var settings = $.extend({
- // These are the defaults.
- foregroundColor: "#556b2f",
- backgroundColor: "#eee",
- fillColor: false,
- width: 15,
- dimension: 200,
- size: 15,
- percent: 50,
- animationStep: 1.0
- }, options );
- return this.each(function() {
- var dimension = '';
- var text = '';
- var info = '';
- var width = '';
- var size = 0;
- var percent = 0;
- var endPercent = 100;
- var fgcolor = '';
- var bgcolor = '';
- var icon = '';
- var animationstep = 0.0;
-
- $(this).addClass('circliful');
-
- if($(this).data('dimension') != undefined) {
- dimension = $(this).data('dimension');
- } else {
- dimension = settings.dimension;
- }
-
- if($(this).data('width') != undefined) {
- width = $(this).data('width');
- } else {
- width = settings.width;
- }
-
- if($(this).data('fontsize') != undefined) {
- size = $(this).data('fontsize');
- } else {
- size = settings.size;
- }
-
- if($(this).data('percent') != undefined) {
- percent = $(this).data('percent') / 100;
- endPercent = $(this).data('percent');
- } else {
- percent = settings.percent / 100;
- }
-
- if($(this).data('fgcolor') != undefined) {
- fgcolor = $(this).data('fgcolor');
- } else {
- fgcolor = settings.foregroundColor;
- }
-
- if($(this).data('bgcolor') != undefined) {
- bgcolor = $(this).data('bgcolor');
- } else {
- bgcolor = settings.backgroundColor;
- }
-
- if($(this).data('animation-step') != undefined) {
- animationstep = parseFloat($(this).data('animation-step'));
- } else {
- animationstep = settings.animationStep;
- }
- if($(this).data('text') != undefined) {
- text = $(this).data('text');
-
- if($(this).data('icon') != undefined) {
- icon = ' ';
- }
-
- if($(this).data('type') != undefined) {
- type = $(this).data('type');
-
- if(type == 'half') {
- $(this).append('' + icon + text + ' ');
- $(this).find('.circle-text-half').css({'line-height': (dimension / 1.45) + 'px', 'font-size' : size + 'px' });
- } else {
- $(this).append('' + icon + text + ' ');
- $(this).find('.circle-text').css({'line-height': dimension + 'px', 'font-size' : size + 'px' });
- }
- } else {
- $(this).append('' + icon + text + ' ');
- $(this).find('.circle-text').css({'line-height': dimension + 'px', 'font-size' : size + 'px' });
- }
- } else if($(this).data('icon') != undefined) {
-
- }
-
- if($(this).data('info') != undefined) {
- info = $(this).data('info');
-
- if($(this).data('type') != undefined) {
- type = $(this).data('type');
-
- if(type == 'half') {
- $(this).append('' + info + ' ');
- $(this).find('.circle-info-half').css({'line-height': (dimension * 0.9) + 'px', });
- } else {
- $(this).append('' + info + ' ');
- $(this).find('.circle-info').css({'line-height': (dimension * 1.25) + 'px', });
- }
- } else {
- $(this).append('' + info + ' ');
- $(this).find('.circle-info').css({'line-height': (dimension * 1.25) + 'px', });
- }
- }
-
- $(this).width(dimension + 'px');
-
- var canvas = $(' ').attr({ width: dimension, height: dimension }).appendTo($(this)).get(0);
- var context = canvas.getContext('2d');
- var x = canvas.width / 2;
- var y = canvas.height / 2;
- var degrees = percent * 360.0;
- var radians = degrees * (Math.PI / 180);
- var radius = canvas.width / 2.5;
- var startAngle = 2.3 * Math.PI;
- var endAngle = 0;
- var counterClockwise = false;
- var curPerc = animationstep === 0.0 ? endPercent : 0.0;
- var curStep = Math.max(animationstep, 0.0);
- var circ = Math.PI * 2;
- var quart = Math.PI / 2;
- var type = '';
- var fill = false;
-
- if($(this).data('type') != undefined) {
- type = $(this).data('type');
-
- if(type == 'half') {
- var startAngle = 2.0 * Math.PI;
- var endAngle = 3.13;
- var circ = Math.PI * 1.0;
- var quart = Math.PI / 0.996;
- }
- }
-
- if($(this).data('fill') != undefined) {
- fill = $(this).data('fill');
- } else {
- fill = settings.fillColor;
- }
- //animate foreground circle
- function animate(current) {
- context.clearRect(0, 0, canvas.width, canvas.height);
-
- context.beginPath();
- context.arc(x, y, radius, endAngle, startAngle, false);
- context.lineWidth = width - 1;
-
- // line color
- context.strokeStyle = bgcolor;
- context.stroke();
-
- if(fill) {
- context.fillStyle = fill;
- context.fill();
- }
-
- context.beginPath();
- context.arc(x, y, radius, -(quart), ((circ) * current) - quart, false);
- context.lineWidth = width;
- // line color
- context.strokeStyle = fgcolor;
- context.stroke();
-
- if (curPerc < endPercent) {
- curPerc += curStep;
- // requestAnimationFrame(function () {
- animate(Math.min(curPerc, endPercent) / 100);
- //});
- }
-
- }
-
- animate(curPerc / 100);
-
- });
-
- };
-
-}( jQuery ));
\ No newline at end of file
diff --git a/vendor/lotofbadcode/phpspirit_databackup/demo/js/jquery.circliful.min.js b/vendor/lotofbadcode/phpspirit_databackup/demo/js/jquery.circliful.min.js
deleted file mode 100644
index 2cadf09..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/demo/js/jquery.circliful.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(a){a.fn.circliful=function(b){var c=a.extend({foregroundColor:"#556b2f",backgroundColor:"#eee",fillColor:false,width:15,dimension:200,size:15,percent:50,animationStep:1},b);return this.each(function(){var F="";var s="";var E="";var v="";var t=0;var e=0;var l=100;var B="";var d="";var D="";var q=0;a(this).addClass("circliful");if(a(this).data("dimension")!=undefined){F=a(this).data("dimension")}else{F=c.dimension}if(a(this).data("width")!=undefined){v=a(this).data("width")}else{v=c.width}if(a(this).data("fontsize")!=undefined){t=a(this).data("fontsize")}else{t=c.size}if(a(this).data("percent")!=undefined){e=a(this).data("percent")/100;l=a(this).data("percent")}else{e=c.percent/100}if(a(this).data("fgcolor")!=undefined){B=a(this).data("fgcolor")}else{B=c.foregroundColor}if(a(this).data("bgcolor")!=undefined){d=a(this).data("bgcolor")}else{d=c.backgroundColor}if(a(this).data("animation-step")!=undefined){q=parseFloat(a(this).data("animation-step"))}else{q=c.animationStep}if(a(this).data("text")!=undefined){s=a(this).data("text");if(a(this).data("icon")!=undefined){D=' '}if(a(this).data("type")!=undefined){i=a(this).data("type");if(i=="half"){a(this).append(''+D+s+" ");a(this).find(".circle-text-half").css({"line-height":(F/1.45)+"px","font-size":t+"px"})}else{a(this).append(''+D+s+" ");a(this).find(".circle-text").css({"line-height":F+"px","font-size":t+"px"})}}else{a(this).append(''+D+s+" ");a(this).find(".circle-text").css({"line-height":F+"px","font-size":t+"px"})}}else{if(a(this).data("icon")!=undefined){}}if(a(this).data("info")!=undefined){E=a(this).data("info");if(a(this).data("type")!=undefined){i=a(this).data("type");if(i=="half"){a(this).append(''+E+" ");a(this).find(".circle-info-half").css({"line-height":(F*0.9)+"px",})}else{a(this).append(''+E+" ");a(this).find(".circle-info").css({"line-height":(F*1.25)+"px",})}}else{a(this).append(''+E+" ");a(this).find(".circle-info").css({"line-height":(F*1.25)+"px",})}}a(this).width(F+"px");var h=a(" ").attr({width:F,height:F}).appendTo(a(this)).get(0);var f=h.getContext("2d");var p=h.width/2;var o=h.height/2;var A=e*360;var G=A*(Math.PI/180);var j=h.width/2.5;var z=2.3*Math.PI;var u=0;var C=false;var m=q===0?l:0;var n=Math.max(q,0);var r=Math.PI*2;var g=Math.PI/2;var i="";var w=false;if(a(this).data("type")!=undefined){i=a(this).data("type");if(i=="half"){var z=2*Math.PI;var u=3.13;var r=Math.PI*1;var g=Math.PI/0.996}}if(a(this).data("fill")!=undefined){w=a(this).data("fill")}else{w=c.fillColor}function k(x){f.clearRect(0,0,h.width,h.height);f.beginPath();f.arc(p,o,j,u,z,false);f.lineWidth=v-1;f.strokeStyle=d;f.stroke();if(w){f.fillStyle=w;f.fill()}f.beginPath();f.arc(p,o,j,-(g),((r)*x)-g,false);f.lineWidth=v;f.strokeStyle=B;f.stroke();if(m
-
- 数据恢复
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/vendor/lotofbadcode/phpspirit_databackup/demo/recovery.php b/vendor/lotofbadcode/phpspirit_databackup/demo/recovery.php
deleted file mode 100644
index 012ddc1..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/demo/recovery.php
+++ /dev/null
@@ -1,25 +0,0 @@
-setSqlfiledir(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'backup'.DIRECTORY_SEPARATOR.'20191205010418');
-
-
-do
-{
- $result = $recovery->recovery();
- echo str_repeat(' ', 1000); //这里会把浏览器缓存装满
- ob_flush(); //把php缓存写入apahce缓存
- flush(); //把apahce缓存写入浏览器缓存
- if ($result['totalpercentage'] > 0)
- {
- echo '完成' . $result['totalpercentage'] . '% ';
- }
-} while ($result['totalpercentage'] < 100);
diff --git a/vendor/lotofbadcode/phpspirit_databackup/demo/recoveryajax.php b/vendor/lotofbadcode/phpspirit_databackup/demo/recoveryajax.php
deleted file mode 100644
index f8eb1ab..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/demo/recoveryajax.php
+++ /dev/null
@@ -1,13 +0,0 @@
-setSqlfiledir(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'backup'.DIRECTORY_SEPARATOR.'20191205010418')
- ->ajaxrecovery($_POST);
-
-echo json_encode($result);
diff --git a/vendor/lotofbadcode/phpspirit_databackup/src/BackupFactory.php b/vendor/lotofbadcode/phpspirit_databackup/src/BackupFactory.php
deleted file mode 100644
index 463f9aa..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/src/BackupFactory.php
+++ /dev/null
@@ -1,25 +0,0 @@
- "SET NAMES'" . $code . "';"]);
- self::$instance[$args] = new Backup($pdo);
- }
- }
- return self::$instance[$args];
- }
-}
diff --git a/vendor/lotofbadcode/phpspirit_databackup/src/IBackup.php b/vendor/lotofbadcode/phpspirit_databackup/src/IBackup.php
deleted file mode 100644
index cec3d21..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/src/IBackup.php
+++ /dev/null
@@ -1,36 +0,0 @@
- "SET NAMES'" . $code . "';"]);
- self::$instance[$args] = new Recovery($pdo);
- }
- }
- return self::$instance[$args];
- }
-}
diff --git a/vendor/lotofbadcode/phpspirit_databackup/src/mysql/Backup.php b/vendor/lotofbadcode/phpspirit_databackup/src/mysql/Backup.php
deleted file mode 100644
index e0b1b77..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/src/mysql/Backup.php
+++ /dev/null
@@ -1,347 +0,0 @@
-_pdo = $pdo;
- }
-
- public function setvolsize($size)
- {
- $this->_volsize = $size;
- return $this;
- }
-
- public function settablelist($tablelist = [])
- {
- $this->_tablelist = $tablelist;
- return $this;
- }
-
- public function gettablelist()
- {
- if (!$this->_tablelist) {
- $rs = $this->_pdo->query('show table status');
- $res = $rs->fetchAll(PDO::FETCH_ASSOC);
- foreach ($res as $r) {
- $this->_tablelist[] = $r['Name'];
- }
- }
- return $this->_tablelist;
- }
-
- /**
- * 设置备份目录
- */
- public function setbackdir($dir)
- {
- if ($this->_backdir) {
- return $this;
- }
- $this->_backdir = $dir;
- if (!is_dir($dir)) {
- mkdir($dir, 0777);
- }
- return $this;
- }
-
- public function getbackdir()
- {
- return $this->_backdir;
- }
-
- /**
- * 设置文件名
- * @param string $filename
- * @return $this
- */
- public function setfilename($filename)
- {
-
- $this->_filename = $filename;
- if (!is_file($this->_backdir . '/' . $this->_filename)) {
- fopen($this->_backdir . '/' . $this->_filename, "x+");
- }
- // return $this;
- }
-
- /**
- * 获取文件名
- * @return string
- */
- public function getfilename()
- {
- if (!$this->_filename) {
- $this->_filename = isset($this->_tablelist[$this->_nowtableidx]) ? $this->_tablelist[$this->_nowtableidx] . '#0.sql' : '';
- }
- if (!is_file($this->_backdir . '/' . $this->_filename)) {
- fopen($this->_backdir . '/' . $this->_filename, "x+");
- }
- return $this->_filename;
- }
-
-
-
- /**
- * 设置是否仅备份结构
- */
- public function setonlystructure($bool)
- {
- $this->_onlystructure = $bool;
- return $this;
- }
-
- public function getonlystructure()
- {
- return $this->_onlystructure;
- }
-
-
- /**
- * 设置仅备份表结构 不备份数据的表
- */
- public function setstructuretable($table = [])
- {
- $this->_structuretable = $table;
- return $this;
- }
-
- public function getstructuretable()
- {
- return $this->_structuretable;
- }
- /**
- * 备份
- *
- * 正在备份的表
- * 正在备份的表的索引
- * 正在备份的表已备份的记录数
- * 正在备份的表总记录数
- * 当前备份表百分比
- * 总百分比
- */
- public function backup()
- {
- $totalpercentage = 100; //默认总百分比 0%
- $tablelist = $this->gettablelist(); //所有的表列表
-
- $nowtable = '';
-
- //上一次备份的表完成100% 将备份下一个表
- if (
- $this->_nowtablepercentage >= 100 &&
- isset($tablelist[$this->_nowtableidx + 1])
- ) {
- $this->_nowtableidx = $this->_nowtableidx + 1;
- $this->_nowtableexeccount = $this->_nowtabletotal = 0;
- $this->setfilename($tablelist[$this->_nowtableidx] . '#0.sql');
- }
-
- //备份表开始 默认第一个
- if (isset($tablelist[$this->_nowtableidx])) {
-
- $nowtable = $tablelist[$this->_nowtableidx]; //当前正在备份的表
-
- $sqlstr = '';
- if ($this->_nowtableexeccount == 0) { //将要执行表已备份的sql记录数
- //Drop 建表
- $sqlstr .= 'DROP TABLE IF EXISTS `' . $nowtable . '`;' . PHP_EOL;
- $rs = $this->_pdo->query('SHOW CREATE TABLE `' . $nowtable . '`');
- $res = $rs->fetchAll();
- $sqlstr .= $res[0][1] . ';' . PHP_EOL;
- file_put_contents($this->_backdir . DIRECTORY_SEPARATOR . $this->getfilename(), file_get_contents($this->_backdir . DIRECTORY_SEPARATOR . $this->getfilename()) . $sqlstr);
-
- if ($this->getonlystructure() === false && !in_array($nowtable, $this->getstructuretable())) {
- $this->gettabletotal($nowtable); //当前备份表总条数
- }
- }
-
- if ($this->_nowtableexeccount < $this->_nowtabletotal) {
-
- //建记录SQL语句 并设置已经备份的条数
- $this->_singleinsertrecord($nowtable, $this->_nowtableexeccount);
- }
-
-
- //计算单表百分比
- if ($this->_nowtabletotal != 0) {
- $this->_nowtablepercentage = $this->_nowtableexeccount / $this->_nowtabletotal * 100;
- } else {
- $this->_nowtablepercentage = 100;
- }
-
- if ($this->_nowtablepercentage == 100) {
- $totalpercentage = ($this->_nowtableidx + 1) / count($tablelist) * 100;
- } else {
- $totalpercentage = ($this->_nowtableidx) / count($tablelist) * 100;
- }
- }
-
- return [
- 'nowtable' => $nowtable, //当前正在备份的表
- 'nowtableidx' => $this->_nowtableidx, //当前正在备份表的索引
- 'nowtableexeccount' => $this->_nowtableexeccount, //当前表已备份条数
- 'nowtabletotal' => $this->_nowtabletotal, //当前表总条数
- 'totalpercentage' => (int) $totalpercentage, //总百分比
- 'tablepercentage' => (int) $this->_nowtablepercentage, //当前表百分比
- 'backfilename' => $this->getfilename(),
- ];
- }
-
- public function ajaxbackup($preresult = [])
- {
-
- if ($this->getbackdir() == '' && !isset($preresult['backdir'])) {
- throw new Exception('请先设置备份目录');
- }
-
- if (isset($preresult['backdir'])) {
- $this->setbackdir($preresult['backdir']);
- }
- unset($preresult['backdir']);
- if ($preresult) {
- $this->_nowtableidx = $preresult['nowtableidx'];
- $this->_nowtableexeccount = $preresult['nowtableexeccount'];
- $this->_nowtabletotal = $preresult['nowtabletotal'];
- $this->_nowtablepercentage = (int) $preresult['tablepercentage'];
- $this->setfilename($preresult['backfilename']);
- }
-
- $result = $this->backup();
- $result['backdir'] = $this->getbackdir();
- return $result;
- }
-
- //获取表中总条数
- public function gettabletotal($table)
- {
- $value = $this->_pdo->query('select count(*) from ' . $table);
- $counts = $value->fetchAll(PDO::FETCH_NUM);
- return $this->_nowtabletotal = $counts[0][0];
- }
-
- private function _singleinsertrecord($tablename, $limit)
- {
- $sql = 'select * from `' . $tablename . '` limit ' . $limit . ',' . $this->_totallimit;
- $valuers = $this->_pdo->query($sql);
- $valueres = $valuers->fetchAll(PDO::FETCH_NUM);
- $insertsqlv = '';
- $insertsql = 'insert into `' . $tablename . '` VALUES ';
- foreach ($valueres as $v) {
- $insertsqlv .= ' ( ';
-
- foreach ($v as $_v) {
- $insertsqlv .= $this->_pdo->quote($_v) . ",";
- }
- $insertsqlv = rtrim($insertsqlv, ',');
- $insertsqlv .= ' ),';
- }
- $insertsql .= rtrim($insertsqlv, ',') . ' ;' . PHP_EOL;
- $this->_checkfilesize();
- file_put_contents($this->_backdir . '/' . $this->getfilename(), file_get_contents($this->_backdir . '/' . $this->getfilename()) . $insertsql);
- $this->_nowtableexeccount += $this->_totallimit;
- $this->_nowtableexeccount = $this->_nowtableexeccount >= $this->_nowtabletotal ? $this->_nowtabletotal : $this->_nowtableexeccount;
- }
-
- /**
- * 检查文件大小
- */
- private function _checkfilesize()
- {
- clearstatcache();
- $b = filesize($this->_backdir . '/' . $this->getfilename()) < $this->_volsize * 1024 * 1024 ? true : false;
- if ($b === false) {
- $filearr = explode('#', $this->getfilename());
- if (count($filearr) == 2) {
- $fileext = explode('.', $filearr[1]); //.sql
- $filename = $filearr[0] . '#' . ($fileext[0] + 1) . '.sql';
- $this->setfilename($filename);
- }
- }
- }
-}
diff --git a/vendor/lotofbadcode/phpspirit_databackup/src/mysql/Recovery.php b/vendor/lotofbadcode/phpspirit_databackup/src/mysql/Recovery.php
deleted file mode 100644
index a54b9f1..0000000
--- a/vendor/lotofbadcode/phpspirit_databackup/src/mysql/Recovery.php
+++ /dev/null
@@ -1,126 +0,0 @@
-_pdo = $pdo;
- }
-
- public function setSqlfiledir($dir)
- {
- $this->_sqlfiledir = $dir;
- return $this;
- }
-
- public function getfiles()
- {
- if (!$this->_sqlfilesarr) {
- $dir = $this->_sqlfiledir;
- $iterator = new \DirectoryIterator($dir);
- $filesarr = [];
- foreach ($iterator as $it) {
- if (!$it->isDot()) {
- $filenameinfo = explode('#', $it->getFilename());
- $fileext = explode('.', $filenameinfo[1]);
- $filesarr[$filenameinfo[0]][$fileext[0]] = $it->getFilename();
- }
- }
- ksort($filesarr);
- foreach ($filesarr as $k => $f) {
- ksort($f);
- $filesarr[$k] = $f;
- }
- foreach ($filesarr as $f) {
- foreach ($f as $_f) {
- $this->_sqlfilesarr[] = $_f;
- }
- }
- }
- return $this->_sqlfilesarr;
- }
-
- public function recovery()
- {
- try {
- $filesarr = $this->getfiles();
- $totalpercentage = 100;
- $this->_nowfileidx = $this->_nextfileidx;
- if (isset($filesarr[$this->_nowfileidx])) {
- $this->_importsqlfile($this->_sqlfiledir . DIRECTORY_SEPARATOR . $filesarr[$this->_nowfileidx]);
- $totalpercentage = $this->_nowfileidx / count($this->_sqlfilesarr) * 100;
- $this->_nextfileidx = $this->_nowfileidx + 1;
- }
- return [
- 'nowfileidex' => $this->_nowfileidx, //当前正在恢复的文件
- 'nextfileidx' => $this->_nextfileidx,
- 'totalpercentage' => (int) $totalpercentage, //总百分比
- ];
- } catch (Exception $ex) {
- throw $ex;
- }
- }
-
- public function ajaxrecovery($preresult = [])
- {
- if($preresult)
- {
- $this->_nowfileidx = $preresult['nowfileidex'];
- $this->_nextfileidx = $preresult['nextfileidx'];
- }
- $result = $this->recovery();
- return $result;
- }
-
- private function _importsqlfile($sqlfile)
- {
- if (is_file($sqlfile)) {
- try {
- $content = file_get_contents($sqlfile);
- $arr = explode(';' . PHP_EOL, $content);
- foreach ($arr as $a) {
- if (trim($a) != '') {
- $this->_pdo->exec($a);
- }
- }
- } catch (Exception $ex) {
- return false;
- }
- }
- return true;
- }
-}
diff --git a/vendor/php-di/invoker/.github/CONTRIBUTING.md b/vendor/php-di/invoker/.github/CONTRIBUTING.md
deleted file mode 100644
index 7ff968f..0000000
--- a/vendor/php-di/invoker/.github/CONTRIBUTING.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Contributing
-
-First of all, **thank you** for contributing!
-
-Here are a few rules to follow in order to ease code reviews and merging:
-
-- follow the coding standard of the project
-- run the test suite
-- write (or update) tests when applicable
-- write documentation for new features
-- use [commit messages that make sense](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
-
-When creating your pull request on GitHub, please write a description which gives the context and/or explains why you are creating it.
diff --git a/vendor/php-di/invoker/.github/FUNDING.yml b/vendor/php-di/invoker/.github/FUNDING.yml
deleted file mode 100644
index 12bc4cd..0000000
--- a/vendor/php-di/invoker/.github/FUNDING.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-# These are supported funding model platforms
-
-github: mnapoli # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
-patreon: # Replace with a single Patreon username
-open_collective: # Replace with a single Open Collective username
-ko_fi: # Replace with a single Ko-fi username
-tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
-community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
-liberapay: # Replace with a single Liberapay username
-issuehunt: # Replace with a single IssueHunt username
-otechie: # Replace with a single Otechie username
-custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/vendor/php-di/invoker/.github/pull_request_template.md b/vendor/php-di/invoker/.github/pull_request_template.md
deleted file mode 100644
index 712d96f..0000000
--- a/vendor/php-di/invoker/.github/pull_request_template.md
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/vendor/php-di/invoker/.github/workflows/ci.yml b/vendor/php-di/invoker/.github/workflows/ci.yml
deleted file mode 100644
index 33c8111..0000000
--- a/vendor/php-di/invoker/.github/workflows/ci.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-name: CI
-
-on:
- push:
- branches: ['master']
- pull_request:
- branches: ['*']
- schedule:
- - cron: '0 0 * * *'
-
-jobs:
-
- tests:
- name: Tests - PHP ${{ matrix.php }} ${{ matrix.dependency-version }}
- runs-on: ubuntu-latest
- timeout-minutes: 15
- strategy:
- matrix:
- php: [ '7.3', '7.4', '8.0' ]
- dependency-version: [ '' ]
- include:
- - php: '7.3'
- dependency-version: '--prefer-lowest'
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Setup PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: ${{ matrix.php }}
- tools: composer:v2
- coverage: none
- - name: Cache Composer dependencies
- uses: actions/cache@v2
- with:
- path: ~/.composer/cache
- key: php-${{ matrix.php }}-composer-locked-${{ hashFiles('composer.lock') }}
- restore-keys: php-${{ matrix.php }}-composer-locked-
- - name: Install PHP dependencies
- run: composer update ${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress --no-suggest
- - name: PHPUnit
- run: vendor/bin/phpunit
-
- cs:
- name: Coding standards
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Setup PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: 7.4
- tools: composer:v2, cs2pr
- coverage: none
- - name: Cache Composer dependencies
- uses: actions/cache@v2
- with:
- path: ~/.composer/cache
- key: php-composer-locked-${{ hashFiles('composer.lock') }}
- restore-keys: php-composer-locked-
- - name: Install PHP dependencies
- run: composer install --no-interaction --no-progress --no-suggest
- - name: PHP CodeSniffer
- run: vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr
diff --git a/vendor/php-di/invoker/.phpcs.xml.dist b/vendor/php-di/invoker/.phpcs.xml.dist
deleted file mode 100644
index 9e33c11..0000000
--- a/vendor/php-di/invoker/.phpcs.xml.dist
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
- src
-
-
-
-
- src/ParameterResolver/ParameterResolver.php
-
-
-
- 0
-
-
- 0
-
-
-
diff --git a/vendor/php-di/invoker/CONTRIBUTING.md b/vendor/php-di/invoker/CONTRIBUTING.md
deleted file mode 100644
index 852fd1a..0000000
--- a/vendor/php-di/invoker/CONTRIBUTING.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Contributing
-
-First of all, **thank you** for contributing!
-
-Here are a few rules to follow in order to ease code reviews and merging:
-
-- follow [PSR-1](http://www.php-fig.org/psr/1/) and [PSR-2](http://www.php-fig.org/psr/2/)
-- run the test suite
-- write (or update) unit tests when applicable
-- write documentation for new features
-- use [commit messages that make sense](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
-
-One may ask you to [squash your commits](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) too. This is used to "clean" your pull request before merging it (we don't want commits such as `fix tests`, `fix 2`, `fix 3`, etc.).
-
-When creating your pull request on GitHub, please write a description which gives the context and/or explains why you are creating it.
diff --git a/vendor/php-di/invoker/LICENSE b/vendor/php-di/invoker/LICENSE
deleted file mode 100644
index b2b0416..0000000
--- a/vendor/php-di/invoker/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Matthieu Napoli
-
-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.
diff --git a/vendor/php-di/invoker/README.md b/vendor/php-di/invoker/README.md
deleted file mode 100644
index 34bc22e..0000000
--- a/vendor/php-di/invoker/README.md
+++ /dev/null
@@ -1,233 +0,0 @@
-# Invoker
-
-Generic and extensible callable invoker.
-
-[](https://travis-ci.org/PHP-DI/Invoker)
-[](https://packagist.org/packages/PHP-DI/invoker)
-[](https://packagist.org/packages/php-di/invoker)
-
-## Why?
-
-Who doesn't need an over-engineered `call_user_func()`?
-
-### Named parameters
-
-Does this [Silex](http://silex.sensiolabs.org) example look familiar:
-
-```php
-$app->get('/project/{project}/issue/{issue}', function ($project, $issue) {
- // ...
-});
-```
-
-Or this command defined with [Silly](https://github.com/mnapoli/silly#usage):
-
-```php
-$app->command('greet [name] [--yell]', function ($name, $yell) {
- // ...
-});
-```
-
-Same pattern in [Slim](http://www.slimframework.com):
-
-```php
-$app->get('/hello/:name', function ($name) {
- // ...
-});
-```
-
-You get the point. These frameworks invoke the controller/command/handler using something akin to named parameters: whatever the order of the parameters, they are matched by their name.
-
-**This library allows to invoke callables with named parameters in a generic and extensible way.**
-
-### Dependency injection
-
-Anyone familiar with AngularJS is familiar with how dependency injection is performed:
-
-```js
-angular.controller('MyController', ['dep1', 'dep2', function(dep1, dep2) {
- // ...
-}]);
-```
-
-In PHP we find this pattern again in some frameworks and DI containers with partial to full support. For example in Silex you can type-hint the application to get it injected, but it only works with `Silex\Application`:
-
-```php
-$app->get('/hello/{name}', function (Silex\Application $app, $name) {
- // ...
-});
-```
-
-In Silly, it only works with `OutputInterface` to inject the application output:
-
-```php
-$app->command('greet [name]', function ($name, OutputInterface $output) {
- // ...
-});
-```
-
-[PHP-DI](http://php-di.org/doc/container.html) provides a way to invoke a callable and resolve all dependencies from the container using type-hints:
-
-```php
-$container->call(function (Logger $logger, EntityManager $em) {
- // ...
-});
-```
-
-**This library provides clear extension points to let frameworks implement any kind of dependency injection support they want.**
-
-### TL/DR
-
-In short, this library is meant to be a base building block for calling a function with named parameters and/or dependency injection.
-
-## Installation
-
-```sh
-$ composer require PHP-DI/invoker
-```
-
-## Usage
-
-### Default behavior
-
-By default the `Invoker` can call using named parameters:
-
-```php
-$invoker = new Invoker\Invoker;
-
-$invoker->call(function () {
- echo 'Hello world!';
-});
-
-// Simple parameter array
-$invoker->call(function ($name) {
- echo 'Hello ' . $name;
-}, ['John']);
-
-// Named parameters
-$invoker->call(function ($name) {
- echo 'Hello ' . $name;
-}, [
- 'name' => 'John'
-]);
-
-// Use the default value
-$invoker->call(function ($name = 'world') {
- echo 'Hello ' . $name;
-});
-
-// Invoke any PHP callable
-$invoker->call(['MyClass', 'myStaticMethod']);
-
-// Using Class::method syntax
-$invoker->call('MyClass::myStaticMethod');
-```
-
-Dependency injection in parameters is supported but needs to be configured with your container. Read on or jump to [*Built-in support for dependency injection*](#built-in-support-for-dependency-injection) if you are impatient.
-
-Additionally, callables can also be resolved from your container. Read on or jump to [*Resolving callables from a container*](#resolving-callables-from-a-container) if you are impatient.
-
-### Parameter resolvers
-
-Extending the behavior of the `Invoker` is easy and is done by implementing a [`ParameterResolver`](https://github.com/PHP-DI/Invoker/blob/master/src/ParameterResolver/ParameterResolver.php).
-
-This is explained in details the [Parameter resolvers documentation](doc/parameter-resolvers.md).
-
-#### Built-in support for dependency injection
-
-Rather than have you re-implement support for dependency injection with different containers every time, this package ships with 2 optional resolvers:
-
-- [`TypeHintContainerResolver`](https://github.com/PHP-DI/Invoker/blob/master/src/ParameterResolver/Container/TypeHintContainerResolver.php)
-
- This resolver will inject container entries by searching for the class name using the type-hint:
-
- ```php
- $invoker->call(function (Psr\Logger\LoggerInterface $logger) {
- // ...
- });
- ```
-
- In this example it will `->get('Psr\Logger\LoggerInterface')` from the container and inject it.
-
- This resolver is only useful if you store objects in your container using the class (or interface) name. Silex or Symfony for example store services under a custom name (e.g. `twig`, `db`, etc.) instead of the class name: in that case use the resolver shown below.
-
-- [`ParameterNameContainerResolver`](https://github.com/PHP-DI/Invoker/blob/master/src/ParameterResolver/Container/ParameterNameContainerResolver.php)
-
- This resolver will inject container entries by searching for the name of the parameter:
-
- ```php
- $invoker->call(function ($twig) {
- // ...
- });
- ```
-
- In this example it will `->get('twig')` from the container and inject it.
-
-These resolvers can work with any dependency injection container compliant with [PSR-11](http://www.php-fig.org/psr/psr-11/).
-
-Setting up those resolvers is simple:
-
-```php
-// $container must be an instance of Psr\Container\ContainerInterface
-$container = ...
-
-$containerResolver = new TypeHintContainerResolver($container);
-// or
-$containerResolver = new ParameterNameContainerResolver($container);
-
-$invoker = new Invoker\Invoker;
-// Register it before all the other parameter resolvers
-$invoker->getParameterResolver()->prependResolver($containerResolver);
-```
-
-You can also register both resolvers at the same time if you wish by prepending both. Implementing support for more tricky things is easy and up to you!
-
-### Resolving callables from a container
-
-The `Invoker` can be wired to your DI container to resolve the callables.
-
-For example with an invokable class:
-
-```php
-class MyHandler
-{
- public function __invoke()
- {
- // ...
- }
-}
-
-// By default this doesn't work: an instance of the class should be provided
-$invoker->call('MyHandler');
-
-// If we set up the container to use
-$invoker = new Invoker\Invoker(null, $container);
-// Now 'MyHandler' is resolved using the container!
-$invoker->call('MyHandler');
-```
-
-The same works for a class method:
-
-```php
-class WelcomeController
-{
- public function home()
- {
- // ...
- }
-}
-
-// By default this doesn't work: home() is not a static method
-$invoker->call(['WelcomeController', 'home']);
-
-// If we set up the container to use
-$invoker = new Invoker\Invoker(null, $container);
-// Now 'WelcomeController' is resolved using the container!
-$invoker->call(['WelcomeController', 'home']);
-// Alternatively we can use the Class::method syntax
-$invoker->call('WelcomeController::home');
-```
-
-That feature can be used as the base building block for a framework's dispatcher.
-
-Again, any [PSR-11](http://www.php-fig.org/psr/psr-11/) compliant container can be provided.
diff --git a/vendor/php-di/invoker/composer.json b/vendor/php-di/invoker/composer.json
deleted file mode 100644
index e78e406..0000000
--- a/vendor/php-di/invoker/composer.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "php-di/invoker",
- "description": "Generic and extensible callable invoker",
- "keywords": ["invoker", "dependency-injection", "dependency", "injection", "callable", "invoke"],
- "homepage": "https://github.com/PHP-DI/Invoker",
- "license": "MIT",
- "type": "library",
- "autoload": {
- "psr-4": {
- "Invoker\\": "src/"
- }
- },
- "autoload-dev": {
- "psr-4": {
- "Invoker\\Test\\": "tests/"
- }
- },
- "require": {
- "php": ">=7.3",
- "psr/container": "^1.0|^2.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.0",
- "athletic/athletic": "~0.1.8",
- "mnapoli/hard-mode": "~0.3.0"
- }
-}
diff --git a/vendor/php-di/invoker/doc/parameter-resolvers.md b/vendor/php-di/invoker/doc/parameter-resolvers.md
deleted file mode 100644
index bfccb7f..0000000
--- a/vendor/php-di/invoker/doc/parameter-resolvers.md
+++ /dev/null
@@ -1,109 +0,0 @@
-# Parameter resolvers
-
-Extending the behavior of the `Invoker` is easy and is done by implementing a [`ParameterResolver`](https://github.com/PHP-DI/Invoker/blob/master/src/ParameterResolver/ParameterResolver.php):
-
-```php
-interface ParameterResolver
-{
- public function getParameters(
- ReflectionFunctionAbstract $reflection,
- array $providedParameters,
- array $resolvedParameters
- );
-}
-```
-
-- `$providedParameters` contains the parameters provided by the user when calling `$invoker->call($callable, $parameters)`
-- `$resolvedParameters` contains parameters that have already been resolved by other parameter resolvers
-
-An `Invoker` can chain multiple parameter resolvers to mix behaviors, e.g. you can mix "named parameters" support with "dependency injection" support. This is why a `ParameterResolver` should skip parameters that are already resolved in `$resolvedParameters`.
-
-Here is an implementation example for dumb dependency injection that creates a new instance of the classes type-hinted:
-
-```php
-class MyParameterResolver implements ParameterResolver
-{
- public function getParameters(
- ReflectionFunctionAbstract $reflection,
- array $providedParameters,
- array $resolvedParameters
- ) {
- foreach ($reflection->getParameters() as $index => $parameter) {
- if (array_key_exists($index, $resolvedParameters)) {
- // Skip already resolved parameters
- continue;
- }
-
- $class = $parameter->getClass();
-
- if ($class) {
- $resolvedParameters[$index] = $class->newInstance();
- }
- }
-
- return $resolvedParameters;
- }
-}
-```
-
-To use it:
-
-```php
-$invoker = new Invoker\Invoker(new MyParameterResolver);
-
-$invoker->call(function (ArticleManager $articleManager) {
- $articleManager->publishArticle('Hello world', 'This is the article content.');
-});
-```
-
-A new instance of `ArticleManager` will be created by our parameter resolver.
-
-## Chaining parameter resolvers
-
-The fun starts to happen when we want to add support for many things:
-
-- named parameters
-- dependency injection for type-hinted parameters
-- ...
-
-This is where we should use the [`ResolverChain`](https://github.com/PHP-DI/Invoker/blob/master/src/ParameterResolver/ResolverChain.php). This resolver implements the [Chain of responsibility](http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern) design pattern.
-
-For example the default chain is:
-
-```php
-$parameterResolver = new ResolverChain([
- new NumericArrayResolver,
- new AssociativeArrayResolver,
- new DefaultValueResolver,
-]);
-```
-
-It allows to support even the weirdest use cases like:
-
-```php
-$parameters = [];
-
-// First parameter will receive "Welcome"
-$parameters[] = 'Welcome';
-
-// Parameter named "content" will receive "Hello world!"
-$parameters['content'] = 'Hello world!';
-
-// $published is not defined so it will use its default value
-$invoker->call(function ($title, $content, $published = true) {
- // ...
-}, $parameters);
-```
-
-We can put our custom parameter resolver in the list and created a super-duper invoker that also supports basic dependency injection:
-
-```php
-$parameterResolver = new ResolverChain([
- new MyParameterResolver, // Our resolver is at the top for highest priority
- new NumericArrayResolver,
- new AssociativeArrayResolver,
- new DefaultValueResolver,
-]);
-
-$invoker = new Invoker\Invoker($parameterResolver);
-```
diff --git a/vendor/php-di/invoker/src/CallableResolver.php b/vendor/php-di/invoker/src/CallableResolver.php
deleted file mode 100644
index e3b11b2..0000000
--- a/vendor/php-di/invoker/src/CallableResolver.php
+++ /dev/null
@@ -1,124 +0,0 @@
-container = $container;
- }
-
- /**
- * Resolve the given callable into a real PHP callable.
- *
- * @param callable|string|array $callable
- * @return callable Real PHP callable.
- * @throws NotCallableException|ReflectionException
- */
- public function resolve($callable): callable
- {
- if (is_string($callable) && strpos($callable, '::') !== false) {
- $callable = explode('::', $callable, 2);
- }
-
- $callable = $this->resolveFromContainer($callable);
-
- if (! is_callable($callable)) {
- throw NotCallableException::fromInvalidCallable($callable, true);
- }
-
- return $callable;
- }
-
- /**
- * @param callable|string|array $callable
- * @return callable|mixed
- * @throws NotCallableException|ReflectionException
- */
- private function resolveFromContainer($callable)
- {
- // Shortcut for a very common use case
- if ($callable instanceof Closure) {
- return $callable;
- }
-
- // If it's already a callable there is nothing to do
- if (is_callable($callable)) {
- // TODO with PHP 8 that should not be necessary to check this anymore
- if (! $this->isStaticCallToNonStaticMethod($callable)) {
- return $callable;
- }
- }
-
- // The callable is a container entry name
- if (is_string($callable)) {
- try {
- return $this->container->get($callable);
- } catch (NotFoundExceptionInterface $e) {
- if ($this->container->has($callable)) {
- throw $e;
- }
- throw NotCallableException::fromInvalidCallable($callable, true);
- }
- }
-
- // The callable is an array whose first item is a container entry name
- // e.g. ['some-container-entry', 'methodToCall']
- if (is_array($callable) && is_string($callable[0])) {
- try {
- // Replace the container entry name by the actual object
- $callable[0] = $this->container->get($callable[0]);
- return $callable;
- } catch (NotFoundExceptionInterface $e) {
- if ($this->container->has($callable[0])) {
- throw $e;
- }
- throw new NotCallableException(sprintf(
- 'Cannot call %s() on %s because it is not a class nor a valid container entry',
- $callable[1],
- $callable[0]
- ));
- }
- }
-
- // Unrecognized stuff, we let it fail later
- return $callable;
- }
-
- /**
- * Check if the callable represents a static call to a non-static method.
- *
- * @param mixed $callable
- * @throws ReflectionException
- */
- private function isStaticCallToNonStaticMethod($callable): bool
- {
- if (is_array($callable) && is_string($callable[0])) {
- [$class, $method] = $callable;
-
- if (! method_exists($class, $method)) {
- return false;
- }
-
- $reflection = new ReflectionMethod($class, $method);
-
- return ! $reflection->isStatic();
- }
-
- return false;
- }
-}
diff --git a/vendor/php-di/invoker/src/Exception/InvocationException.php b/vendor/php-di/invoker/src/Exception/InvocationException.php
deleted file mode 100644
index 90f6585..0000000
--- a/vendor/php-di/invoker/src/Exception/InvocationException.php
+++ /dev/null
@@ -1,10 +0,0 @@
-parameterResolver = $parameterResolver ?: $this->createParameterResolver();
- $this->container = $container;
-
- if ($container) {
- $this->callableResolver = new CallableResolver($container);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function call($callable, array $parameters = [])
- {
- if ($this->callableResolver) {
- $callable = $this->callableResolver->resolve($callable);
- }
-
- if (! is_callable($callable)) {
- throw new NotCallableException(sprintf(
- '%s is not a callable',
- is_object($callable) ? 'Instance of ' . get_class($callable) : var_export($callable, true)
- ));
- }
-
- $callableReflection = CallableReflection::create($callable);
-
- $args = $this->parameterResolver->getParameters($callableReflection, $parameters, []);
-
- // Sort by array key because call_user_func_array ignores numeric keys
- ksort($args);
-
- // Check all parameters are resolved
- $diff = array_diff_key($callableReflection->getParameters(), $args);
- $parameter = reset($diff);
- if ($parameter && \assert($parameter instanceof ReflectionParameter) && ! $parameter->isVariadic()) {
- throw new NotEnoughParametersException(sprintf(
- 'Unable to invoke the callable because no value was given for parameter %d ($%s)',
- $parameter->getPosition() + 1,
- $parameter->name
- ));
- }
-
- return call_user_func_array($callable, $args);
- }
-
- /**
- * Create the default parameter resolver.
- */
- private function createParameterResolver(): ParameterResolver
- {
- return new ResolverChain([
- new NumericArrayResolver,
- new AssociativeArrayResolver,
- new DefaultValueResolver,
- ]);
- }
-
- /**
- * @return ParameterResolver By default it's a ResolverChain
- */
- public function getParameterResolver(): ParameterResolver
- {
- return $this->parameterResolver;
- }
-
- public function getContainer(): ?ContainerInterface
- {
- return $this->container;
- }
-
- /**
- * @return CallableResolver|null Returns null if no container was given in the constructor.
- */
- public function getCallableResolver(): ?CallableResolver
- {
- return $this->callableResolver;
- }
-}
diff --git a/vendor/php-di/invoker/src/InvokerInterface.php b/vendor/php-di/invoker/src/InvokerInterface.php
deleted file mode 100644
index 06f0064..0000000
--- a/vendor/php-di/invoker/src/InvokerInterface.php
+++ /dev/null
@@ -1,25 +0,0 @@
-call($callable, ['foo' => 'bar'])` will inject the string `'bar'`
- * in the parameter named `$foo`.
- *
- * Parameters that are not indexed by a string are ignored.
- */
-class AssociativeArrayResolver implements ParameterResolver
-{
- public function getParameters(
- ReflectionFunctionAbstract $reflection,
- array $providedParameters,
- array $resolvedParameters
- ): array {
- $parameters = $reflection->getParameters();
-
- // Skip parameters already resolved
- if (! empty($resolvedParameters)) {
- $parameters = array_diff_key($parameters, $resolvedParameters);
- }
-
- foreach ($parameters as $index => $parameter) {
- if (array_key_exists($parameter->name, $providedParameters)) {
- $resolvedParameters[$index] = $providedParameters[$parameter->name];
- }
- }
-
- return $resolvedParameters;
- }
-}
diff --git a/vendor/php-di/invoker/src/ParameterResolver/Container/ParameterNameContainerResolver.php b/vendor/php-di/invoker/src/ParameterResolver/Container/ParameterNameContainerResolver.php
deleted file mode 100644
index 126e14c..0000000
--- a/vendor/php-di/invoker/src/ParameterResolver/Container/ParameterNameContainerResolver.php
+++ /dev/null
@@ -1,47 +0,0 @@
-container = $container;
- }
-
- public function getParameters(
- ReflectionFunctionAbstract $reflection,
- array $providedParameters,
- array $resolvedParameters
- ): array {
- $parameters = $reflection->getParameters();
-
- // Skip parameters already resolved
- if (! empty($resolvedParameters)) {
- $parameters = array_diff_key($parameters, $resolvedParameters);
- }
-
- foreach ($parameters as $index => $parameter) {
- $name = $parameter->name;
-
- if ($name && $this->container->has($name)) {
- $resolvedParameters[$index] = $this->container->get($name);
- }
- }
-
- return $resolvedParameters;
- }
-}
diff --git a/vendor/php-di/invoker/src/ParameterResolver/Container/TypeHintContainerResolver.php b/vendor/php-di/invoker/src/ParameterResolver/Container/TypeHintContainerResolver.php
deleted file mode 100644
index 014956e..0000000
--- a/vendor/php-di/invoker/src/ParameterResolver/Container/TypeHintContainerResolver.php
+++ /dev/null
@@ -1,65 +0,0 @@
-container = $container;
- }
-
- public function getParameters(
- ReflectionFunctionAbstract $reflection,
- array $providedParameters,
- array $resolvedParameters
- ): array {
- $parameters = $reflection->getParameters();
-
- // Skip parameters already resolved
- if (! empty($resolvedParameters)) {
- $parameters = array_diff_key($parameters, $resolvedParameters);
- }
-
- foreach ($parameters as $index => $parameter) {
- $parameterType = $parameter->getType();
- if (! $parameterType) {
- // No type
- continue;
- }
- if (! $parameterType instanceof ReflectionNamedType) {
- // Union types are not supported
- continue;
- }
- if ($parameterType->isBuiltin()) {
- // Primitive types are not supported
- continue;
- }
-
- $parameterClass = $parameterType->getName();
- if ($parameterClass === 'self') {
- $parameterClass = $parameter->getDeclaringClass()->getName();
- }
-
- if ($this->container->has($parameterClass)) {
- $resolvedParameters[$index] = $this->container->get($parameterClass);
- }
- }
-
- return $resolvedParameters;
- }
-}
diff --git a/vendor/php-di/invoker/src/ParameterResolver/DefaultValueResolver.php b/vendor/php-di/invoker/src/ParameterResolver/DefaultValueResolver.php
deleted file mode 100644
index 3fdf7b7..0000000
--- a/vendor/php-di/invoker/src/ParameterResolver/DefaultValueResolver.php
+++ /dev/null
@@ -1,43 +0,0 @@
-getParameters();
-
- // Skip parameters already resolved
- if (! empty($resolvedParameters)) {
- $parameters = array_diff_key($parameters, $resolvedParameters);
- }
-
- foreach ($parameters as $index => $parameter) {
- \assert($parameter instanceof \ReflectionParameter);
- if ($parameter->isDefaultValueAvailable()) {
- try {
- $resolvedParameters[$index] = $parameter->getDefaultValue();
- } catch (ReflectionException $e) {
- // Can't get default values from PHP internal classes and functions
- }
- } else {
- $parameterType = $parameter->getType();
- if ($parameterType && $parameterType->allowsNull()) {
- $resolvedParameters[$index] = null;
- }
- }
- }
-
- return $resolvedParameters;
- }
-}
diff --git a/vendor/php-di/invoker/src/ParameterResolver/NumericArrayResolver.php b/vendor/php-di/invoker/src/ParameterResolver/NumericArrayResolver.php
deleted file mode 100644
index 07d8ece..0000000
--- a/vendor/php-di/invoker/src/ParameterResolver/NumericArrayResolver.php
+++ /dev/null
@@ -1,37 +0,0 @@
-call($callable, ['foo', 'bar'])` will simply resolve the parameters
- * to `['foo', 'bar']`.
- *
- * Parameters that are not indexed by a number (i.e. parameter position)
- * will be ignored.
- */
-class NumericArrayResolver implements ParameterResolver
-{
- public function getParameters(
- ReflectionFunctionAbstract $reflection,
- array $providedParameters,
- array $resolvedParameters
- ): array {
- // Skip parameters already resolved
- if (! empty($resolvedParameters)) {
- $providedParameters = array_diff_key($providedParameters, $resolvedParameters);
- }
-
- foreach ($providedParameters as $key => $value) {
- if (is_int($key)) {
- $resolvedParameters[$key] = $value;
- }
- }
-
- return $resolvedParameters;
- }
-}
diff --git a/vendor/php-di/invoker/src/ParameterResolver/ParameterResolver.php b/vendor/php-di/invoker/src/ParameterResolver/ParameterResolver.php
deleted file mode 100644
index 85046c3..0000000
--- a/vendor/php-di/invoker/src/ParameterResolver/ParameterResolver.php
+++ /dev/null
@@ -1,30 +0,0 @@
-resolvers = $resolvers;
- }
-
- public function getParameters(
- ReflectionFunctionAbstract $reflection,
- array $providedParameters,
- array $resolvedParameters
- ): array {
- $reflectionParameters = $reflection->getParameters();
-
- foreach ($this->resolvers as $resolver) {
- $resolvedParameters = $resolver->getParameters(
- $reflection,
- $providedParameters,
- $resolvedParameters
- );
-
- $diff = array_diff_key($reflectionParameters, $resolvedParameters);
- if (empty($diff)) {
- // Stop traversing: all parameters are resolved
- return $resolvedParameters;
- }
- }
-
- return $resolvedParameters;
- }
-
- /**
- * Push a parameter resolver after the ones already registered.
- */
- public function appendResolver(ParameterResolver $resolver): void
- {
- $this->resolvers[] = $resolver;
- }
-
- /**
- * Insert a parameter resolver before the ones already registered.
- */
- public function prependResolver(ParameterResolver $resolver): void
- {
- array_unshift($this->resolvers, $resolver);
- }
-}
diff --git a/vendor/php-di/invoker/src/ParameterResolver/TypeHintResolver.php b/vendor/php-di/invoker/src/ParameterResolver/TypeHintResolver.php
deleted file mode 100644
index 3ccc2e0..0000000
--- a/vendor/php-di/invoker/src/ParameterResolver/TypeHintResolver.php
+++ /dev/null
@@ -1,54 +0,0 @@
-getParameters();
-
- // Skip parameters already resolved
- if (! empty($resolvedParameters)) {
- $parameters = array_diff_key($parameters, $resolvedParameters);
- }
-
- foreach ($parameters as $index => $parameter) {
- $parameterType = $parameter->getType();
- if (! $parameterType) {
- // No type
- continue;
- }
- if (! $parameterType instanceof ReflectionNamedType) {
- // Union types are not supported
- continue;
- }
- if ($parameterType->isBuiltin()) {
- // Primitive types are not supported
- continue;
- }
-
- $parameterClass = $parameterType->getName();
- if ($parameterClass === 'self') {
- $parameterClass = $parameter->getDeclaringClass()->getName();
- }
-
- if (array_key_exists($parameterClass, $providedParameters)) {
- $resolvedParameters[$index] = $providedParameters[$parameterClass];
- }
- }
-
- return $resolvedParameters;
- }
-}
diff --git a/vendor/php-di/invoker/src/Reflection/CallableReflection.php b/vendor/php-di/invoker/src/Reflection/CallableReflection.php
deleted file mode 100644
index 3f19f33..0000000
--- a/vendor/php-di/invoker/src/Reflection/CallableReflection.php
+++ /dev/null
@@ -1,56 +0,0 @@
- DI\factory(function ($host) {...})
- ->parameter('host', DI\get('db.host')),
- ];
- ```
- Read the [factories documentation](https://php-di.org/doc/php-definitions.html#factories) to learn more. Feature implemented by [@predakanga](https://github.com/predakanga).
-
-Improvements:
-
-- [#429](https://github.com/PHP-DI/PHP-DI/pull/429): performance improvements in definition resolution (by [@mnapoli](https://github.com/mnapoli))
-- [#421](https://github.com/PHP-DI/PHP-DI/issues/421): once a `ContainerBuilder` has built a container, it is locked to prevent confusion when adding new definitions to it (by [@mnapoli](https://github.com/mnapoli))
-- [#423](https://github.com/PHP-DI/PHP-DI/pull/423): improved exception messages (by [@mnapoli](https://github.com/mnapoli))
-
-## 5.3
-
-Read the [news entry](news/19-php-di-5-3-released.md).
-
-- release of the [2.0 version](https://github.com/PHP-DI/Symfony-Bridge/releases/tag/2.0.0) of the Symfony bridge (by [@mnapoli](https://github.com/mnapoli))
-- PHP 5.5 or above is now required
-- a lot of documentation improvements by 9 different contributors
-- [#389](https://github.com/PHP-DI/PHP-DI/pull/389): exception message improvement by [@mopahle](https://github.com/mopahle)
-- [#359](https://github.com/PHP-DI/PHP-DI/issues/359), [#411](https://github.com/PHP-DI/PHP-DI/issues/411), [#414](https://github.com/PHP-DI/PHP-DI/pull/414), [#412](https://github.com/PHP-DI/PHP-DI/pull/412): compatibility with ProxyManager 1.* and 2.* (by [@holtkamp](https://github.com/holtkamp) and [@mnapoli](https://github.com/mnapoli))
-- [#416](https://github.com/PHP-DI/PHP-DI/pull/416): dumping definitions was refactored into a more lightweight and simple solution; definition "dumpers" have been removed (internal classes), definitions can now be cast to string directly (by [@mnapoli](https://github.com/mnapoli))
-
-## 5.2
-
-Read the [news entry](news/17-php-di-5-2-released.md).
-
-Improvements:
-
-- [#347](https://github.com/PHP-DI/PHP-DI/pull/347) (includes [#333](https://github.com/PHP-DI/PHP-DI/pull/333) and [#345](https://github.com/PHP-DI/PHP-DI/pull/345)): by [@jdreesen](https://github.com/jdreesen), [@quimcalpe](https://github.com/quimcalpe) and [@mnapoli](https://github.com/mnapoli)
- - Allow injection of any container object as factory parameter via type hinting
- - Allow injection of a `DI\Factory\RequestedEntry` object to get the requested entry name
-- [#272](https://github.com/PHP-DI/PHP-DI/issues/272): Support `"Class::method""` syntax for callables (by [@jdreesen](https://github.com/jdreesen))
-- [#332](https://github.com/PHP-DI/PHP-DI/issues/332): IDE support (plugin and documentation) (by [@pulyaevskiy](https://github.com/pulyaevskiy), [@avant1](https://github.com/avant1) and [@mnapoli](https://github.com/mnapoli))
-- [#326](https://github.com/PHP-DI/PHP-DI/pull/326): Exception messages are simpler and more consistent (by [@mnapoli](https://github.com/mnapoli))
-- [#325](https://github.com/PHP-DI/PHP-DI/pull/325): Add a "Edit this page" button in the website to encourage users to improve the documentation (by [@jdreesen](https://github.com/jdreesen))
-
-Bugfixes:
-
-- [#321](https://github.com/PHP-DI/PHP-DI/pull/321): Allow factory definitions to reference arbitrary container entries as callables (by [@jdreesen](https://github.com/jdreesen))
-- [#335](https://github.com/PHP-DI/PHP-DI/issues/335): Class imports in traits are now considered when parsing annotations (by [@thebigb](https://github.com/thebigb))
-
-## 5.1
-
-Read the [news entry](news/16-php-di-5-1-released.md).
-
-Improvements:
-
-- [Zend Framework 2 integration](https://github.com/PHP-DI/ZF2-Bridge) (by @Rastusik)
-- [#308](https://github.com/PHP-DI/PHP-DI/pull/308): Instantiate factories using the container (`DI\factory(['FooFactory', 'create'])`)
-- Many performances improvements - some benchmarks show up to 35% performance improvements, real results may vary of course
-- Many documentation improvements (@jdreesen, @mindplay-dk, @mnapoli, @holtkamp, @Rastusik)
-- [#296](https://github.com/PHP-DI/PHP-DI/issues/296): Provide a faster `ArrayCache` implementation, mostly useful in micro-benchmarks
-
-Bugfixes:
-
-- [#257](https://github.com/PHP-DI/PHP-DI/issues/257) & [#274](https://github.com/PHP-DI/PHP-DI/issues/274): Private properties of parent classes are not injected when using annotations
-- [#300](https://github.com/PHP-DI/PHP-DI/pull/300): Exception if object definition extends an incompatible definition
-- [#306](https://github.com/PHP-DI/PHP-DI/issues/306): Errors when using parameters passed by reference (fixed by @bradynpoulsen)
-- [#318](https://github.com/PHP-DI/PHP-DI/issues/318): `Container::call()` ignores parameter's default value
-
-Internal changes:
-
-- [#276](https://github.com/PHP-DI/PHP-DI/pull/276): Tests now pass on Windows (@bgaillard)
-
-## 5.0
-
-This is the complete change log. You can also read the [migration guide](doc/migration/5.0.md) for upgrading, or [the news article](news/15-php-di-5-0-released.md) for a nicer introduction to this new version.
-
-Improvements:
-
-- Moved to an organization on GitHub: [github.com/PHP-DI/PHP-DI](https://github.com/PHP-DI/PHP-DI)
-- The package has been renamed to: from `mnapoli/php-di` to [`php-di/php-di`](https://packagist.org/packages/php-di/php-di)
-- New [Silex integration](doc/frameworks/silex.md)
-- Lighter package: from 10 to 3 Composer dependencies!
-- [#235](https://github.com/PHP-DI/PHP-DI/issues/235): `DI\link()` is now deprecated in favor of `DI\get()`. There is no BC break as `DI\link()` still works.
-- [#207](https://github.com/PHP-DI/PHP-DI/issues/207): Support for `DI\link()` in arrays
-- [#203](https://github.com/PHP-DI/PHP-DI/issues/203): New `DI\string()` helper ([documentation](doc/php-definitions.md))
-- [#208](https://github.com/PHP-DI/PHP-DI/issues/208): Support for nested definitions
-- [#226](https://github.com/PHP-DI/PHP-DI/pull/226): `DI\factory()` can now be omitted with closures:
-
- ```php
- // before
- 'My\Class' => DI\factory(function () { ... })
- // now (optional shortcut)
- 'My\Class' => function () { ... }
- ```
-- [#193](https://github.com/PHP-DI/PHP-DI/issues/193): `DI\object()->method()` now supports calling the same method twice (or more).
-- [#248](https://github.com/PHP-DI/PHP-DI/issues/248): New `DI\decorate()` helper to decorate a previously defined entry ([documentation](doc/definition-overriding.md))
-- [#215](https://github.com/PHP-DI/PHP-DI/pull/215): New `DI\add()` helper to add entries to an existing array ([documentation](doc/definition-overriding.md))
-- [#218](https://github.com/PHP-DI/PHP-DI/issues/218): `ContainerBuilder::addDefinitions()` can now take an array of definitions
-- [#211](https://github.com/PHP-DI/PHP-DI/pull/211): `ContainerBuilder::addDefinitions()` is now fluent (return `$this`)
-- [#250](https://github.com/PHP-DI/PHP-DI/issues/250): `Container::call()` now also accepts parameters not indexed by name as well as embedded definitions ([documentation](doc/container.md))
-- Various performance improvements, e.g. lower the number of files loaded, simpler architecture, …
-
-BC breaks:
-
-- PHP-DI now requires a version of PHP >= 5.4.0
-- The package is lighter by default:
- - [#251](https://github.com/PHP-DI/PHP-DI/issues/251): Annotations are disabled by default, if you use annotations enable them with `$containerBuilder->useAnnotations(true)`. Additionally the `doctrine/annotations` package isn't required by default anymore, so you also need to run `composer require doctrine/annotations`.
- - `doctrine/cache` is not installed by default anymore, you need to require it in `composer.json` (`~1.0`) if you want to configure a cache for PHP-DI
- - [#198](https://github.com/PHP-DI/PHP-DI/issues/198): `ocramius/proxy-manager` is not installed by default anymore, you need to require it in `composer.json` (`~1.0`) if you want to use **lazy injection**
-- Closures are now converted into factory definitions automatically. If you ever defined a closure as a value (e.g. to have the closure injected in a class), you need to wrap the closure with the new `DI\value()` helper.
-- [#223](https://github.com/PHP-DI/PHP-DI/issues/223): `DI\ContainerInterface` was deprecated since v4.1 and has been removed
-
-Internal changes in case you were replacing/extending some parts:
-
-- the definition sources architecture has been refactored, if you defined custom definition sources you will need to update your code (it should be much easier now)
-- [#252](https://github.com/PHP-DI/PHP-DI/pull/252): `DI\Scope` internal implementation has changed. You are encouraged to use the constants (`DI\Scope::SINGLETON` and `DI\Scope::PROTOTYPE`) instead of the static methods, but backward compatibility is kept (static methods still work).
-- [#241](https://github.com/PHP-DI/PHP-DI/issues/241): `Container::call()` now uses the *Invoker* external library
-
-## 4.4
-
-Read the [news entry](news/13-php-di-4-4-released.md).
-
-- [#185](https://github.com/PHP-DI/PHP-DI/issues/185) Support for invokable objects in `Container::call()`
-- [#192](https://github.com/PHP-DI/PHP-DI/pull/192) Support for invokable classes in `Container::call()` (will instantiate the class)
-- [#184](https://github.com/PHP-DI/PHP-DI/pull/184) Option to ignore phpdoc errors
-
-## 4.3
-
-Read the [news entry](news/11-php-di-4-3-released.md).
-
-- [#176](https://github.com/PHP-DI/PHP-DI/pull/176) New definition type for reading environment variables: `DI\env()`
-- [#181](https://github.com/PHP-DI/PHP-DI/pull/181) `DI\FactoryInterface` and `DI\InvokerInterface` are now auto-registered inside the container so that you can inject them without any configuration needed
-- [#173](https://github.com/PHP-DI/PHP-DI/pull/173) `$container->call(['MyClass', 'method]);` will get `MyClass` from the container if `method()` is not a static method
-
-## 4.2.2
-
-- Fixed [#180](https://github.com/PHP-DI/PHP-DI/pull/180): `Container::call()` with object methods (`[$object, 'method']`) is now supported
-
-## 4.2.1
-
-- Support for PHP 5.3.3, which was previously incomplete because of a bug in the reflection (there is now a workaround for this bug)
-
-But if you can, seriously avoid this (really old) PHP version and upgrade.
-
-## 4.2
-
-Read the [news entry](news/10-php-di-4-2-released.md).
-
-**Minor BC-break**: Optional parameters (that were not configured) were injected, they are now ignored, which is what naturally makes sense since they are optional.
-Example:
-
-```php
- public function __construct(Bar $bar = null)
- {
- $this->bar = $bar ?: $this->createDefaultBar();
- }
-```
-
-Before 4.2, PHP-DI would try to inject a `Bar` instance. From 4.2 and onwards, it will inject `null`.
-
-Of course, you can still explicitly define an injection for the optional parameters and that will work.
-
-All changes:
-
-* [#162](https://github.com/PHP-DI/PHP-DI/pull/162) Added `Container::call()` to call functions with dependency injection
-* [#156](https://github.com/PHP-DI/PHP-DI/issues/156) Wildcards (`*`) in definitions
-* [#164](https://github.com/PHP-DI/PHP-DI/issues/164) Prototype scope is now available for `factory()` definitions too
-* FIXED [#168](https://github.com/PHP-DI/PHP-DI/pull/168) `Container::has()` now returns false for interfaces and abstract classes that are not mapped in the definitions
-* FIXED [#171](https://github.com/PHP-DI/PHP-DI/issues/171) Optional parameters are now ignored (not injected) if not set in the definitions (see the BC-break warning above)
-
-## 4.1
-
-Read the [news entry](news/09-php-di-4-1-released.md).
-
-BC-breaks: None.
-
-* [#138](https://github.com/PHP-DI/PHP-DI/issues/138) [Container-interop](https://github.com/container-interop/container-interop) compliance
-* [#143](https://github.com/PHP-DI/PHP-DI/issues/143) Much more explicit exception messages
-* [#157](https://github.com/PHP-DI/PHP-DI/issues/157) HHVM support
-* [#158](https://github.com/PHP-DI/PHP-DI/issues/158) Improved the documentation for [Symfony 2 integration](https://php-di.org/doc/frameworks/symfony2.html)
-
-## 4.0
-
-Major changes:
-
-* The configuration format has changed ([read more here to understand why](news/06-php-di-4-0-new-definitions.md))
-
-Read the migration guide if you are using 3.x: [Migration guide from 3.x to 4.0](doc/migration/4.0.md).
-
-BC-breaks:
-
-* YAML, XML and JSON definitions have been removed, and the PHP definition format has changed (see above)
-* `ContainerSingleton` has been removed
-* You cannot configure an injection as lazy anymore, you can only configure a container entry as lazy
-* The Container constructor now takes mandatory parameters. Use the ContainerBuilder to create a Container.
-* Removed `ContainerBuilder::setDefinitionsValidation()` (no definition validation anymore)
-* `ContainerBuilder::useReflection()` is now named: `ContainerBuilder::useAutowiring()`
-* `ContainerBuilder::addDefinitionsFromFile()` is now named: `ContainerBuilder::addDefinitions()`
-* The `$proxy` parameter in `Container::get($name, $proxy = true)` hase been removed. To get a proxy, you now need to define an entry as "lazy".
-
-Other changes:
-
-* Added `ContainerInterface` and `FactoryInterface`, both implemented by the container.
-* [#115](https://github.com/PHP-DI/PHP-DI/issues/115) Added `Container::has()`
-* [#142](https://github.com/PHP-DI/PHP-DI/issues/142) Added `Container::make()` to resolve an entry
-* [#127](https://github.com/PHP-DI/PHP-DI/issues/127) Added support for cases where PHP-DI is wrapped by another container (like Acclimate): PHP-DI can now use the wrapping container to perform injections
-* [#128](https://github.com/PHP-DI/PHP-DI/issues/128) Configure entry aliases
-* [#110](https://github.com/PHP-DI/PHP-DI/issues/110) XML definitions are not supported anymore
-* [#122](https://github.com/PHP-DI/PHP-DI/issues/122) JSON definitions are not supported anymore
-* `ContainerSingleton` has finally been removed
-* Added `ContainerBuilder::buildDevContainer()` to get started with a default container very easily.
-* [#99](https://github.com/PHP-DI/PHP-DI/issues/99) Fixed "`@param` with PHP internal type throws exception"
-
-## 3.5.1
-
-* FIXED [#126](https://github.com/PHP-DI/PHP-DI/issues/126): `Container::set` without effect if a value has already been set and retrieved
-
-## 3.5
-
-Read the [news entry](news/05-php-di-3-5.md).
-
-* Importing `@Inject` and `@Injectable` annotations is now optional! It means that you don't have to write `use DI\Annotation\Inject` anymore
-* FIXED [#124](https://github.com/PHP-DI/PHP-DI/issues/124): `@Injects` annotation conflicts with other annotations
-
-## 3.4
-
-Read the [news entry](news/04-php-di-3-4.md).
-
-* [#106](https://github.com/PHP-DI/PHP-DI/pull/106) You can now define arrays of values (in YAML, PHP, …) thanks to [@unkind](https://github.com/unkind)
-* [#98](https://github.com/PHP-DI/PHP-DI/issues/98) `ContainerBuilder` is now fluent thanks to [@drdamour](https://github.com/drdamour)
-* [#101](https://github.com/PHP-DI/PHP-DI/pull/101) Optional parameters are now supported: if you don't define a value to inject, their default value will be used
-* XML definitions have been deprecated, there weren't even documented and were not maintained. They will be removed in 4.0.
-* FIXED [#100](https://github.com/PHP-DI/PHP-DI/issues/100): bug for lazy injection in constructors
-
-## 3.3
-
-Read the [news entry](news/03-php-di-3-3.md).
-
-* Inject dependencies on an existing instance with `Container::injectOn` (work from [Jeff Flitton](https://github.com/jflitton): [#89](https://github.com/PHP-DI/PHP-DI/pull/89)).
-* [#86](https://github.com/PHP-DI/PHP-DI/issues/86): Optimized definition lookup (faster)
-* FIXED [#87](https://github.com/PHP-DI/PHP-DI/issues/87): Rare bug in the `PhpDocParser`, fixed by [drdamour](https://github.com/drdamour)
-
-## 3.2
-
-Read the [news entry](news/02-php-di-3-2.md).
-
-Small BC-break: PHP-DI 3.0 and 3.1 injected properties before calling the constructor. This was confusing and [not supported for internal classes](https://github.com/PHP-DI/PHP-DI/issues/74).
-From 3.2 and on, properties are injected after calling the constructor.
-
-* **[Lazy injection](doc/lazy-injection.md)**: it is now possible to use lazy injection on properties and methods (setters and constructors).
-* Lazy dependencies are now proxies that extend the class they proxy, so type-hinting works.
-* Addition of the **`ContainerBuilder`** object, that helps to [create and configure a `Container`](doc/container-configuration.md).
-* Some methods for configuring the Container have gone **deprecated** in favor of the `ContainerBuilder`. Fear not, these deprecated methods will remain until next major version (4.0).
- * `Container::useReflection`, use ContainerBuilder::useReflection instead
- * `Container::useAnnotations`, use ContainerBuilder::useAnnotations instead
- * `Container::setDefinitionCache`, use ContainerBuilder::setDefinitionCache instead
- * `Container::setDefinitionsValidation`, use ContainerBuilder::setDefinitionsValidation instead
-* The container is now auto-registered (as 'DI\Container'). You can now inject the container without registering it.
-
-## 3.1.1
-
-* Value definitions (`$container->set('foo', 80)`) are not cached anymore
-* FIXED [#82](https://github.com/PHP-DI/PHP-DI/issues/82): Serialization error when using a cache
-
-## 3.1
-
-Read the [news entry](news/01-php-di-3-1.md).
-
-* Zend Framework 1 integration through the [PHP-DI-ZF1 project](https://github.com/PHP-DI/PHP-DI-ZF1)
-* Fixed the order of priorities when you mix different definition sources (reflection, annotations, files, …). See [Definition overriding](doc/definition-overriding.md)
-* Now possible to define null values with `$container->set('foo', null)` (see [#79](https://github.com/PHP-DI/PHP-DI/issues/79)).
-* Deprecated usage of `ContainerSingleton`, will be removed in next major version (4.0)
-
-## 3.0.6
-
-* FIXED [#76](https://github.com/PHP-DI/PHP-DI/issues/76): Definition conflict when setting a closure for a class name
-
-## 3.0.5
-
-* FIXED [#70](https://github.com/PHP-DI/PHP-DI/issues/70): Definition conflict when setting a value for a class name
-
-## 3.0.4
-
-* FIXED [#69](https://github.com/PHP-DI/PHP-DI/issues/69): YamlDefinitionFileLoader crashes if YAML file is empty
-
-## 3.0.3
-
-* Fixed over-restrictive dependencies in composer.json
-
-## 3.0.2
-
-* [#64](https://github.com/PHP-DI/PHP-DI/issues/64): Non PHP-DI exceptions are not captured-rethrown anymore when injecting dependencies (cleaner stack trace)
-
-## 3.0.1
-
-* [#62](https://github.com/PHP-DI/PHP-DI/issues/62): When using aliases, definitions are now merged
-
-## 3.0
-
-Major compatibility breaks with 2.x.
-
-* The container is no longer a Singleton (but `ContainerSingleton::getInstance()` is available for fools who like it)
-* Setter injection
-* Constructor injection
-* Scopes: singleton (share the same instance of the class) or prototype (create a new instance each time it is fetched). Defined at class level.
-* Configuration is reworked from scratch. Now every configuration backend can do 100% of the job.
-* Provided configuration backends:
- * Reflection
- * Annotations: @Inject, @Injectable
- * PHP code (`Container::set()`)
- * PHP array
- * YAML file
-* As a consequence, annotations are not mandatory anymore, all functionalities can be used with or without annotations.
-* Renamed `DI\Annotations\` to `DI\Annotation\`
-* `Container` no longer implements ArrayAccess, use only `$container->get($key)` now
-* ZF1 integration broken and removed (work in progress for next releases)
-* Code now follows PSR1 and PSR2 coding styles
-* FIXED: [#58](https://github.com/PHP-DI/PHP-DI/issues/58) Getting a proxy of an alias didn't work
-
-## 2.1
-
-* `use` statements to import classes from other namespaces are now taken into account with the `@var` annotation
-* Updated and lightened the dependencies : `doctrine/common` has been replaced with more specific `doctrine/annotations` and `doctrine/cache`
-
-## 2.0
-
-Major compatibility breaks with 1.x.
-
-* `Container::resolveDependencies()` has been renamed to `Container::injectAll()`
-* Dependencies are now injected **before** the constructor is called, and thus are available in the constructor
-* Merged `@Value` annotation with `@Inject`: no difference between value and bean injection anymore
-* Container implements ArrayAccess for get() and set() (`$container['db.host'] = 'localhost';`)
-* Ini configuration files removed: configuration is done in PHP
-* Allow to define beans within closures for lazy-loading
-* Switched to MIT License
-
-Warning:
-
-* If you use PHP 5.3 and __wakeup() methods, they will be called when PHP-DI creates new instances of those classes.
-
-## 1.1
-
-* Caching of annotations based on Doctrine caches
-
-## 1.0
-
-* DependencyManager renamed to Container
-* Refactored basic Container usage with `get` and `set`
-* Allow named injection `@Inject(name="")`
-* Zend Framework integration
diff --git a/vendor/php-di/php-di/composer.json b/vendor/php-di/php-di/composer.json
deleted file mode 100644
index 16b5f26..0000000
--- a/vendor/php-di/php-di/composer.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "name": "php-di/php-di",
- "type": "library",
- "description": "The dependency injection container for humans",
- "keywords": ["di", "dependency injection", "container", "ioc", "psr-11", "psr11", "container-interop"],
- "homepage": "https://php-di.org/",
- "license": "MIT",
- "autoload": {
- "psr-4": {
- "DI\\": "src/"
- },
- "files": [
- "src/functions.php"
- ]
- },
- "autoload-dev": {
- "psr-4": {
- "DI\\Test\\IntegrationTest\\": "tests/IntegrationTest/",
- "DI\\Test\\UnitTest\\": "tests/UnitTest/"
- }
- },
- "scripts": {
- "test": "phpunit",
- "format-code": "php-cs-fixer fix --allow-risky=yes",
- "phpstan": "phpstan analyse -l 5 -c phpstan.neon src"
- },
- "require": {
- "php": ">=7.4.0",
- "psr/container": "^1.0",
- "php-di/invoker": "^2.0",
- "php-di/phpdoc-reader": "^2.0.1",
- "laravel/serializable-closure": "^1.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.5",
- "mnapoli/phpunit-easymock": "^1.2",
- "doctrine/annotations": "~1.10",
- "ocramius/proxy-manager": "^2.11.2",
- "friendsofphp/php-cs-fixer": "^2.4",
- "phpstan/phpstan": "^0.12"
- },
- "provide": {
- "psr/container-implementation": "^1.0"
- },
- "suggest": {
- "doctrine/annotations": "Install it if you want to use annotations (version ~1.2)",
- "ocramius/proxy-manager": "Install it if you want to use lazy injection (version ~2.0)"
- }
-}
diff --git a/vendor/php-di/php-di/src/Annotation/Inject.php b/vendor/php-di/php-di/src/Annotation/Inject.php
deleted file mode 100644
index c0eef19..0000000
--- a/vendor/php-di/php-di/src/Annotation/Inject.php
+++ /dev/null
@@ -1,93 +0,0 @@
-
- */
-final class Inject
-{
- /**
- * Entry name.
- * @var string
- */
- private $name;
-
- /**
- * Parameters, indexed by the parameter number (index) or name.
- *
- * Used if the annotation is set on a method
- * @var array
- */
- private $parameters = [];
-
- /**
- * @throws InvalidAnnotation
- */
- public function __construct(array $values)
- {
- // Process the parameters as a list AND as a parameter array (we don't know on what the annotation is)
-
- // @Inject(name="foo")
- if (isset($values['name']) && is_string($values['name'])) {
- $this->name = $values['name'];
-
- return;
- }
-
- // @Inject
- if (! isset($values['value'])) {
- return;
- }
-
- $values = $values['value'];
-
- // @Inject("foo")
- if (is_string($values)) {
- $this->name = $values;
- }
-
- // @Inject({...}) on a method
- if (is_array($values)) {
- foreach ($values as $key => $value) {
- if (! is_string($value)) {
- throw new InvalidAnnotation(sprintf(
- '@Inject({"param" = "value"}) expects "value" to be a string, %s given.',
- json_encode($value)
- ));
- }
-
- $this->parameters[$key] = $value;
- }
- }
- }
-
- /**
- * @return string|null Name of the entry to inject
- */
- public function getName()
- {
- return $this->name;
- }
-
- /**
- * @return array Parameters, indexed by the parameter number (index) or name
- */
- public function getParameters() : array
- {
- return $this->parameters;
- }
-}
diff --git a/vendor/php-di/php-di/src/Annotation/Injectable.php b/vendor/php-di/php-di/src/Annotation/Injectable.php
deleted file mode 100644
index ea15944..0000000
--- a/vendor/php-di/php-di/src/Annotation/Injectable.php
+++ /dev/null
@@ -1,42 +0,0 @@
-
- * @author Matthieu Napoli
- */
-final class Injectable
-{
- /**
- * Should the object be lazy-loaded.
- * @var bool|null
- */
- private $lazy;
-
- public function __construct(array $values)
- {
- if (isset($values['lazy'])) {
- $this->lazy = (bool) $values['lazy'];
- }
- }
-
- /**
- * @return bool|null
- */
- public function isLazy()
- {
- return $this->lazy;
- }
-}
diff --git a/vendor/php-di/php-di/src/CompiledContainer.php b/vendor/php-di/php-di/src/CompiledContainer.php
deleted file mode 100644
index 31fc017..0000000
--- a/vendor/php-di/php-di/src/CompiledContainer.php
+++ /dev/null
@@ -1,129 +0,0 @@
-
- */
-abstract class CompiledContainer extends Container
-{
- /**
- * This const is overridden in child classes (compiled containers).
- * @var array
- */
- protected const METHOD_MAPPING = [];
-
- /**
- * @var InvokerInterface
- */
- private $factoryInvoker;
-
- /**
- * {@inheritdoc}
- */
- public function get($name)
- {
- // Try to find the entry in the singleton map
- if (isset($this->resolvedEntries[$name]) || array_key_exists($name, $this->resolvedEntries)) {
- return $this->resolvedEntries[$name];
- }
-
- $method = static::METHOD_MAPPING[$name] ?? null;
-
- // If it's a compiled entry, then there is a method in this class
- if ($method !== null) {
- // Check if we are already getting this entry -> circular dependency
- if (isset($this->entriesBeingResolved[$name])) {
- throw new DependencyException("Circular dependency detected while trying to resolve entry '$name'");
- }
- $this->entriesBeingResolved[$name] = true;
-
- try {
- $value = $this->$method();
- } finally {
- unset($this->entriesBeingResolved[$name]);
- }
-
- // Store the entry to always return it without recomputing it
- $this->resolvedEntries[$name] = $value;
-
- return $value;
- }
-
- return parent::get($name);
- }
-
- /**
- * {@inheritdoc}
- */
- public function has($name)
- {
- if (! is_string($name)) {
- throw new \InvalidArgumentException(sprintf(
- 'The name parameter must be of type string, %s given',
- is_object($name) ? get_class($name) : gettype($name)
- ));
- }
-
- // The parent method is overridden to check in our array, it avoids resolving definitions
- if (isset(static::METHOD_MAPPING[$name])) {
- return true;
- }
-
- return parent::has($name);
- }
-
- protected function setDefinition(string $name, Definition $definition)
- {
- // It needs to be forbidden because that would mean get() must go through the definitions
- // every time, which kinds of defeats the performance gains of the compiled container
- throw new \LogicException('You cannot set a definition at runtime on a compiled container. You can either put your definitions in a file, disable compilation or ->set() a raw value directly (PHP object, string, int, ...) instead of a PHP-DI definition.');
- }
-
- /**
- * Invoke the given callable.
- */
- protected function resolveFactory($callable, $entryName, array $extraParameters = [])
- {
- // Initialize the factory resolver
- if (! $this->factoryInvoker) {
- $parameterResolver = new ResolverChain([
- new AssociativeArrayResolver,
- new FactoryParameterResolver($this->delegateContainer),
- new NumericArrayResolver,
- new DefaultValueResolver,
- ]);
-
- $this->factoryInvoker = new Invoker($parameterResolver, $this->delegateContainer);
- }
-
- $parameters = [$this->delegateContainer, new RequestedEntryHolder($entryName)];
-
- $parameters = array_merge($parameters, $extraParameters);
-
- try {
- return $this->factoryInvoker->call($callable, $parameters);
- } catch (NotCallableException $e) {
- throw new InvalidDefinition("Entry \"$entryName\" cannot be resolved: factory " . $e->getMessage());
- } catch (NotEnoughParametersException $e) {
- throw new InvalidDefinition("Entry \"$entryName\" cannot be resolved: " . $e->getMessage());
- }
- }
-}
diff --git a/vendor/php-di/php-di/src/Compiler/Compiler.php b/vendor/php-di/php-di/src/Compiler/Compiler.php
deleted file mode 100644
index ca5d494..0000000
--- a/vendor/php-di/php-di/src/Compiler/Compiler.php
+++ /dev/null
@@ -1,422 +0,0 @@
-
- */
-class Compiler
-{
- /**
- * @var string
- */
- private $containerClass;
-
- /**
- * @var string
- */
- private $containerParentClass;
-
- /**
- * Definitions indexed by the entry name. The value can be null if the definition needs to be fetched.
- *
- * Keys are strings, values are `Definition` objects or null.
- *
- * @var \ArrayIterator
- */
- private $entriesToCompile;
-
- /**
- * Progressive counter for definitions.
- *
- * Each key in $entriesToCompile is defined as 'SubEntry' + counter
- * and each definition has always the same key in the CompiledContainer
- * if PHP-DI configuration does not change.
- *
- * @var int
- */
- private $subEntryCounter;
-
- /**
- * Progressive counter for CompiledContainer get methods.
- *
- * Each CompiledContainer method name is defined as 'get' + counter
- * and remains the same after each recompilation
- * if PHP-DI configuration does not change.
- *
- * @var int
- */
- private $methodMappingCounter;
-
- /**
- * Map of entry names to method names.
- *
- * @var string[]
- */
- private $entryToMethodMapping = [];
-
- /**
- * @var string[]
- */
- private $methods = [];
-
- /**
- * @var bool
- */
- private $autowiringEnabled;
-
- /**
- * @var ProxyFactory
- */
- private $proxyFactory;
-
- public function __construct(ProxyFactory $proxyFactory)
- {
- $this->proxyFactory = $proxyFactory;
- }
-
- public function getProxyFactory() : ProxyFactory
- {
- return $this->proxyFactory;
- }
-
- /**
- * Compile the container.
- *
- * @return string The compiled container file name.
- */
- public function compile(
- DefinitionSource $definitionSource,
- string $directory,
- string $className,
- string $parentClassName,
- bool $autowiringEnabled
- ) : string {
- $fileName = rtrim($directory, '/') . '/' . $className . '.php';
-
- if (file_exists($fileName)) {
- // The container is already compiled
- return $fileName;
- }
-
- $this->autowiringEnabled = $autowiringEnabled;
-
- // Validate that a valid class name was provided
- $validClassName = preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $className);
- if (!$validClassName) {
- throw new InvalidArgumentException("The container cannot be compiled: `$className` is not a valid PHP class name");
- }
-
- $this->entriesToCompile = new \ArrayIterator($definitionSource->getDefinitions());
-
- // We use an ArrayIterator so that we can keep adding new items to the list while we compile entries
- foreach ($this->entriesToCompile as $entryName => $definition) {
- $silenceErrors = false;
- // This is an entry found by reference during autowiring
- if (!$definition) {
- $definition = $definitionSource->getDefinition($entryName);
- // We silence errors for those entries because type-hints may reference interfaces/abstract classes
- // which could later be defined, or even not used (we don't want to block the compilation for those)
- $silenceErrors = true;
- }
- if (!$definition) {
- // We do not throw a `NotFound` exception here because the dependency
- // could be defined at runtime
- continue;
- }
- // Check that the definition can be compiled
- $errorMessage = $this->isCompilable($definition);
- if ($errorMessage !== true) {
- continue;
- }
- try {
- $this->compileDefinition($entryName, $definition);
- } catch (InvalidDefinition $e) {
- if ($silenceErrors) {
- // forget the entry
- unset($this->entryToMethodMapping[$entryName]);
- } else {
- throw $e;
- }
- }
- }
-
- $this->containerClass = $className;
- $this->containerParentClass = $parentClassName;
-
- ob_start();
- require __DIR__ . '/Template.php';
- $fileContent = ob_get_clean();
-
- $fileContent = "createCompilationDirectory(dirname($fileName));
- $this->writeFileAtomic($fileName, $fileContent);
-
- return $fileName;
- }
-
- private function writeFileAtomic(string $fileName, string $content) : int
- {
- $tmpFile = @tempnam(dirname($fileName), 'swap-compile');
- if ($tmpFile === false) {
- throw new InvalidArgumentException(
- sprintf('Error while creating temporary file in %s', dirname($fileName))
- );
- }
- @chmod($tmpFile, 0666);
-
- $written = file_put_contents($tmpFile, $content);
- if ($written === false) {
- @unlink($tmpFile);
-
- throw new InvalidArgumentException(sprintf('Error while writing to %s', $tmpFile));
- }
-
- @chmod($tmpFile, 0666);
- $renamed = @rename($tmpFile, $fileName);
- if (!$renamed) {
- @unlink($tmpFile);
- throw new InvalidArgumentException(sprintf('Error while renaming %s to %s', $tmpFile, $fileName));
- }
-
- return $written;
- }
-
- /**
- * @throws DependencyException
- * @throws InvalidDefinition
- * @return string The method name
- */
- private function compileDefinition(string $entryName, Definition $definition) : string
- {
- // Generate a unique method name
- $methodName = 'get' . (++$this->methodMappingCounter);
- $this->entryToMethodMapping[$entryName] = $methodName;
-
- switch (true) {
- case $definition instanceof ValueDefinition:
- $value = $definition->getValue();
- $code = 'return ' . $this->compileValue($value) . ';';
- break;
- case $definition instanceof Reference:
- $targetEntryName = $definition->getTargetEntryName();
- $code = 'return $this->delegateContainer->get(' . $this->compileValue($targetEntryName) . ');';
- // If this method is not yet compiled we store it for compilation
- if (!isset($this->entriesToCompile[$targetEntryName])) {
- $this->entriesToCompile[$targetEntryName] = null;
- }
- break;
- case $definition instanceof StringDefinition:
- $entryName = $this->compileValue($definition->getName());
- $expression = $this->compileValue($definition->getExpression());
- $code = 'return \DI\Definition\StringDefinition::resolveExpression(' . $entryName . ', ' . $expression . ', $this->delegateContainer);';
- break;
- case $definition instanceof EnvironmentVariableDefinition:
- $variableName = $this->compileValue($definition->getVariableName());
- $isOptional = $this->compileValue($definition->isOptional());
- $defaultValue = $this->compileValue($definition->getDefaultValue());
- $code = <<getVariableName()}' has not been defined");
- }
- return $defaultValue;
-PHP;
- break;
- case $definition instanceof ArrayDefinition:
- try {
- $code = 'return ' . $this->compileValue($definition->getValues()) . ';';
- } catch (\Exception $e) {
- throw new DependencyException(sprintf(
- 'Error while compiling %s. %s',
- $definition->getName(),
- $e->getMessage()
- ), 0, $e);
- }
- break;
- case $definition instanceof ObjectDefinition:
- $compiler = new ObjectCreationCompiler($this);
- $code = $compiler->compile($definition);
- $code .= "\n return \$object;";
- break;
- case $definition instanceof DecoratorDefinition:
- $decoratedDefinition = $definition->getDecoratedDefinition();
- if (! $decoratedDefinition instanceof Definition) {
- if (! $definition->getName()) {
- throw new InvalidDefinition('Decorators cannot be nested in another definition');
- }
- throw new InvalidDefinition(sprintf(
- 'Entry "%s" decorates nothing: no previous definition with the same name was found',
- $definition->getName()
- ));
- }
- $code = sprintf(
- 'return call_user_func(%s, %s, $this->delegateContainer);',
- $this->compileValue($definition->getCallable()),
- $this->compileValue($decoratedDefinition)
- );
- break;
- case $definition instanceof FactoryDefinition:
- $value = $definition->getCallable();
-
- // Custom error message to help debugging
- $isInvokableClass = is_string($value) && class_exists($value) && method_exists($value, '__invoke');
- if ($isInvokableClass && !$this->autowiringEnabled) {
- throw new InvalidDefinition(sprintf(
- 'Entry "%s" cannot be compiled. Invokable classes cannot be automatically resolved if autowiring is disabled on the container, you need to enable autowiring or define the entry manually.',
- $entryName
- ));
- }
-
- $definitionParameters = '';
- if (!empty($definition->getParameters())) {
- $definitionParameters = ', ' . $this->compileValue($definition->getParameters());
- }
-
- $code = sprintf(
- 'return $this->resolveFactory(%s, %s%s);',
- $this->compileValue($value),
- var_export($entryName, true),
- $definitionParameters
- );
-
- break;
- default:
- // This case should not happen (so it cannot be tested)
- throw new \Exception('Cannot compile definition of type ' . get_class($definition));
- }
-
- $this->methods[$methodName] = $code;
-
- return $methodName;
- }
-
- public function compileValue($value) : string
- {
- // Check that the value can be compiled
- $errorMessage = $this->isCompilable($value);
- if ($errorMessage !== true) {
- throw new InvalidDefinition($errorMessage);
- }
-
- if ($value instanceof Definition) {
- // Give it an arbitrary unique name
- $subEntryName = 'subEntry' . (++$this->subEntryCounter);
- // Compile the sub-definition in another method
- $methodName = $this->compileDefinition($subEntryName, $value);
- // The value is now a method call to that method (which returns the value)
- return "\$this->$methodName()";
- }
-
- if (is_array($value)) {
- $value = array_map(function ($value, $key) {
- $compiledValue = $this->compileValue($value);
- $key = var_export($key, true);
-
- return " $key => $compiledValue,\n";
- }, $value, array_keys($value));
- $value = implode('', $value);
-
- return "[\n$value ]";
- }
-
- if ($value instanceof \Closure) {
- return $this->compileClosure($value);
- }
-
- return var_export($value, true);
- }
-
- private function createCompilationDirectory(string $directory)
- {
- if (!is_dir($directory) && !@mkdir($directory, 0777, true) && !is_dir($directory)) {
- throw new InvalidArgumentException(sprintf('Compilation directory does not exist and cannot be created: %s.', $directory));
- }
- if (!is_writable($directory)) {
- throw new InvalidArgumentException(sprintf('Compilation directory is not writable: %s.', $directory));
- }
- }
-
- /**
- * @return string|true If true is returned that means that the value is compilable.
- */
- private function isCompilable($value)
- {
- if ($value instanceof ValueDefinition) {
- return $this->isCompilable($value->getValue());
- }
- if ($value instanceof DecoratorDefinition) {
- if (empty($value->getName())) {
- return 'Decorators cannot be nested in another definition';
- }
- }
- // All other definitions are compilable
- if ($value instanceof Definition) {
- return true;
- }
- if ($value instanceof \Closure) {
- return true;
- }
- if (is_object($value)) {
- return 'An object was found but objects cannot be compiled';
- }
- if (is_resource($value)) {
- return 'A resource was found but resources cannot be compiled';
- }
-
- return true;
- }
-
- /**
- * @throws \DI\Definition\Exception\InvalidDefinition
- */
- private function compileClosure(\Closure $closure) : string
- {
- $reflector = new ReflectionClosure($closure);
-
- if ($reflector->getUseVariables()) {
- throw new InvalidDefinition('Cannot compile closures which import variables using the `use` keyword');
- }
-
- if ($reflector->isBindingRequired() || $reflector->isScopeRequired()) {
- throw new InvalidDefinition('Cannot compile closures which use $this or self/static/parent references');
- }
-
- // Force all closures to be static (add the `static` keyword), i.e. they can't use
- // $this, which makes sense since their code is copied into another class.
- $code = ($reflector->isStatic() ? '' : 'static ') . $reflector->getCode();
-
- $code = trim($code, "\t\n\r;");
-
- return $code;
- }
-}
diff --git a/vendor/php-di/php-di/src/Compiler/ObjectCreationCompiler.php b/vendor/php-di/php-di/src/Compiler/ObjectCreationCompiler.php
deleted file mode 100644
index 9f19d4c..0000000
--- a/vendor/php-di/php-di/src/Compiler/ObjectCreationCompiler.php
+++ /dev/null
@@ -1,201 +0,0 @@
-
- */
-class ObjectCreationCompiler
-{
- /**
- * @var Compiler
- */
- private $compiler;
-
- public function __construct(Compiler $compiler)
- {
- $this->compiler = $compiler;
- }
-
- public function compile(ObjectDefinition $definition) : string
- {
- $this->assertClassIsNotAnonymous($definition);
- $this->assertClassIsInstantiable($definition);
-
- // Lazy?
- if ($definition->isLazy()) {
- return $this->compileLazyDefinition($definition);
- }
-
- try {
- $classReflection = new ReflectionClass($definition->getClassName());
- $constructorArguments = $this->resolveParameters($definition->getConstructorInjection(), $classReflection->getConstructor());
- $dumpedConstructorArguments = array_map(function ($value) {
- return $this->compiler->compileValue($value);
- }, $constructorArguments);
-
- $code = [];
- $code[] = sprintf(
- '$object = new %s(%s);',
- $definition->getClassName(),
- implode(', ', $dumpedConstructorArguments)
- );
-
- // Property injections
- foreach ($definition->getPropertyInjections() as $propertyInjection) {
- $value = $propertyInjection->getValue();
- $value = $this->compiler->compileValue($value);
-
- $className = $propertyInjection->getClassName() ?: $definition->getClassName();
- $property = new ReflectionProperty($className, $propertyInjection->getPropertyName());
- if ($property->isPublic()) {
- $code[] = sprintf('$object->%s = %s;', $propertyInjection->getPropertyName(), $value);
- } else {
- // Private/protected property
- $code[] = sprintf(
- '\DI\Definition\Resolver\ObjectCreator::setPrivatePropertyValue(%s, $object, \'%s\', %s);',
- var_export($propertyInjection->getClassName(), true),
- $propertyInjection->getPropertyName(),
- $value
- );
- }
- }
-
- // Method injections
- foreach ($definition->getMethodInjections() as $methodInjection) {
- $methodReflection = new \ReflectionMethod($definition->getClassName(), $methodInjection->getMethodName());
- $parameters = $this->resolveParameters($methodInjection, $methodReflection);
-
- $dumpedParameters = array_map(function ($value) {
- return $this->compiler->compileValue($value);
- }, $parameters);
-
- $code[] = sprintf(
- '$object->%s(%s);',
- $methodInjection->getMethodName(),
- implode(', ', $dumpedParameters)
- );
- }
- } catch (InvalidDefinition $e) {
- throw InvalidDefinition::create($definition, sprintf(
- 'Entry "%s" cannot be compiled: %s',
- $definition->getName(),
- $e->getMessage()
- ));
- }
-
- return implode("\n ", $code);
- }
-
- public function resolveParameters(MethodInjection $definition = null, ReflectionMethod $method = null) : array
- {
- $args = [];
-
- if (! $method) {
- return $args;
- }
-
- $definitionParameters = $definition ? $definition->getParameters() : [];
-
- foreach ($method->getParameters() as $index => $parameter) {
- if (array_key_exists($index, $definitionParameters)) {
- // Look in the definition
- $value = &$definitionParameters[$index];
- } elseif ($parameter->isOptional()) {
- // If the parameter is optional and wasn't specified, we take its default value
- $args[] = $this->getParameterDefaultValue($parameter, $method);
- continue;
- } else {
- throw new InvalidDefinition(sprintf(
- 'Parameter $%s of %s has no value defined or guessable',
- $parameter->getName(),
- $this->getFunctionName($method)
- ));
- }
-
- $args[] = &$value;
- }
-
- return $args;
- }
-
- private function compileLazyDefinition(ObjectDefinition $definition) : string
- {
- $subDefinition = clone $definition;
- $subDefinition->setLazy(false);
- $subDefinition = $this->compiler->compileValue($subDefinition);
-
- $this->compiler->getProxyFactory()->generateProxyClass($definition->getClassName());
-
- return <<proxyFactory->createProxy(
- '{$definition->getClassName()}',
- function (&\$wrappedObject, \$proxy, \$method, \$params, &\$initializer) {
- \$wrappedObject = $subDefinition;
- \$initializer = null; // turning off further lazy initialization
- return true;
- }
- );
-PHP;
- }
-
- /**
- * Returns the default value of a function parameter.
- *
- * @throws InvalidDefinition Can't get default values from PHP internal classes and functions
- * @return mixed
- */
- private function getParameterDefaultValue(ReflectionParameter $parameter, ReflectionMethod $function)
- {
- try {
- return $parameter->getDefaultValue();
- } catch (\ReflectionException $e) {
- throw new InvalidDefinition(sprintf(
- 'The parameter "%s" of %s has no type defined or guessable. It has a default value, '
- . 'but the default value can\'t be read through Reflection because it is a PHP internal class.',
- $parameter->getName(),
- $this->getFunctionName($function)
- ));
- }
- }
-
- private function getFunctionName(ReflectionMethod $method) : string
- {
- return $method->getName() . '()';
- }
-
- private function assertClassIsNotAnonymous(ObjectDefinition $definition)
- {
- if (strpos($definition->getClassName(), '@') !== false) {
- throw InvalidDefinition::create($definition, sprintf(
- 'Entry "%s" cannot be compiled: anonymous classes cannot be compiled',
- $definition->getName()
- ));
- }
- }
-
- private function assertClassIsInstantiable(ObjectDefinition $definition)
- {
- if ($definition->isInstantiable()) {
- return;
- }
-
- $message = ! $definition->classExists()
- ? 'Entry "%s" cannot be compiled: the class doesn\'t exist'
- : 'Entry "%s" cannot be compiled: the class is not instantiable';
-
- throw InvalidDefinition::create($definition, sprintf($message, $definition->getName()));
- }
-}
diff --git a/vendor/php-di/php-di/src/Compiler/RequestedEntryHolder.php b/vendor/php-di/php-di/src/Compiler/RequestedEntryHolder.php
deleted file mode 100644
index 68b5bc2..0000000
--- a/vendor/php-di/php-di/src/Compiler/RequestedEntryHolder.php
+++ /dev/null
@@ -1,28 +0,0 @@
-
- */
-class RequestedEntryHolder implements RequestedEntry
-{
- /**
- * @var string
- */
- private $name;
-
- public function __construct(string $name)
- {
- $this->name = $name;
- }
-
- public function getName() : string
- {
- return $this->name;
- }
-}
diff --git a/vendor/php-di/php-di/src/Compiler/Template.php b/vendor/php-di/php-di/src/Compiler/Template.php
deleted file mode 100644
index e053639..0000000
--- a/vendor/php-di/php-di/src/Compiler/Template.php
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * This class has been auto-generated by PHP-DI.
- */
-class =$this->containerClass; ?> extends =$this->containerParentClass; ?>
-{
- const METHOD_MAPPING = entryToMethodMapping); ?>;
-
-methods as $methodName => $methodContent) : ?>
- protected function =$methodName; ?>()
- {
- =$methodContent; ?>
-
- }
-
-
-}
diff --git a/vendor/php-di/php-di/src/Container.php b/vendor/php-di/php-di/src/Container.php
deleted file mode 100644
index a9c95de..0000000
--- a/vendor/php-di/php-di/src/Container.php
+++ /dev/null
@@ -1,433 +0,0 @@
-
- */
-class Container implements ContainerInterface, FactoryInterface, InvokerInterface
-{
- /**
- * Map of entries that are already resolved.
- * @var array
- */
- protected $resolvedEntries = [];
-
- /**
- * @var MutableDefinitionSource
- */
- private $definitionSource;
-
- /**
- * @var DefinitionResolver
- */
- private $definitionResolver;
-
- /**
- * Map of definitions that are already fetched (local cache).
- *
- * @var (Definition|null)[]
- */
- private $fetchedDefinitions = [];
-
- /**
- * Array of entries being resolved. Used to avoid circular dependencies and infinite loops.
- * @var array
- */
- protected $entriesBeingResolved = [];
-
- /**
- * @var InvokerInterface|null
- */
- private $invoker;
-
- /**
- * Container that wraps this container. If none, points to $this.
- *
- * @var ContainerInterface
- */
- protected $delegateContainer;
-
- /**
- * @var ProxyFactory
- */
- protected $proxyFactory;
-
- /**
- * Use `$container = new Container()` if you want a container with the default configuration.
- *
- * If you want to customize the container's behavior, you are discouraged to create and pass the
- * dependencies yourself, the ContainerBuilder class is here to help you instead.
- *
- * @see ContainerBuilder
- *
- * @param ContainerInterface $wrapperContainer If the container is wrapped by another container.
- */
- public function __construct(
- MutableDefinitionSource $definitionSource = null,
- ProxyFactory $proxyFactory = null,
- ContainerInterface $wrapperContainer = null
- ) {
- $this->delegateContainer = $wrapperContainer ?: $this;
-
- $this->definitionSource = $definitionSource ?: $this->createDefaultDefinitionSource();
- $this->proxyFactory = $proxyFactory ?: new ProxyFactory(false);
- $this->definitionResolver = new ResolverDispatcher($this->delegateContainer, $this->proxyFactory);
-
- // Auto-register the container
- $this->resolvedEntries = [
- self::class => $this,
- ContainerInterface::class => $this->delegateContainer,
- FactoryInterface::class => $this,
- InvokerInterface::class => $this,
- ];
- }
-
- /**
- * Returns an entry of the container by its name.
- *
- * @template T
- * @param string|class-string $name Entry name or a class name.
- *
- * @throws DependencyException Error while resolving the entry.
- * @throws NotFoundException No entry found for the given name.
- * @return mixed|T
- */
- public function get($name)
- {
- // If the entry is already resolved we return it
- if (isset($this->resolvedEntries[$name]) || array_key_exists($name, $this->resolvedEntries)) {
- return $this->resolvedEntries[$name];
- }
-
- $definition = $this->getDefinition($name);
- if (! $definition) {
- throw new NotFoundException("No entry or class found for '$name'");
- }
-
- $value = $this->resolveDefinition($definition);
-
- $this->resolvedEntries[$name] = $value;
-
- return $value;
- }
-
- /**
- * @param string $name
- *
- * @return Definition|null
- */
- private function getDefinition($name)
- {
- // Local cache that avoids fetching the same definition twice
- if (!array_key_exists($name, $this->fetchedDefinitions)) {
- $this->fetchedDefinitions[$name] = $this->definitionSource->getDefinition($name);
- }
-
- return $this->fetchedDefinitions[$name];
- }
-
- /**
- * Build an entry of the container by its name.
- *
- * This method behave like get() except resolves the entry again every time.
- * For example if the entry is a class then a new instance will be created each time.
- *
- * This method makes the container behave like a factory.
- *
- * @template T
- * @param string|class-string $name Entry name or a class name.
- * @param array $parameters Optional parameters to use to build the entry. Use this to force
- * specific parameters to specific values. Parameters not defined in this
- * array will be resolved using the container.
- *
- * @throws InvalidArgumentException The name parameter must be of type string.
- * @throws DependencyException Error while resolving the entry.
- * @throws NotFoundException No entry found for the given name.
- * @return mixed|T
- */
- public function make($name, array $parameters = [])
- {
- if (! is_string($name)) {
- throw new InvalidArgumentException(sprintf(
- 'The name parameter must be of type string, %s given',
- is_object($name) ? get_class($name) : gettype($name)
- ));
- }
-
- $definition = $this->getDefinition($name);
- if (! $definition) {
- // If the entry is already resolved we return it
- if (array_key_exists($name, $this->resolvedEntries)) {
- return $this->resolvedEntries[$name];
- }
-
- throw new NotFoundException("No entry or class found for '$name'");
- }
-
- return $this->resolveDefinition($definition, $parameters);
- }
-
- /**
- * Test if the container can provide something for the given name.
- *
- * @param string $name Entry name or a class name.
- *
- * @throws InvalidArgumentException The name parameter must be of type string.
- * @return bool
- */
- public function has($name)
- {
- if (! is_string($name)) {
- throw new InvalidArgumentException(sprintf(
- 'The name parameter must be of type string, %s given',
- is_object($name) ? get_class($name) : gettype($name)
- ));
- }
-
- if (array_key_exists($name, $this->resolvedEntries)) {
- return true;
- }
-
- $definition = $this->getDefinition($name);
- if ($definition === null) {
- return false;
- }
-
- return $this->definitionResolver->isResolvable($definition);
- }
-
- /**
- * Inject all dependencies on an existing instance.
- *
- * @template T
- * @param object|T $instance Object to perform injection upon
- * @throws InvalidArgumentException
- * @throws DependencyException Error while injecting dependencies
- * @return object|T $instance Returns the same instance
- */
- public function injectOn($instance)
- {
- if (!$instance) {
- return $instance;
- }
-
- $className = get_class($instance);
-
- // If the class is anonymous, don't cache its definition
- // Checking for anonymous classes is cleaner via Reflection, but also slower
- $objectDefinition = false !== strpos($className, '@anonymous')
- ? $this->definitionSource->getDefinition($className)
- : $this->getDefinition($className);
-
- if (! $objectDefinition instanceof ObjectDefinition) {
- return $instance;
- }
-
- $definition = new InstanceDefinition($instance, $objectDefinition);
-
- $this->definitionResolver->resolve($definition);
-
- return $instance;
- }
-
- /**
- * Call the given function using the given parameters.
- *
- * Missing parameters will be resolved from the container.
- *
- * @param callable $callable Function to call.
- * @param array $parameters Parameters to use. Can be indexed by the parameter names
- * or not indexed (same order as the parameters).
- * The array can also contain DI definitions, e.g. DI\get().
- *
- * @return mixed Result of the function.
- */
- public function call($callable, array $parameters = [])
- {
- return $this->getInvoker()->call($callable, $parameters);
- }
-
- /**
- * Define an object or a value in the container.
- *
- * @param string $name Entry name
- * @param mixed|DefinitionHelper $value Value, use definition helpers to define objects
- */
- public function set(string $name, $value)
- {
- if ($value instanceof DefinitionHelper) {
- $value = $value->getDefinition($name);
- } elseif ($value instanceof \Closure) {
- $value = new FactoryDefinition($name, $value);
- }
-
- if ($value instanceof ValueDefinition) {
- $this->resolvedEntries[$name] = $value->getValue();
- } elseif ($value instanceof Definition) {
- $value->setName($name);
- $this->setDefinition($name, $value);
- } else {
- $this->resolvedEntries[$name] = $value;
- }
- }
-
- /**
- * Get defined container entries.
- *
- * @return string[]
- */
- public function getKnownEntryNames() : array
- {
- $entries = array_unique(array_merge(
- array_keys($this->definitionSource->getDefinitions()),
- array_keys($this->resolvedEntries)
- ));
- sort($entries);
-
- return $entries;
- }
-
- /**
- * Get entry debug information.
- *
- * @param string $name Entry name
- *
- * @throws InvalidDefinition
- * @throws NotFoundException
- */
- public function debugEntry(string $name) : string
- {
- $definition = $this->definitionSource->getDefinition($name);
- if ($definition instanceof Definition) {
- return (string) $definition;
- }
-
- if (array_key_exists($name, $this->resolvedEntries)) {
- return $this->getEntryType($this->resolvedEntries[$name]);
- }
-
- throw new NotFoundException("No entry or class found for '$name'");
- }
-
- /**
- * Get formatted entry type.
- *
- * @param mixed $entry
- */
- private function getEntryType($entry) : string
- {
- if (is_object($entry)) {
- return sprintf("Object (\n class = %s\n)", get_class($entry));
- }
-
- if (is_array($entry)) {
- return preg_replace(['/^array \(/', '/\)$/'], ['[', ']'], var_export($entry, true));
- }
-
- if (is_string($entry)) {
- return sprintf('Value (\'%s\')', $entry);
- }
-
- if (is_bool($entry)) {
- return sprintf('Value (%s)', $entry === true ? 'true' : 'false');
- }
-
- return sprintf('Value (%s)', is_scalar($entry) ? $entry : ucfirst(gettype($entry)));
- }
-
- /**
- * Resolves a definition.
- *
- * Checks for circular dependencies while resolving the definition.
- *
- * @throws DependencyException Error while resolving the entry.
- * @return mixed
- */
- private function resolveDefinition(Definition $definition, array $parameters = [])
- {
- $entryName = $definition->getName();
-
- // Check if we are already getting this entry -> circular dependency
- if (isset($this->entriesBeingResolved[$entryName])) {
- throw new DependencyException("Circular dependency detected while trying to resolve entry '$entryName'");
- }
- $this->entriesBeingResolved[$entryName] = true;
-
- // Resolve the definition
- try {
- $value = $this->definitionResolver->resolve($definition, $parameters);
- } finally {
- unset($this->entriesBeingResolved[$entryName]);
- }
-
- return $value;
- }
-
- protected function setDefinition(string $name, Definition $definition)
- {
- // Clear existing entry if it exists
- if (array_key_exists($name, $this->resolvedEntries)) {
- unset($this->resolvedEntries[$name]);
- }
- $this->fetchedDefinitions = []; // Completely clear this local cache
-
- $this->definitionSource->addDefinition($definition);
- }
-
- private function getInvoker() : InvokerInterface
- {
- if (! $this->invoker) {
- $parameterResolver = new ResolverChain([
- new DefinitionParameterResolver($this->definitionResolver),
- new NumericArrayResolver,
- new AssociativeArrayResolver,
- new DefaultValueResolver,
- new TypeHintContainerResolver($this->delegateContainer),
- ]);
-
- $this->invoker = new Invoker($parameterResolver, $this);
- }
-
- return $this->invoker;
- }
-
- private function createDefaultDefinitionSource() : SourceChain
- {
- $source = new SourceChain([new ReflectionBasedAutowiring]);
- $source->setMutableDefinitionSource(new DefinitionArray([], new ReflectionBasedAutowiring));
-
- return $source;
- }
-}
diff --git a/vendor/php-di/php-di/src/ContainerBuilder.php b/vendor/php-di/php-di/src/ContainerBuilder.php
deleted file mode 100644
index 3ee747f..0000000
--- a/vendor/php-di/php-di/src/ContainerBuilder.php
+++ /dev/null
@@ -1,385 +0,0 @@
-build();
- *
- * @api
- *
- * @since 3.2
- * @author Matthieu Napoli
- */
-class ContainerBuilder
-{
- /**
- * Name of the container class, used to create the container.
- * @var string
- */
- private $containerClass;
-
- /**
- * Name of the container parent class, used on compiled container.
- * @var string
- */
- private $containerParentClass;
-
- /**
- * @var bool
- */
- private $useAutowiring = true;
-
- /**
- * @var bool
- */
- private $useAnnotations = false;
-
- /**
- * @var bool
- */
- private $ignorePhpDocErrors = false;
-
- /**
- * If true, write the proxies to disk to improve performances.
- * @var bool
- */
- private $writeProxiesToFile = false;
-
- /**
- * Directory where to write the proxies (if $writeProxiesToFile is enabled).
- * @var string|null
- */
- private $proxyDirectory;
-
- /**
- * If PHP-DI is wrapped in another container, this references the wrapper.
- * @var ContainerInterface
- */
- private $wrapperContainer;
-
- /**
- * @var DefinitionSource[]|string[]|array[]
- */
- private $definitionSources = [];
-
- /**
- * Whether the container has already been built.
- * @var bool
- */
- private $locked = false;
-
- /**
- * @var string|null
- */
- private $compileToDirectory;
-
- /**
- * @var bool
- */
- private $sourceCache = false;
-
- /**
- * @var string
- */
- protected $sourceCacheNamespace;
-
- /**
- * Build a container configured for the dev environment.
- */
- public static function buildDevContainer() : Container
- {
- return new Container;
- }
-
- /**
- * @param string $containerClass Name of the container class, used to create the container.
- */
- public function __construct(string $containerClass = Container::class)
- {
- $this->containerClass = $containerClass;
- }
-
- /**
- * Build and return a container.
- *
- * @return Container
- */
- public function build()
- {
- $sources = array_reverse($this->definitionSources);
-
- if ($this->useAnnotations) {
- $autowiring = new AnnotationBasedAutowiring($this->ignorePhpDocErrors);
- $sources[] = $autowiring;
- } elseif ($this->useAutowiring) {
- $autowiring = new ReflectionBasedAutowiring;
- $sources[] = $autowiring;
- } else {
- $autowiring = new NoAutowiring;
- }
-
- $sources = array_map(function ($definitions) use ($autowiring) {
- if (is_string($definitions)) {
- // File
- return new DefinitionFile($definitions, $autowiring);
- } elseif (is_array($definitions)) {
- return new DefinitionArray($definitions, $autowiring);
- }
-
- return $definitions;
- }, $sources);
- $source = new SourceChain($sources);
-
- // Mutable definition source
- $source->setMutableDefinitionSource(new DefinitionArray([], $autowiring));
-
- if ($this->sourceCache) {
- if (!SourceCache::isSupported()) {
- throw new \Exception('APCu is not enabled, PHP-DI cannot use it as a cache');
- }
- // Wrap the source with the cache decorator
- $source = new SourceCache($source, $this->sourceCacheNamespace);
- }
-
- $proxyFactory = new ProxyFactory(
- $this->writeProxiesToFile,
- $this->proxyDirectory
- );
-
- $this->locked = true;
-
- $containerClass = $this->containerClass;
-
- if ($this->compileToDirectory) {
- $compiler = new Compiler($proxyFactory);
- $compiledContainerFile = $compiler->compile(
- $source,
- $this->compileToDirectory,
- $containerClass,
- $this->containerParentClass,
- $this->useAutowiring || $this->useAnnotations
- );
- // Only load the file if it hasn't been already loaded
- // (the container can be created multiple times in the same process)
- if (!class_exists($containerClass, false)) {
- require $compiledContainerFile;
- }
- }
-
- return new $containerClass($source, $proxyFactory, $this->wrapperContainer);
- }
-
- /**
- * Compile the container for optimum performances.
- *
- * Be aware that the container is compiled once and never updated!
- *
- * Therefore:
- *
- * - in production you should clear that directory every time you deploy
- * - in development you should not compile the container
- *
- * @see https://php-di.org/doc/performances.html
- *
- * @param string $directory Directory in which to put the compiled container.
- * @param string $containerClass Name of the compiled class. Customize only if necessary.
- * @param string $containerParentClass Name of the compiled container parent class. Customize only if necessary.
- */
- public function enableCompilation(
- string $directory,
- string $containerClass = 'CompiledContainer',
- string $containerParentClass = CompiledContainer::class
- ) : self {
- $this->ensureNotLocked();
-
- $this->compileToDirectory = $directory;
- $this->containerClass = $containerClass;
- $this->containerParentClass = $containerParentClass;
-
- return $this;
- }
-
- /**
- * Enable or disable the use of autowiring to guess injections.
- *
- * Enabled by default.
- *
- * @return $this
- */
- public function useAutowiring(bool $bool) : self
- {
- $this->ensureNotLocked();
-
- $this->useAutowiring = $bool;
-
- return $this;
- }
-
- /**
- * Enable or disable the use of annotations to guess injections.
- *
- * Disabled by default.
- *
- * @return $this
- */
- public function useAnnotations(bool $bool) : self
- {
- $this->ensureNotLocked();
-
- $this->useAnnotations = $bool;
-
- return $this;
- }
-
- /**
- * Enable or disable ignoring phpdoc errors (non-existent classes in `@param` or `@var`).
- *
- * @return $this
- */
- public function ignorePhpDocErrors(bool $bool) : self
- {
- $this->ensureNotLocked();
-
- $this->ignorePhpDocErrors = $bool;
-
- return $this;
- }
-
- /**
- * Configure the proxy generation.
- *
- * For dev environment, use `writeProxiesToFile(false)` (default configuration)
- * For production environment, use `writeProxiesToFile(true, 'tmp/proxies')`
- *
- * @see https://php-di.org/doc/lazy-injection.html
- *
- * @param bool $writeToFile If true, write the proxies to disk to improve performances
- * @param string|null $proxyDirectory Directory where to write the proxies
- * @throws InvalidArgumentException when writeToFile is set to true and the proxy directory is null
- * @return $this
- */
- public function writeProxiesToFile(bool $writeToFile, string $proxyDirectory = null) : self
- {
- $this->ensureNotLocked();
-
- $this->writeProxiesToFile = $writeToFile;
-
- if ($writeToFile && $proxyDirectory === null) {
- throw new InvalidArgumentException(
- 'The proxy directory must be specified if you want to write proxies on disk'
- );
- }
- $this->proxyDirectory = $proxyDirectory;
-
- return $this;
- }
-
- /**
- * If PHP-DI's container is wrapped by another container, we can
- * set this so that PHP-DI will use the wrapper rather than itself for building objects.
- *
- * @return $this
- */
- public function wrapContainer(ContainerInterface $otherContainer) : self
- {
- $this->ensureNotLocked();
-
- $this->wrapperContainer = $otherContainer;
-
- return $this;
- }
-
- /**
- * Add definitions to the container.
- *
- * @param string|array|DefinitionSource ...$definitions Can be an array of definitions, the
- * name of a file containing definitions
- * or a DefinitionSource object.
- * @return $this
- */
- public function addDefinitions(...$definitions) : self
- {
- $this->ensureNotLocked();
-
- foreach ($definitions as $definition) {
- if (!is_string($definition) && !is_array($definition) && !($definition instanceof DefinitionSource)) {
- throw new InvalidArgumentException(sprintf(
- '%s parameter must be a string, an array or a DefinitionSource object, %s given',
- 'ContainerBuilder::addDefinitions()',
- is_object($definition) ? get_class($definition) : gettype($definition)
- ));
- }
-
- $this->definitionSources[] = $definition;
- }
-
- return $this;
- }
-
- /**
- * Enables the use of APCu to cache definitions.
- *
- * You must have APCu enabled to use it.
- *
- * Before using this feature, you should try these steps first:
- * - enable compilation if not already done (see `enableCompilation()`)
- * - if you use autowiring or annotations, add all the classes you are using into your configuration so that
- * PHP-DI knows about them and compiles them
- * Once this is done, you can try to optimize performances further with APCu. It can also be useful if you use
- * `Container::make()` instead of `get()` (`make()` calls cannot be compiled so they are not optimized).
- *
- * Remember to clear APCu on each deploy else your application will have a stale cache. Do not enable the cache
- * in development environment: any change you will make to the code will be ignored because of the cache.
- *
- * @see https://php-di.org/doc/performances.html
- *
- * @param string $cacheNamespace use unique namespace per container when sharing a single APC memory pool to prevent cache collisions
- * @return $this
- */
- public function enableDefinitionCache(string $cacheNamespace = '') : self
- {
- $this->ensureNotLocked();
-
- $this->sourceCache = true;
- $this->sourceCacheNamespace = $cacheNamespace;
-
- return $this;
- }
-
- /**
- * Are we building a compiled container?
- */
- public function isCompilationEnabled() : bool
- {
- return (bool) $this->compileToDirectory;
- }
-
- private function ensureNotLocked()
- {
- if ($this->locked) {
- throw new \LogicException('The ContainerBuilder cannot be modified after the container has been built');
- }
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/ArrayDefinition.php b/vendor/php-di/php-di/src/Definition/ArrayDefinition.php
deleted file mode 100644
index ef77100..0000000
--- a/vendor/php-di/php-di/src/Definition/ArrayDefinition.php
+++ /dev/null
@@ -1,73 +0,0 @@
-
- */
-class ArrayDefinition implements Definition
-{
- /**
- * Entry name.
- * @var string
- */
- private $name = '';
-
- /**
- * @var array
- */
- private $values;
-
- public function __construct(array $values)
- {
- $this->values = $values;
- }
-
- public function getName() : string
- {
- return $this->name;
- }
-
- public function setName(string $name)
- {
- $this->name = $name;
- }
-
- public function getValues() : array
- {
- return $this->values;
- }
-
- public function replaceNestedDefinitions(callable $replacer)
- {
- $this->values = array_map($replacer, $this->values);
- }
-
- public function __toString()
- {
- $str = '[' . \PHP_EOL;
-
- foreach ($this->values as $key => $value) {
- if (is_string($key)) {
- $key = "'" . $key . "'";
- }
-
- $str .= ' ' . $key . ' => ';
-
- if ($value instanceof Definition) {
- $str .= str_replace(\PHP_EOL, \PHP_EOL . ' ', (string) $value);
- } else {
- $str .= var_export($value, true);
- }
-
- $str .= ',' . \PHP_EOL;
- }
-
- return $str . ']';
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/ArrayDefinitionExtension.php b/vendor/php-di/php-di/src/Definition/ArrayDefinitionExtension.php
deleted file mode 100644
index b494873..0000000
--- a/vendor/php-di/php-di/src/Definition/ArrayDefinitionExtension.php
+++ /dev/null
@@ -1,42 +0,0 @@
-
- */
-class ArrayDefinitionExtension extends ArrayDefinition implements ExtendsPreviousDefinition
-{
- /**
- * @var ArrayDefinition
- */
- private $subDefinition;
-
- public function getValues() : array
- {
- if (! $this->subDefinition) {
- return parent::getValues();
- }
-
- return array_merge($this->subDefinition->getValues(), parent::getValues());
- }
-
- public function setExtendedDefinition(Definition $definition)
- {
- if (! $definition instanceof ArrayDefinition) {
- throw new InvalidDefinition(sprintf(
- 'Definition %s tries to add array entries but the previous definition is not an array',
- $this->getName()
- ));
- }
-
- $this->subDefinition = $definition;
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/AutowireDefinition.php b/vendor/php-di/php-di/src/Definition/AutowireDefinition.php
deleted file mode 100644
index 25dc3ec..0000000
--- a/vendor/php-di/php-di/src/Definition/AutowireDefinition.php
+++ /dev/null
@@ -1,12 +0,0 @@
-
- */
-class AutowireDefinition extends ObjectDefinition
-{
-}
diff --git a/vendor/php-di/php-di/src/Definition/DecoratorDefinition.php b/vendor/php-di/php-di/src/Definition/DecoratorDefinition.php
deleted file mode 100644
index 4489485..0000000
--- a/vendor/php-di/php-di/src/Definition/DecoratorDefinition.php
+++ /dev/null
@@ -1,42 +0,0 @@
-
- */
-class DecoratorDefinition extends FactoryDefinition implements Definition, ExtendsPreviousDefinition
-{
- /**
- * @var Definition|null
- */
- private $decorated;
-
- public function setExtendedDefinition(Definition $definition)
- {
- $this->decorated = $definition;
- }
-
- /**
- * @return Definition|null
- */
- public function getDecoratedDefinition()
- {
- return $this->decorated;
- }
-
- public function replaceNestedDefinitions(callable $replacer)
- {
- // no nested definitions
- }
-
- public function __toString()
- {
- return 'Decorate(' . $this->getName() . ')';
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Definition.php b/vendor/php-di/php-di/src/Definition/Definition.php
deleted file mode 100644
index 696838d..0000000
--- a/vendor/php-di/php-di/src/Definition/Definition.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
- */
-interface Definition extends RequestedEntry
-{
- /**
- * Returns the name of the entry in the container.
- */
- public function getName() : string;
-
- /**
- * Set the name of the entry in the container.
- */
- public function setName(string $name);
-
- /**
- * Apply a callable that replaces the definitions nested in this definition.
- */
- public function replaceNestedDefinitions(callable $replacer);
-
- /**
- * Definitions can be cast to string for debugging information.
- */
- public function __toString();
-}
diff --git a/vendor/php-di/php-di/src/Definition/Dumper/ObjectDefinitionDumper.php b/vendor/php-di/php-di/src/Definition/Dumper/ObjectDefinitionDumper.php
deleted file mode 100644
index b99695f..0000000
--- a/vendor/php-di/php-di/src/Definition/Dumper/ObjectDefinitionDumper.php
+++ /dev/null
@@ -1,135 +0,0 @@
-
- */
-class ObjectDefinitionDumper
-{
- /**
- * Returns the definition as string representation.
- */
- public function dump(ObjectDefinition $definition) : string
- {
- $className = $definition->getClassName();
- $classExist = class_exists($className) || interface_exists($className);
-
- // Class
- if (! $classExist) {
- $warning = '#UNKNOWN# ';
- } else {
- $class = new \ReflectionClass($className);
- $warning = $class->isInstantiable() ? '' : '#NOT INSTANTIABLE# ';
- }
- $str = sprintf(' class = %s%s', $warning, $className);
-
- // Lazy
- $str .= \PHP_EOL . ' lazy = ' . var_export($definition->isLazy(), true);
-
- if ($classExist) {
- // Constructor
- $str .= $this->dumpConstructor($className, $definition);
-
- // Properties
- $str .= $this->dumpProperties($definition);
-
- // Methods
- $str .= $this->dumpMethods($className, $definition);
- }
-
- return sprintf('Object (' . \PHP_EOL . '%s' . \PHP_EOL . ')', $str);
- }
-
- private function dumpConstructor(string $className, ObjectDefinition $definition) : string
- {
- $str = '';
-
- $constructorInjection = $definition->getConstructorInjection();
-
- if ($constructorInjection !== null) {
- $parameters = $this->dumpMethodParameters($className, $constructorInjection);
-
- $str .= sprintf(\PHP_EOL . ' __construct(' . \PHP_EOL . ' %s' . \PHP_EOL . ' )', $parameters);
- }
-
- return $str;
- }
-
- private function dumpProperties(ObjectDefinition $definition) : string
- {
- $str = '';
-
- foreach ($definition->getPropertyInjections() as $propertyInjection) {
- $value = $propertyInjection->getValue();
- $valueStr = $value instanceof Definition ? (string) $value : var_export($value, true);
-
- $str .= sprintf(\PHP_EOL . ' $%s = %s', $propertyInjection->getPropertyName(), $valueStr);
- }
-
- return $str;
- }
-
- private function dumpMethods(string $className, ObjectDefinition $definition) : string
- {
- $str = '';
-
- foreach ($definition->getMethodInjections() as $methodInjection) {
- $parameters = $this->dumpMethodParameters($className, $methodInjection);
-
- $str .= sprintf(\PHP_EOL . ' %s(' . \PHP_EOL . ' %s' . \PHP_EOL . ' )', $methodInjection->getMethodName(), $parameters);
- }
-
- return $str;
- }
-
- private function dumpMethodParameters(string $className, MethodInjection $methodInjection) : string
- {
- $methodReflection = new \ReflectionMethod($className, $methodInjection->getMethodName());
-
- $args = [];
-
- $definitionParameters = $methodInjection->getParameters();
-
- foreach ($methodReflection->getParameters() as $index => $parameter) {
- if (array_key_exists($index, $definitionParameters)) {
- $value = $definitionParameters[$index];
- $valueStr = $value instanceof Definition ? (string) $value : var_export($value, true);
-
- $args[] = sprintf('$%s = %s', $parameter->getName(), $valueStr);
-
- continue;
- }
-
- // If the parameter is optional and wasn't specified, we take its default value
- if ($parameter->isOptional()) {
- try {
- $value = $parameter->getDefaultValue();
-
- $args[] = sprintf(
- '$%s = (default value) %s',
- $parameter->getName(),
- var_export($value, true)
- );
- continue;
- } catch (ReflectionException $e) {
- // The default value can't be read through Reflection because it is a PHP internal class
- }
- }
-
- $args[] = sprintf('$%s = #UNDEFINED#', $parameter->getName());
- }
-
- return implode(\PHP_EOL . ' ', $args);
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/EnvironmentVariableDefinition.php b/vendor/php-di/php-di/src/Definition/EnvironmentVariableDefinition.php
deleted file mode 100644
index b2a80c3..0000000
--- a/vendor/php-di/php-di/src/Definition/EnvironmentVariableDefinition.php
+++ /dev/null
@@ -1,112 +0,0 @@
-
- */
-class EnvironmentVariableDefinition implements Definition
-{
- /**
- * Entry name.
- * @var string
- */
- private $name = '';
-
- /**
- * The name of the environment variable.
- * @var string
- */
- private $variableName;
-
- /**
- * Whether or not the environment variable definition is optional.
- *
- * If true and the environment variable given by $variableName has not been
- * defined, $defaultValue is used.
- *
- * @var bool
- */
- private $isOptional;
-
- /**
- * The default value to use if the environment variable is optional and not provided.
- * @var mixed
- */
- private $defaultValue;
-
- /**
- * @param string $variableName The name of the environment variable
- * @param bool $isOptional Whether or not the environment variable definition is optional
- * @param mixed $defaultValue The default value to use if the environment variable is optional and not provided
- */
- public function __construct(string $variableName, bool $isOptional = false, $defaultValue = null)
- {
- $this->variableName = $variableName;
- $this->isOptional = $isOptional;
- $this->defaultValue = $defaultValue;
- }
-
- public function getName() : string
- {
- return $this->name;
- }
-
- public function setName(string $name)
- {
- $this->name = $name;
- }
-
- /**
- * @return string The name of the environment variable
- */
- public function getVariableName() : string
- {
- return $this->variableName;
- }
-
- /**
- * @return bool Whether or not the environment variable definition is optional
- */
- public function isOptional() : bool
- {
- return $this->isOptional;
- }
-
- /**
- * @return mixed The default value to use if the environment variable is optional and not provided
- */
- public function getDefaultValue()
- {
- return $this->defaultValue;
- }
-
- public function replaceNestedDefinitions(callable $replacer)
- {
- $this->defaultValue = $replacer($this->defaultValue);
- }
-
- public function __toString()
- {
- $str = ' variable = ' . $this->variableName . \PHP_EOL
- . ' optional = ' . ($this->isOptional ? 'yes' : 'no');
-
- if ($this->isOptional) {
- if ($this->defaultValue instanceof Definition) {
- $nestedDefinition = (string) $this->defaultValue;
- $defaultValueStr = str_replace(\PHP_EOL, \PHP_EOL . ' ', $nestedDefinition);
- } else {
- $defaultValueStr = var_export($this->defaultValue, true);
- }
-
- $str .= \PHP_EOL . ' default = ' . $defaultValueStr;
- }
-
- return sprintf('Environment variable (' . \PHP_EOL . '%s' . \PHP_EOL . ')', $str);
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Exception/InvalidAnnotation.php b/vendor/php-di/php-di/src/Definition/Exception/InvalidAnnotation.php
deleted file mode 100644
index 630c34a..0000000
--- a/vendor/php-di/php-di/src/Definition/Exception/InvalidAnnotation.php
+++ /dev/null
@@ -1,14 +0,0 @@
-
- */
-class InvalidAnnotation extends InvalidDefinition
-{
-}
diff --git a/vendor/php-di/php-di/src/Definition/Exception/InvalidDefinition.php b/vendor/php-di/php-di/src/Definition/Exception/InvalidDefinition.php
deleted file mode 100644
index f00d93e..0000000
--- a/vendor/php-di/php-di/src/Definition/Exception/InvalidDefinition.php
+++ /dev/null
@@ -1,25 +0,0 @@
-
- */
-class InvalidDefinition extends \Exception implements ContainerExceptionInterface
-{
- public static function create(Definition $definition, string $message, \Exception $previous = null) : self
- {
- return new self(sprintf(
- '%s' . \PHP_EOL . 'Full definition:' . \PHP_EOL . '%s',
- $message,
- (string) $definition
- ), 0, $previous);
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/ExtendsPreviousDefinition.php b/vendor/php-di/php-di/src/Definition/ExtendsPreviousDefinition.php
deleted file mode 100644
index 0b26933..0000000
--- a/vendor/php-di/php-di/src/Definition/ExtendsPreviousDefinition.php
+++ /dev/null
@@ -1,15 +0,0 @@
-
- */
-interface ExtendsPreviousDefinition extends Definition
-{
- public function setExtendedDefinition(Definition $definition);
-}
diff --git a/vendor/php-di/php-di/src/Definition/FactoryDefinition.php b/vendor/php-di/php-di/src/Definition/FactoryDefinition.php
deleted file mode 100644
index ed0936f..0000000
--- a/vendor/php-di/php-di/src/Definition/FactoryDefinition.php
+++ /dev/null
@@ -1,79 +0,0 @@
-
- */
-class FactoryDefinition implements Definition
-{
- /**
- * Entry name.
- * @var string
- */
- private $name;
-
- /**
- * Callable that returns the value.
- * @var callable
- */
- private $factory;
-
- /**
- * Factory parameters.
- * @var mixed[]
- */
- private $parameters = [];
-
- /**
- * @param string $name Entry name
- * @param callable $factory Callable that returns the value associated to the entry name.
- * @param array $parameters Parameters to be passed to the callable
- */
- public function __construct(string $name, $factory, array $parameters = [])
- {
- $this->name = $name;
- $this->factory = $factory;
- $this->parameters = $parameters;
- }
-
- public function getName() : string
- {
- return $this->name;
- }
-
- public function setName(string $name)
- {
- $this->name = $name;
- }
-
- /**
- * @return callable Callable that returns the value associated to the entry name.
- */
- public function getCallable()
- {
- return $this->factory;
- }
-
- /**
- * @return array Array containing the parameters to be passed to the callable, indexed by name.
- */
- public function getParameters() : array
- {
- return $this->parameters;
- }
-
- public function replaceNestedDefinitions(callable $replacer)
- {
- $this->parameters = array_map($replacer, $this->parameters);
- }
-
- public function __toString()
- {
- return 'Factory';
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Helper/AutowireDefinitionHelper.php b/vendor/php-di/php-di/src/Definition/Helper/AutowireDefinitionHelper.php
deleted file mode 100644
index 8dfa4e2..0000000
--- a/vendor/php-di/php-di/src/Definition/Helper/AutowireDefinitionHelper.php
+++ /dev/null
@@ -1,72 +0,0 @@
-
- */
-class AutowireDefinitionHelper extends CreateDefinitionHelper
-{
- const DEFINITION_CLASS = AutowireDefinition::class;
-
- /**
- * Defines a value for a specific argument of the constructor.
- *
- * This method is usually used together with annotations or autowiring, when a parameter
- * is not (or cannot be) type-hinted. Using this method instead of constructor() allows to
- * avoid defining all the parameters (letting them being resolved using annotations or autowiring)
- * and only define one.
- *
- * @param string|int $parameter Parameter name of position for which the value will be given.
- * @param mixed $value Value to give to this parameter.
- *
- * @return $this
- */
- public function constructorParameter($parameter, $value)
- {
- $this->constructor[$parameter] = $value;
-
- return $this;
- }
-
- /**
- * Defines a method to call and a value for a specific argument.
- *
- * This method is usually used together with annotations or autowiring, when a parameter
- * is not (or cannot be) type-hinted. Using this method instead of method() allows to
- * avoid defining all the parameters (letting them being resolved using annotations or
- * autowiring) and only define one.
- *
- * If multiple calls to the method have been configured already (e.g. in a previous definition)
- * then this method only overrides the parameter for the *first* call.
- *
- * @param string $method Name of the method to call.
- * @param string|int $parameter Parameter name of position for which the value will be given.
- * @param mixed $value Value to give to this parameter.
- *
- * @return $this
- */
- public function methodParameter(string $method, $parameter, $value)
- {
- // Special case for the constructor
- if ($method === '__construct') {
- $this->constructor[$parameter] = $value;
-
- return $this;
- }
-
- if (! isset($this->methods[$method])) {
- $this->methods[$method] = [0 => []];
- }
-
- $this->methods[$method][0][$parameter] = $value;
-
- return $this;
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Helper/CreateDefinitionHelper.php b/vendor/php-di/php-di/src/Definition/Helper/CreateDefinitionHelper.php
deleted file mode 100644
index aeae071..0000000
--- a/vendor/php-di/php-di/src/Definition/Helper/CreateDefinitionHelper.php
+++ /dev/null
@@ -1,202 +0,0 @@
-
- */
-class CreateDefinitionHelper implements DefinitionHelper
-{
- const DEFINITION_CLASS = ObjectDefinition::class;
-
- /**
- * @var string|null
- */
- private $className;
-
- /**
- * @var bool|null
- */
- private $lazy;
-
- /**
- * Array of constructor parameters.
- * @var array
- */
- protected $constructor = [];
-
- /**
- * Array of properties and their value.
- * @var array
- */
- private $properties = [];
-
- /**
- * Array of methods and their parameters.
- * @var array
- */
- protected $methods = [];
-
- /**
- * Helper for defining an object.
- *
- * @param string|null $className Class name of the object.
- * If null, the name of the entry (in the container) will be used as class name.
- */
- public function __construct(string $className = null)
- {
- $this->className = $className;
- }
-
- /**
- * Define the entry as lazy.
- *
- * A lazy entry is created only when it is used, a proxy is injected instead.
- *
- * @return $this
- */
- public function lazy()
- {
- $this->lazy = true;
-
- return $this;
- }
-
- /**
- * Defines the arguments to use to call the constructor.
- *
- * This method takes a variable number of arguments, example:
- * ->constructor($param1, $param2, $param3)
- *
- * @param mixed... $parameters Parameters to use for calling the constructor of the class.
- *
- * @return $this
- */
- public function constructor(...$parameters)
- {
- $this->constructor = $parameters;
-
- return $this;
- }
-
- /**
- * Defines a value to inject in a property of the object.
- *
- * @param string $property Entry in which to inject the value.
- * @param mixed $value Value to inject in the property.
- *
- * @return $this
- */
- public function property(string $property, $value)
- {
- $this->properties[$property] = $value;
-
- return $this;
- }
-
- /**
- * Defines a method to call and the arguments to use.
- *
- * This method takes a variable number of arguments after the method name, example:
- *
- * ->method('myMethod', $param1, $param2)
- *
- * Can be used multiple times to declare multiple calls.
- *
- * @param string $method Name of the method to call.
- * @param mixed... $parameters Parameters to use for calling the method.
- *
- * @return $this
- */
- public function method(string $method, ...$parameters)
- {
- if (! isset($this->methods[$method])) {
- $this->methods[$method] = [];
- }
-
- $this->methods[$method][] = $parameters;
-
- return $this;
- }
-
- /**
- * @return ObjectDefinition
- */
- public function getDefinition(string $entryName) : Definition
- {
- $class = $this::DEFINITION_CLASS;
- /** @var ObjectDefinition $definition */
- $definition = new $class($entryName, $this->className);
-
- if ($this->lazy !== null) {
- $definition->setLazy($this->lazy);
- }
-
- if (! empty($this->constructor)) {
- $parameters = $this->fixParameters($definition, '__construct', $this->constructor);
- $constructorInjection = MethodInjection::constructor($parameters);
- $definition->setConstructorInjection($constructorInjection);
- }
-
- if (! empty($this->properties)) {
- foreach ($this->properties as $property => $value) {
- $definition->addPropertyInjection(
- new PropertyInjection($property, $value)
- );
- }
- }
-
- if (! empty($this->methods)) {
- foreach ($this->methods as $method => $calls) {
- foreach ($calls as $parameters) {
- $parameters = $this->fixParameters($definition, $method, $parameters);
- $methodInjection = new MethodInjection($method, $parameters);
- $definition->addMethodInjection($methodInjection);
- }
- }
- }
-
- return $definition;
- }
-
- /**
- * Fixes parameters indexed by the parameter name -> reindex by position.
- *
- * This is necessary so that merging definitions between sources is possible.
- *
- * @throws InvalidDefinition
- */
- private function fixParameters(ObjectDefinition $definition, string $method, array $parameters) : array
- {
- $fixedParameters = [];
-
- foreach ($parameters as $index => $parameter) {
- // Parameter indexed by the parameter name, we reindex it with its position
- if (is_string($index)) {
- $callable = [$definition->getClassName(), $method];
-
- try {
- $reflectionParameter = new \ReflectionParameter($callable, $index);
- } catch (\ReflectionException $e) {
- throw InvalidDefinition::create($definition, sprintf("Parameter with name '%s' could not be found. %s.", $index, $e->getMessage()));
- }
-
- $index = $reflectionParameter->getPosition();
- }
-
- $fixedParameters[$index] = $parameter;
- }
-
- return $fixedParameters;
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Helper/DefinitionHelper.php b/vendor/php-di/php-di/src/Definition/Helper/DefinitionHelper.php
deleted file mode 100644
index 327167e..0000000
--- a/vendor/php-di/php-di/src/Definition/Helper/DefinitionHelper.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
- */
-interface DefinitionHelper
-{
- /**
- * @param string $entryName Container entry name
- */
- public function getDefinition(string $entryName) : Definition;
-}
diff --git a/vendor/php-di/php-di/src/Definition/Helper/FactoryDefinitionHelper.php b/vendor/php-di/php-di/src/Definition/Helper/FactoryDefinitionHelper.php
deleted file mode 100644
index 0a22319..0000000
--- a/vendor/php-di/php-di/src/Definition/Helper/FactoryDefinitionHelper.php
+++ /dev/null
@@ -1,75 +0,0 @@
-
- */
-class FactoryDefinitionHelper implements DefinitionHelper
-{
- /**
- * @var callable
- */
- private $factory;
-
- /**
- * @var bool
- */
- private $decorate;
-
- /**
- * @var array
- */
- private $parameters = [];
-
- /**
- * @param callable $factory
- * @param bool $decorate Is the factory decorating a previous definition?
- */
- public function __construct($factory, bool $decorate = false)
- {
- $this->factory = $factory;
- $this->decorate = $decorate;
- }
-
- /**
- * @param string $entryName Container entry name
- * @return FactoryDefinition
- */
- public function getDefinition(string $entryName) : Definition
- {
- if ($this->decorate) {
- return new DecoratorDefinition($entryName, $this->factory, $this->parameters);
- }
-
- return new FactoryDefinition($entryName, $this->factory, $this->parameters);
- }
-
- /**
- * Defines arguments to pass to the factory.
- *
- * Because factory methods do not yet support annotations or autowiring, this method
- * should be used to define all parameters except the ContainerInterface and RequestedEntry.
- *
- * Multiple calls can be made to the method to override individual values.
- *
- * @param string $parameter Name or index of the parameter for which the value will be given.
- * @param mixed $value Value to give to this parameter.
- *
- * @return $this
- */
- public function parameter(string $parameter, $value)
- {
- $this->parameters[$parameter] = $value;
-
- return $this;
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/InstanceDefinition.php b/vendor/php-di/php-di/src/Definition/InstanceDefinition.php
deleted file mode 100644
index 4c281c6..0000000
--- a/vendor/php-di/php-di/src/Definition/InstanceDefinition.php
+++ /dev/null
@@ -1,69 +0,0 @@
-
- */
-class InstanceDefinition implements Definition
-{
- /**
- * Instance on which to inject dependencies.
- *
- * @var object
- */
- private $instance;
-
- /**
- * @var ObjectDefinition
- */
- private $objectDefinition;
-
- /**
- * @param object $instance
- */
- public function __construct($instance, ObjectDefinition $objectDefinition)
- {
- $this->instance = $instance;
- $this->objectDefinition = $objectDefinition;
- }
-
- public function getName() : string
- {
- // Name are superfluous for instance definitions
- return '';
- }
-
- public function setName(string $name)
- {
- // Name are superfluous for instance definitions
- }
-
- /**
- * @return object
- */
- public function getInstance()
- {
- return $this->instance;
- }
-
- public function getObjectDefinition() : ObjectDefinition
- {
- return $this->objectDefinition;
- }
-
- public function replaceNestedDefinitions(callable $replacer)
- {
- $this->objectDefinition->replaceNestedDefinitions($replacer);
- }
-
- public function __toString()
- {
- return 'Instance';
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/ObjectDefinition.php b/vendor/php-di/php-di/src/Definition/ObjectDefinition.php
deleted file mode 100644
index 8d8d5b6..0000000
--- a/vendor/php-di/php-di/src/Definition/ObjectDefinition.php
+++ /dev/null
@@ -1,266 +0,0 @@
-
- */
-class ObjectDefinition implements Definition
-{
- /**
- * Entry name (most of the time, same as $classname).
- * @var string
- */
- private $name;
-
- /**
- * Class name (if null, then the class name is $name).
- * @var string|null
- */
- protected $className;
-
- /**
- * Constructor parameter injection.
- * @var MethodInjection|null
- */
- protected $constructorInjection;
-
- /**
- * Property injections.
- * @var PropertyInjection[]
- */
- protected $propertyInjections = [];
-
- /**
- * Method calls.
- * @var MethodInjection[][]
- */
- protected $methodInjections = [];
-
- /**
- * @var bool|null
- */
- protected $lazy;
-
- /**
- * Store if the class exists. Storing it (in cache) avoids recomputing this.
- *
- * @var bool
- */
- private $classExists;
-
- /**
- * Store if the class is instantiable. Storing it (in cache) avoids recomputing this.
- *
- * @var bool
- */
- private $isInstantiable;
-
- /**
- * @param string $name Entry name
- */
- public function __construct(string $name, string $className = null)
- {
- $this->name = $name;
- $this->setClassName($className);
- }
-
- public function getName() : string
- {
- return $this->name;
- }
-
- public function setName(string $name)
- {
- $this->name = $name;
- }
-
- public function setClassName(string $className = null)
- {
- $this->className = $className;
-
- $this->updateCache();
- }
-
- public function getClassName() : string
- {
- if ($this->className !== null) {
- return $this->className;
- }
-
- return $this->name;
- }
-
- /**
- * @return MethodInjection|null
- */
- public function getConstructorInjection()
- {
- return $this->constructorInjection;
- }
-
- public function setConstructorInjection(MethodInjection $constructorInjection)
- {
- $this->constructorInjection = $constructorInjection;
- }
-
- public function completeConstructorInjection(MethodInjection $injection)
- {
- if ($this->constructorInjection !== null) {
- // Merge
- $this->constructorInjection->merge($injection);
- } else {
- // Set
- $this->constructorInjection = $injection;
- }
- }
-
- /**
- * @return PropertyInjection[] Property injections
- */
- public function getPropertyInjections() : array
- {
- return $this->propertyInjections;
- }
-
- public function addPropertyInjection(PropertyInjection $propertyInjection)
- {
- $className = $propertyInjection->getClassName();
- if ($className) {
- // Index with the class name to avoid collisions between parent and
- // child private properties with the same name
- $key = $className . '::' . $propertyInjection->getPropertyName();
- } else {
- $key = $propertyInjection->getPropertyName();
- }
-
- $this->propertyInjections[$key] = $propertyInjection;
- }
-
- /**
- * @return MethodInjection[] Method injections
- */
- public function getMethodInjections() : array
- {
- // Return array leafs
- $injections = [];
- array_walk_recursive($this->methodInjections, function ($injection) use (&$injections) {
- $injections[] = $injection;
- });
-
- return $injections;
- }
-
- public function addMethodInjection(MethodInjection $methodInjection)
- {
- $method = $methodInjection->getMethodName();
- if (! isset($this->methodInjections[$method])) {
- $this->methodInjections[$method] = [];
- }
- $this->methodInjections[$method][] = $methodInjection;
- }
-
- public function completeFirstMethodInjection(MethodInjection $injection)
- {
- $method = $injection->getMethodName();
-
- if (isset($this->methodInjections[$method][0])) {
- // Merge
- $this->methodInjections[$method][0]->merge($injection);
- } else {
- // Set
- $this->addMethodInjection($injection);
- }
- }
-
- public function setLazy(bool $lazy = null)
- {
- $this->lazy = $lazy;
- }
-
- public function isLazy() : bool
- {
- if ($this->lazy !== null) {
- return $this->lazy;
- }
- // Default value
- return false;
- }
-
- public function classExists() : bool
- {
- return $this->classExists;
- }
-
- public function isInstantiable() : bool
- {
- return $this->isInstantiable;
- }
-
- public function replaceNestedDefinitions(callable $replacer)
- {
- array_walk($this->propertyInjections, function (PropertyInjection $propertyInjection) use ($replacer) {
- $propertyInjection->replaceNestedDefinition($replacer);
- });
-
- if ($this->constructorInjection) {
- $this->constructorInjection->replaceNestedDefinitions($replacer);
- }
-
- array_walk($this->methodInjections, function ($injectionArray) use ($replacer) {
- array_walk($injectionArray, function (MethodInjection $methodInjection) use ($replacer) {
- $methodInjection->replaceNestedDefinitions($replacer);
- });
- });
- }
-
- /**
- * Replaces all the wildcards in the string with the given replacements.
- *
- * @param string[] $replacements
- */
- public function replaceWildcards(array $replacements)
- {
- $className = $this->getClassName();
-
- foreach ($replacements as $replacement) {
- $pos = strpos($className, DefinitionArray::WILDCARD);
- if ($pos !== false) {
- $className = substr_replace($className, $replacement, $pos, 1);
- }
- }
-
- $this->setClassName($className);
- }
-
- public function __toString()
- {
- return (new ObjectDefinitionDumper)->dump($this);
- }
-
- private function updateCache()
- {
- $className = $this->getClassName();
-
- $this->classExists = class_exists($className) || interface_exists($className);
-
- if (! $this->classExists) {
- $this->isInstantiable = false;
-
- return;
- }
-
- $class = new ReflectionClass($className);
- $this->isInstantiable = $class->isInstantiable();
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/ObjectDefinition/MethodInjection.php b/vendor/php-di/php-di/src/Definition/ObjectDefinition/MethodInjection.php
deleted file mode 100644
index 5fb67ce..0000000
--- a/vendor/php-di/php-di/src/Definition/ObjectDefinition/MethodInjection.php
+++ /dev/null
@@ -1,86 +0,0 @@
-
- */
-class MethodInjection implements Definition
-{
- /**
- * @var string
- */
- private $methodName;
-
- /**
- * @var mixed[]
- */
- private $parameters = [];
-
- public function __construct(string $methodName, array $parameters = [])
- {
- $this->methodName = $methodName;
- $this->parameters = $parameters;
- }
-
- public static function constructor(array $parameters = []) : self
- {
- return new self('__construct', $parameters);
- }
-
- public function getMethodName() : string
- {
- return $this->methodName;
- }
-
- /**
- * @return mixed[]
- */
- public function getParameters() : array
- {
- return $this->parameters;
- }
-
- /**
- * Replace the parameters of the definition by a new array of parameters.
- */
- public function replaceParameters(array $parameters)
- {
- $this->parameters = $parameters;
- }
-
- public function merge(self $definition)
- {
- // In case of conflicts, the current definition prevails.
- $this->parameters = $this->parameters + $definition->parameters;
- }
-
- public function getName() : string
- {
- return '';
- }
-
- public function setName(string $name)
- {
- // The name does not matter for method injections
- }
-
- public function replaceNestedDefinitions(callable $replacer)
- {
- $this->parameters = array_map($replacer, $this->parameters);
- }
-
- /**
- * {@inheritdoc}
- */
- public function __toString()
- {
- return sprintf('method(%s)', $this->methodName);
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/ObjectDefinition/PropertyInjection.php b/vendor/php-di/php-di/src/Definition/ObjectDefinition/PropertyInjection.php
deleted file mode 100644
index 307ba64..0000000
--- a/vendor/php-di/php-di/src/Definition/ObjectDefinition/PropertyInjection.php
+++ /dev/null
@@ -1,70 +0,0 @@
-
- */
-class PropertyInjection
-{
- /**
- * Property name.
- * @var string
- */
- private $propertyName;
-
- /**
- * Value that should be injected in the property.
- * @var mixed
- */
- private $value;
-
- /**
- * Use for injecting in properties of parent classes: the class name
- * must be the name of the parent class because private properties
- * can be attached to the parent classes, not the one we are resolving.
- * @var string|null
- */
- private $className;
-
- /**
- * @param string $propertyName Property name
- * @param mixed $value Value that should be injected in the property
- */
- public function __construct(string $propertyName, $value, string $className = null)
- {
- $this->propertyName = $propertyName;
- $this->value = $value;
- $this->className = $className;
- }
-
- public function getPropertyName() : string
- {
- return $this->propertyName;
- }
-
- /**
- * @return mixed Value that should be injected in the property
- */
- public function getValue()
- {
- return $this->value;
- }
-
- /**
- * @return string|null
- */
- public function getClassName()
- {
- return $this->className;
- }
-
- public function replaceNestedDefinition(callable $replacer)
- {
- $this->value = $replacer($this->value);
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Reference.php b/vendor/php-di/php-di/src/Definition/Reference.php
deleted file mode 100644
index 5b4597a..0000000
--- a/vendor/php-di/php-di/src/Definition/Reference.php
+++ /dev/null
@@ -1,73 +0,0 @@
-
- */
-class Reference implements Definition, SelfResolvingDefinition
-{
- /**
- * Entry name.
- * @var string
- */
- private $name = '';
-
- /**
- * Name of the target entry.
- * @var string
- */
- private $targetEntryName;
-
- /**
- * @param string $targetEntryName Name of the target entry
- */
- public function __construct(string $targetEntryName)
- {
- $this->targetEntryName = $targetEntryName;
- }
-
- public function getName() : string
- {
- return $this->name;
- }
-
- public function setName(string $name)
- {
- $this->name = $name;
- }
-
- public function getTargetEntryName() : string
- {
- return $this->targetEntryName;
- }
-
- public function resolve(ContainerInterface $container)
- {
- return $container->get($this->getTargetEntryName());
- }
-
- public function isResolvable(ContainerInterface $container) : bool
- {
- return $container->has($this->getTargetEntryName());
- }
-
- public function replaceNestedDefinitions(callable $replacer)
- {
- // no nested definitions
- }
-
- public function __toString()
- {
- return sprintf(
- 'get(%s)',
- $this->targetEntryName
- );
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Resolver/ArrayResolver.php b/vendor/php-di/php-di/src/Definition/Resolver/ArrayResolver.php
deleted file mode 100644
index 30a715b..0000000
--- a/vendor/php-di/php-di/src/Definition/Resolver/ArrayResolver.php
+++ /dev/null
@@ -1,74 +0,0 @@
-
- */
-class ArrayResolver implements DefinitionResolver
-{
- /**
- * @var DefinitionResolver
- */
- private $definitionResolver;
-
- /**
- * @param DefinitionResolver $definitionResolver Used to resolve nested definitions.
- */
- public function __construct(DefinitionResolver $definitionResolver)
- {
- $this->definitionResolver = $definitionResolver;
- }
-
- /**
- * Resolve an array definition to a value.
- *
- * An array definition can contain simple values or references to other entries.
- *
- * @param ArrayDefinition $definition
- */
- public function resolve(Definition $definition, array $parameters = []) : array
- {
- $values = $definition->getValues();
-
- // Resolve nested definitions
- array_walk_recursive($values, function (& $value, $key) use ($definition) {
- if ($value instanceof Definition) {
- $value = $this->resolveDefinition($value, $definition, $key);
- }
- });
-
- return $values;
- }
-
- public function isResolvable(Definition $definition, array $parameters = []) : bool
- {
- return true;
- }
-
- private function resolveDefinition(Definition $value, ArrayDefinition $definition, $key)
- {
- try {
- return $this->definitionResolver->resolve($value);
- } catch (DependencyException $e) {
- throw $e;
- } catch (Exception $e) {
- throw new DependencyException(sprintf(
- 'Error while resolving %s[%s]. %s',
- $definition->getName(),
- $key,
- $e->getMessage()
- ), 0, $e);
- }
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Resolver/DecoratorResolver.php b/vendor/php-di/php-di/src/Definition/Resolver/DecoratorResolver.php
deleted file mode 100644
index 03585ea..0000000
--- a/vendor/php-di/php-di/src/Definition/Resolver/DecoratorResolver.php
+++ /dev/null
@@ -1,82 +0,0 @@
-
- */
-class DecoratorResolver implements DefinitionResolver
-{
- /**
- * @var ContainerInterface
- */
- private $container;
-
- /**
- * @var DefinitionResolver
- */
- private $definitionResolver;
-
- /**
- * The resolver needs a container. This container will be passed to the factory as a parameter
- * so that the factory can access other entries of the container.
- *
- * @param DefinitionResolver $definitionResolver Used to resolve nested definitions.
- */
- public function __construct(ContainerInterface $container, DefinitionResolver $definitionResolver)
- {
- $this->container = $container;
- $this->definitionResolver = $definitionResolver;
- }
-
- /**
- * Resolve a decorator definition to a value.
- *
- * This will call the callable of the definition and pass it the decorated entry.
- *
- * @param DecoratorDefinition $definition
- */
- public function resolve(Definition $definition, array $parameters = [])
- {
- $callable = $definition->getCallable();
-
- if (! is_callable($callable)) {
- throw new InvalidDefinition(sprintf(
- 'The decorator "%s" is not callable',
- $definition->getName()
- ));
- }
-
- $decoratedDefinition = $definition->getDecoratedDefinition();
-
- if (! $decoratedDefinition instanceof Definition) {
- if (! $definition->getName()) {
- throw new InvalidDefinition('Decorators cannot be nested in another definition');
- }
-
- throw new InvalidDefinition(sprintf(
- 'Entry "%s" decorates nothing: no previous definition with the same name was found',
- $definition->getName()
- ));
- }
-
- $decorated = $this->definitionResolver->resolve($decoratedDefinition, $parameters);
-
- return call_user_func($callable, $decorated, $this->container);
- }
-
- public function isResolvable(Definition $definition, array $parameters = []) : bool
- {
- return true;
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Resolver/DefinitionResolver.php b/vendor/php-di/php-di/src/Definition/Resolver/DefinitionResolver.php
deleted file mode 100644
index 56b5383..0000000
--- a/vendor/php-di/php-di/src/Definition/Resolver/DefinitionResolver.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
- */
-interface DefinitionResolver
-{
- /**
- * Resolve a definition to a value.
- *
- * @param Definition $definition Object that defines how the value should be obtained.
- * @param array $parameters Optional parameters to use to build the entry.
- *
- * @throws InvalidDefinition If the definition cannot be resolved.
- *
- * @return mixed Value obtained from the definition.
- */
- public function resolve(Definition $definition, array $parameters = []);
-
- /**
- * Check if a definition can be resolved.
- *
- * @param Definition $definition Object that defines how the value should be obtained.
- * @param array $parameters Optional parameters to use to build the entry.
- */
- public function isResolvable(Definition $definition, array $parameters = []) : bool;
-}
diff --git a/vendor/php-di/php-di/src/Definition/Resolver/EnvironmentVariableResolver.php b/vendor/php-di/php-di/src/Definition/Resolver/EnvironmentVariableResolver.php
deleted file mode 100644
index 77f5b92..0000000
--- a/vendor/php-di/php-di/src/Definition/Resolver/EnvironmentVariableResolver.php
+++ /dev/null
@@ -1,79 +0,0 @@
-
- */
-class EnvironmentVariableResolver implements DefinitionResolver
-{
- /**
- * @var DefinitionResolver
- */
- private $definitionResolver;
-
- /**
- * @var callable
- */
- private $variableReader;
-
- public function __construct(DefinitionResolver $definitionResolver, $variableReader = null)
- {
- $this->definitionResolver = $definitionResolver;
- $this->variableReader = $variableReader ?? [$this, 'getEnvVariable'];
- }
-
- /**
- * Resolve an environment variable definition to a value.
- *
- * @param EnvironmentVariableDefinition $definition
- */
- public function resolve(Definition $definition, array $parameters = [])
- {
- $value = call_user_func($this->variableReader, $definition->getVariableName());
-
- if (false !== $value) {
- return $value;
- }
-
- if (!$definition->isOptional()) {
- throw new InvalidDefinition(sprintf(
- "The environment variable '%s' has not been defined",
- $definition->getVariableName()
- ));
- }
-
- $value = $definition->getDefaultValue();
-
- // Nested definition
- if ($value instanceof Definition) {
- return $this->definitionResolver->resolve($value);
- }
-
- return $value;
- }
-
- public function isResolvable(Definition $definition, array $parameters = []) : bool
- {
- return true;
- }
-
- protected function getEnvVariable(string $variableName)
- {
- if (isset($_ENV[$variableName])) {
- return $_ENV[$variableName];
- } elseif (isset($_SERVER[$variableName])) {
- return $_SERVER[$variableName];
- }
-
- return getenv($variableName);
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Resolver/FactoryResolver.php b/vendor/php-di/php-di/src/Definition/Resolver/FactoryResolver.php
deleted file mode 100644
index c36a1aa..0000000
--- a/vendor/php-di/php-di/src/Definition/Resolver/FactoryResolver.php
+++ /dev/null
@@ -1,123 +0,0 @@
-
- */
-class FactoryResolver implements DefinitionResolver
-{
- /**
- * @var ContainerInterface
- */
- private $container;
-
- /**
- * @var Invoker|null
- */
- private $invoker;
-
- /**
- * @var DefinitionResolver
- */
- private $resolver;
-
- /**
- * The resolver needs a container. This container will be passed to the factory as a parameter
- * so that the factory can access other entries of the container.
- */
- public function __construct(ContainerInterface $container, DefinitionResolver $resolver)
- {
- $this->container = $container;
- $this->resolver = $resolver;
- }
-
- /**
- * Resolve a factory definition to a value.
- *
- * This will call the callable of the definition.
- *
- * @param FactoryDefinition $definition
- */
- public function resolve(Definition $definition, array $parameters = [])
- {
- if (! $this->invoker) {
- $parameterResolver = new ResolverChain([
- new AssociativeArrayResolver,
- new FactoryParameterResolver($this->container),
- new NumericArrayResolver,
- new DefaultValueResolver,
- ]);
-
- $this->invoker = new Invoker($parameterResolver, $this->container);
- }
-
- $callable = $definition->getCallable();
-
- try {
- $providedParams = [$this->container, $definition];
- $extraParams = $this->resolveExtraParams($definition->getParameters());
- $providedParams = array_merge($providedParams, $extraParams, $parameters);
-
- return $this->invoker->call($callable, $providedParams);
- } catch (NotCallableException $e) {
- // Custom error message to help debugging
- if (is_string($callable) && class_exists($callable) && method_exists($callable, '__invoke')) {
- throw new InvalidDefinition(sprintf(
- 'Entry "%s" cannot be resolved: factory %s. Invokable classes cannot be automatically resolved if autowiring is disabled on the container, you need to enable autowiring or define the entry manually.',
- $definition->getName(),
- $e->getMessage()
- ));
- }
-
- throw new InvalidDefinition(sprintf(
- 'Entry "%s" cannot be resolved: factory %s',
- $definition->getName(),
- $e->getMessage()
- ));
- } catch (NotEnoughParametersException $e) {
- throw new InvalidDefinition(sprintf(
- 'Entry "%s" cannot be resolved: %s',
- $definition->getName(),
- $e->getMessage()
- ));
- }
- }
-
- public function isResolvable(Definition $definition, array $parameters = []) : bool
- {
- return true;
- }
-
- private function resolveExtraParams(array $params) : array
- {
- $resolved = [];
- foreach ($params as $key => $value) {
- // Nested definitions
- if ($value instanceof Definition) {
- $value = $this->resolver->resolve($value);
- }
- $resolved[$key] = $value;
- }
-
- return $resolved;
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Resolver/InstanceInjector.php b/vendor/php-di/php-di/src/Definition/Resolver/InstanceInjector.php
deleted file mode 100644
index 60ea24a..0000000
--- a/vendor/php-di/php-di/src/Definition/Resolver/InstanceInjector.php
+++ /dev/null
@@ -1,46 +0,0 @@
-
- */
-class InstanceInjector extends ObjectCreator
-{
- /**
- * Injects dependencies on an existing instance.
- *
- * @param InstanceDefinition $definition
- */
- public function resolve(Definition $definition, array $parameters = [])
- {
- try {
- $this->injectMethodsAndProperties($definition->getInstance(), $definition->getObjectDefinition());
- } catch (NotFoundExceptionInterface $e) {
- $message = sprintf(
- 'Error while injecting dependencies into %s: %s',
- get_class($definition->getInstance()),
- $e->getMessage()
- );
-
- throw new DependencyException($message, 0, $e);
- }
-
- return $definition;
- }
-
- public function isResolvable(Definition $definition, array $parameters = []) : bool
- {
- return true;
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php b/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php
deleted file mode 100644
index 3f1f1e6..0000000
--- a/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php
+++ /dev/null
@@ -1,222 +0,0 @@
-
- */
-class ObjectCreator implements DefinitionResolver
-{
- /**
- * @var ProxyFactory
- */
- private $proxyFactory;
-
- /**
- * @var ParameterResolver
- */
- private $parameterResolver;
-
- /**
- * @var DefinitionResolver
- */
- private $definitionResolver;
-
- /**
- * @param DefinitionResolver $definitionResolver Used to resolve nested definitions.
- * @param ProxyFactory $proxyFactory Used to create proxies for lazy injections.
- */
- public function __construct(
- DefinitionResolver $definitionResolver,
- ProxyFactory $proxyFactory
- ) {
- $this->definitionResolver = $definitionResolver;
- $this->proxyFactory = $proxyFactory;
- $this->parameterResolver = new ParameterResolver($definitionResolver);
- }
-
- /**
- * Resolve a class definition to a value.
- *
- * This will create a new instance of the class using the injections points defined.
- *
- * @param ObjectDefinition $definition
- *
- * @return object|null
- */
- public function resolve(Definition $definition, array $parameters = [])
- {
- // Lazy?
- if ($definition->isLazy()) {
- return $this->createProxy($definition, $parameters);
- }
-
- return $this->createInstance($definition, $parameters);
- }
-
- /**
- * The definition is not resolvable if the class is not instantiable (interface or abstract)
- * or if the class doesn't exist.
- *
- * @param ObjectDefinition $definition
- */
- public function isResolvable(Definition $definition, array $parameters = []) : bool
- {
- return $definition->isInstantiable();
- }
-
- /**
- * Returns a proxy instance.
- */
- private function createProxy(ObjectDefinition $definition, array $parameters) : LazyLoadingInterface
- {
- /** @noinspection PhpUnusedParameterInspection */
- $proxy = $this->proxyFactory->createProxy(
- $definition->getClassName(),
- function (& $wrappedObject, $proxy, $method, $params, & $initializer) use ($definition, $parameters) {
- $wrappedObject = $this->createInstance($definition, $parameters);
- $initializer = null; // turning off further lazy initialization
-
- return true;
- }
- );
-
- return $proxy;
- }
-
- /**
- * Creates an instance of the class and injects dependencies..
- *
- * @param array $parameters Optional parameters to use to create the instance.
- *
- * @throws InvalidDefinition
- * @throws DependencyException
- * @return object
- */
- private function createInstance(ObjectDefinition $definition, array $parameters)
- {
- // Check that the class is instantiable
- if (! $definition->isInstantiable()) {
- // Check that the class exists
- if (! $definition->classExists()) {
- throw InvalidDefinition::create($definition, sprintf(
- 'Entry "%s" cannot be resolved: the class doesn\'t exist',
- $definition->getName()
- ));
- }
-
- throw InvalidDefinition::create($definition, sprintf(
- 'Entry "%s" cannot be resolved: the class is not instantiable',
- $definition->getName()
- ));
- }
-
- $classname = $definition->getClassName();
- $classReflection = new ReflectionClass($classname);
-
- $constructorInjection = $definition->getConstructorInjection();
-
- try {
- $args = $this->parameterResolver->resolveParameters(
- $constructorInjection,
- $classReflection->getConstructor(),
- $parameters
- );
-
- $object = new $classname(...$args);
-
- $this->injectMethodsAndProperties($object, $definition);
- } catch (NotFoundExceptionInterface $e) {
- throw new DependencyException(sprintf(
- 'Error while injecting dependencies into %s: %s',
- $classReflection->getName(),
- $e->getMessage()
- ), 0, $e);
- } catch (InvalidDefinition $e) {
- throw InvalidDefinition::create($definition, sprintf(
- 'Entry "%s" cannot be resolved: %s',
- $definition->getName(),
- $e->getMessage()
- ));
- }
-
- return $object;
- }
-
- protected function injectMethodsAndProperties($object, ObjectDefinition $objectDefinition)
- {
- // Property injections
- foreach ($objectDefinition->getPropertyInjections() as $propertyInjection) {
- $this->injectProperty($object, $propertyInjection);
- }
-
- // Method injections
- foreach ($objectDefinition->getMethodInjections() as $methodInjection) {
- $methodReflection = new \ReflectionMethod($object, $methodInjection->getMethodName());
- $args = $this->parameterResolver->resolveParameters($methodInjection, $methodReflection);
-
- $methodReflection->invokeArgs($object, $args);
- }
- }
-
- /**
- * Inject dependencies into properties.
- *
- * @param object $object Object to inject dependencies into
- * @param PropertyInjection $propertyInjection Property injection definition
- *
- * @throws DependencyException
- * @throws InvalidDefinition
- */
- private function injectProperty($object, PropertyInjection $propertyInjection)
- {
- $propertyName = $propertyInjection->getPropertyName();
-
- $value = $propertyInjection->getValue();
-
- if ($value instanceof Definition) {
- try {
- $value = $this->definitionResolver->resolve($value);
- } catch (DependencyException $e) {
- throw $e;
- } catch (Exception $e) {
- throw new DependencyException(sprintf(
- 'Error while injecting in %s::%s. %s',
- get_class($object),
- $propertyName,
- $e->getMessage()
- ), 0, $e);
- }
- }
-
- self::setPrivatePropertyValue($propertyInjection->getClassName(), $object, $propertyName, $value);
- }
-
- public static function setPrivatePropertyValue(string $className = null, $object, string $propertyName, $propertyValue)
- {
- $className = $className ?: get_class($object);
-
- $property = new ReflectionProperty($className, $propertyName);
- if (! $property->isPublic()) {
- $property->setAccessible(true);
- }
- $property->setValue($object, $propertyValue);
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Resolver/ParameterResolver.php b/vendor/php-di/php-di/src/Definition/Resolver/ParameterResolver.php
deleted file mode 100644
index c9a4640..0000000
--- a/vendor/php-di/php-di/src/Definition/Resolver/ParameterResolver.php
+++ /dev/null
@@ -1,112 +0,0 @@
-
- */
-class ParameterResolver
-{
- /**
- * @var DefinitionResolver
- */
- private $definitionResolver;
-
- /**
- * @param DefinitionResolver $definitionResolver Will be used to resolve nested definitions.
- */
- public function __construct(DefinitionResolver $definitionResolver)
- {
- $this->definitionResolver = $definitionResolver;
- }
-
- /**
- * @throws InvalidDefinition A parameter has no value defined or guessable.
- * @return array Parameters to use to call the function.
- */
- public function resolveParameters(
- MethodInjection $definition = null,
- ReflectionMethod $method = null,
- array $parameters = []
- ) {
- $args = [];
-
- if (! $method) {
- return $args;
- }
-
- $definitionParameters = $definition ? $definition->getParameters() : [];
-
- foreach ($method->getParameters() as $index => $parameter) {
- if (array_key_exists($parameter->getName(), $parameters)) {
- // Look in the $parameters array
- $value = &$parameters[$parameter->getName()];
- } elseif (array_key_exists($index, $definitionParameters)) {
- // Look in the definition
- $value = &$definitionParameters[$index];
- } else {
- // If the parameter is optional and wasn't specified, we take its default value
- if ($parameter->isDefaultValueAvailable() || $parameter->isOptional()) {
- $args[] = $this->getParameterDefaultValue($parameter, $method);
- continue;
- }
-
- throw new InvalidDefinition(sprintf(
- 'Parameter $%s of %s has no value defined or guessable',
- $parameter->getName(),
- $this->getFunctionName($method)
- ));
- }
-
- // Nested definitions
- if ($value instanceof Definition) {
- // If the container cannot produce the entry, we can use the default parameter value
- if ($parameter->isOptional() && ! $this->definitionResolver->isResolvable($value)) {
- $value = $this->getParameterDefaultValue($parameter, $method);
- } else {
- $value = $this->definitionResolver->resolve($value);
- }
- }
-
- $args[] = &$value;
- }
-
- return $args;
- }
-
- /**
- * Returns the default value of a function parameter.
- *
- * @throws InvalidDefinition Can't get default values from PHP internal classes and functions
- * @return mixed
- */
- private function getParameterDefaultValue(ReflectionParameter $parameter, ReflectionMethod $function)
- {
- try {
- return $parameter->getDefaultValue();
- } catch (\ReflectionException $e) {
- throw new InvalidDefinition(sprintf(
- 'The parameter "%s" of %s has no type defined or guessable. It has a default value, '
- . 'but the default value can\'t be read through Reflection because it is a PHP internal class.',
- $parameter->getName(),
- $this->getFunctionName($function)
- ));
- }
- }
-
- private function getFunctionName(ReflectionMethod $method) : string
- {
- return $method->getName() . '()';
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Resolver/ResolverDispatcher.php b/vendor/php-di/php-di/src/Definition/Resolver/ResolverDispatcher.php
deleted file mode 100644
index 7c0edcc..0000000
--- a/vendor/php-di/php-di/src/Definition/Resolver/ResolverDispatcher.php
+++ /dev/null
@@ -1,134 +0,0 @@
-
- */
-class ResolverDispatcher implements DefinitionResolver
-{
- /**
- * @var ContainerInterface
- */
- private $container;
-
- /**
- * @var ProxyFactory
- */
- private $proxyFactory;
-
- private $arrayResolver;
- private $factoryResolver;
- private $decoratorResolver;
- private $objectResolver;
- private $instanceResolver;
- private $envVariableResolver;
-
- public function __construct(ContainerInterface $container, ProxyFactory $proxyFactory)
- {
- $this->container = $container;
- $this->proxyFactory = $proxyFactory;
- }
-
- /**
- * Resolve a definition to a value.
- *
- * @param Definition $definition Object that defines how the value should be obtained.
- * @param array $parameters Optional parameters to use to build the entry.
- *
- * @throws InvalidDefinition If the definition cannot be resolved.
- *
- * @return mixed Value obtained from the definition.
- */
- public function resolve(Definition $definition, array $parameters = [])
- {
- // Special case, tested early for speed
- if ($definition instanceof SelfResolvingDefinition) {
- return $definition->resolve($this->container);
- }
-
- $definitionResolver = $this->getDefinitionResolver($definition);
-
- return $definitionResolver->resolve($definition, $parameters);
- }
-
- public function isResolvable(Definition $definition, array $parameters = []) : bool
- {
- // Special case, tested early for speed
- if ($definition instanceof SelfResolvingDefinition) {
- return $definition->isResolvable($this->container);
- }
-
- $definitionResolver = $this->getDefinitionResolver($definition);
-
- return $definitionResolver->isResolvable($definition, $parameters);
- }
-
- /**
- * Returns a resolver capable of handling the given definition.
- *
- * @throws \RuntimeException No definition resolver was found for this type of definition.
- */
- private function getDefinitionResolver(Definition $definition) : DefinitionResolver
- {
- switch (true) {
- case $definition instanceof ObjectDefinition:
- if (! $this->objectResolver) {
- $this->objectResolver = new ObjectCreator($this, $this->proxyFactory);
- }
-
- return $this->objectResolver;
- case $definition instanceof DecoratorDefinition:
- if (! $this->decoratorResolver) {
- $this->decoratorResolver = new DecoratorResolver($this->container, $this);
- }
-
- return $this->decoratorResolver;
- case $definition instanceof FactoryDefinition:
- if (! $this->factoryResolver) {
- $this->factoryResolver = new FactoryResolver($this->container, $this);
- }
-
- return $this->factoryResolver;
- case $definition instanceof ArrayDefinition:
- if (! $this->arrayResolver) {
- $this->arrayResolver = new ArrayResolver($this);
- }
-
- return $this->arrayResolver;
- case $definition instanceof EnvironmentVariableDefinition:
- if (! $this->envVariableResolver) {
- $this->envVariableResolver = new EnvironmentVariableResolver($this);
- }
-
- return $this->envVariableResolver;
- case $definition instanceof InstanceDefinition:
- if (! $this->instanceResolver) {
- $this->instanceResolver = new InstanceInjector($this, $this->proxyFactory);
- }
-
- return $this->instanceResolver;
- default:
- throw new \RuntimeException('No definition resolver was configured for definition of type ' . get_class($definition));
- }
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/SelfResolvingDefinition.php b/vendor/php-di/php-di/src/Definition/SelfResolvingDefinition.php
deleted file mode 100644
index 7452403..0000000
--- a/vendor/php-di/php-di/src/Definition/SelfResolvingDefinition.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
- */
-interface SelfResolvingDefinition
-{
- /**
- * Resolve the definition and return the resulting value.
- *
- * @return mixed
- */
- public function resolve(ContainerInterface $container);
-
- /**
- * Check if a definition can be resolved.
- */
- public function isResolvable(ContainerInterface $container) : bool;
-}
diff --git a/vendor/php-di/php-di/src/Definition/Source/AnnotationBasedAutowiring.php b/vendor/php-di/php-di/src/Definition/Source/AnnotationBasedAutowiring.php
deleted file mode 100644
index ee3273a..0000000
--- a/vendor/php-di/php-di/src/Definition/Source/AnnotationBasedAutowiring.php
+++ /dev/null
@@ -1,297 +0,0 @@
-
- */
-class AnnotationBasedAutowiring implements DefinitionSource, Autowiring
-{
- /**
- * @var Reader
- */
- private $annotationReader;
-
- /**
- * @var PhpDocReader
- */
- private $phpDocReader;
-
- /**
- * @var bool
- */
- private $ignorePhpDocErrors;
-
- public function __construct($ignorePhpDocErrors = false)
- {
- $this->ignorePhpDocErrors = (bool) $ignorePhpDocErrors;
- }
-
- public function autowire(string $name, ObjectDefinition $definition = null)
- {
- $className = $definition ? $definition->getClassName() : $name;
-
- if (!class_exists($className) && !interface_exists($className)) {
- return $definition;
- }
-
- $definition = $definition ?: new ObjectDefinition($name);
-
- $class = new ReflectionClass($className);
-
- $this->readInjectableAnnotation($class, $definition);
-
- // Browse the class properties looking for annotated properties
- $this->readProperties($class, $definition);
-
- // Browse the object's methods looking for annotated methods
- $this->readMethods($class, $definition);
-
- return $definition;
- }
-
- /**
- * {@inheritdoc}
- * @throws InvalidAnnotation
- * @throws InvalidArgumentException The class doesn't exist
- */
- public function getDefinition(string $name)
- {
- return $this->autowire($name);
- }
-
- /**
- * Autowiring cannot guess all existing definitions.
- */
- public function getDefinitions() : array
- {
- return [];
- }
-
- /**
- * Browse the class properties looking for annotated properties.
- */
- private function readProperties(ReflectionClass $class, ObjectDefinition $definition)
- {
- foreach ($class->getProperties() as $property) {
- if ($property->isStatic()) {
- continue;
- }
- $this->readProperty($property, $definition);
- }
-
- // Read also the *private* properties of the parent classes
- /** @noinspection PhpAssignmentInConditionInspection */
- while ($class = $class->getParentClass()) {
- foreach ($class->getProperties(ReflectionProperty::IS_PRIVATE) as $property) {
- if ($property->isStatic()) {
- continue;
- }
- $this->readProperty($property, $definition, $class->getName());
- }
- }
- }
-
- private function readProperty(ReflectionProperty $property, ObjectDefinition $definition, $classname = null)
- {
- // Look for @Inject annotation
- $annotation = $this->getAnnotationReader()->getPropertyAnnotation($property, 'DI\Annotation\Inject');
- if (!$annotation instanceof Inject) {
- return;
- }
-
- // Try to @Inject("name") or look for @var content
- $entryName = $annotation->getName() ?: $this->getPhpDocReader()->getPropertyClass($property);
-
- // Try using PHP7.4 typed properties
- if (\PHP_VERSION_ID > 70400
- && $entryName === null
- && $property->getType() instanceof ReflectionNamedType
- && (class_exists($property->getType()->getName()) || interface_exists($property->getType()->getName()))
- ) {
- $entryName = $property->getType()->getName();
- }
-
- if ($entryName === null) {
- throw new InvalidAnnotation(sprintf(
- '@Inject found on property %s::%s but unable to guess what to inject, use a @var annotation',
- $property->getDeclaringClass()->getName(),
- $property->getName()
- ));
- }
-
- $definition->addPropertyInjection(
- new PropertyInjection($property->getName(), new Reference($entryName), $classname)
- );
- }
-
- /**
- * Browse the object's methods looking for annotated methods.
- */
- private function readMethods(ReflectionClass $class, ObjectDefinition $objectDefinition)
- {
- // This will look in all the methods, including those of the parent classes
- foreach ($class->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
- if ($method->isStatic()) {
- continue;
- }
-
- $methodInjection = $this->getMethodInjection($method);
-
- if (! $methodInjection) {
- continue;
- }
-
- if ($method->isConstructor()) {
- $objectDefinition->completeConstructorInjection($methodInjection);
- } else {
- $objectDefinition->completeFirstMethodInjection($methodInjection);
- }
- }
- }
-
- /**
- * @return MethodInjection|null
- */
- private function getMethodInjection(ReflectionMethod $method)
- {
- // Look for @Inject annotation
- try {
- $annotation = $this->getAnnotationReader()->getMethodAnnotation($method, 'DI\Annotation\Inject');
- } catch (InvalidAnnotation $e) {
- throw new InvalidAnnotation(sprintf(
- '@Inject annotation on %s::%s is malformed. %s',
- $method->getDeclaringClass()->getName(),
- $method->getName(),
- $e->getMessage()
- ), 0, $e);
- }
-
- // @Inject on constructor is implicit
- if (! ($annotation || $method->isConstructor())) {
- return null;
- }
-
- $annotationParameters = $annotation instanceof Inject ? $annotation->getParameters() : [];
-
- $parameters = [];
- foreach ($method->getParameters() as $index => $parameter) {
- $entryName = $this->getMethodParameter($index, $parameter, $annotationParameters);
-
- if ($entryName !== null) {
- $parameters[$index] = new Reference($entryName);
- }
- }
-
- if ($method->isConstructor()) {
- return MethodInjection::constructor($parameters);
- }
-
- return new MethodInjection($method->getName(), $parameters);
- }
-
- /**
- * @param int $parameterIndex
- *
- * @return string|null Entry name or null if not found.
- */
- private function getMethodParameter($parameterIndex, ReflectionParameter $parameter, array $annotationParameters)
- {
- // @Inject has definition for this parameter (by index, or by name)
- if (isset($annotationParameters[$parameterIndex])) {
- return $annotationParameters[$parameterIndex];
- }
- if (isset($annotationParameters[$parameter->getName()])) {
- return $annotationParameters[$parameter->getName()];
- }
-
- // Skip optional parameters if not explicitly defined
- if ($parameter->isOptional()) {
- return null;
- }
-
- // Try to use the type-hinting
- $parameterType = $parameter->getType();
- if ($parameterType && $parameterType instanceof ReflectionNamedType && !$parameterType->isBuiltin()) {
- return $parameterType->getName();
- }
-
- // Last resort, look for @param tag
- return $this->getPhpDocReader()->getParameterClass($parameter);
- }
-
- /**
- * @return Reader The annotation reader
- */
- public function getAnnotationReader()
- {
- if ($this->annotationReader === null) {
- AnnotationRegistry::registerLoader('class_exists');
- $this->annotationReader = new SimpleAnnotationReader();
- $this->annotationReader->addNamespace('DI\Annotation');
- }
-
- return $this->annotationReader;
- }
-
- /**
- * @return PhpDocReader
- */
- private function getPhpDocReader()
- {
- if ($this->phpDocReader === null) {
- $this->phpDocReader = new PhpDocReader($this->ignorePhpDocErrors);
- }
-
- return $this->phpDocReader;
- }
-
- private function readInjectableAnnotation(ReflectionClass $class, ObjectDefinition $definition)
- {
- try {
- /** @var Injectable|null $annotation */
- $annotation = $this->getAnnotationReader()
- ->getClassAnnotation($class, 'DI\Annotation\Injectable');
- } catch (UnexpectedValueException $e) {
- throw new InvalidAnnotation(sprintf(
- 'Error while reading @Injectable on %s: %s',
- $class->getName(),
- $e->getMessage()
- ), 0, $e);
- }
-
- if (! $annotation) {
- return;
- }
-
- if ($annotation->isLazy() !== null) {
- $definition->setLazy($annotation->isLazy());
- }
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Source/Autowiring.php b/vendor/php-di/php-di/src/Definition/Source/Autowiring.php
deleted file mode 100644
index ae7682a..0000000
--- a/vendor/php-di/php-di/src/Definition/Source/Autowiring.php
+++ /dev/null
@@ -1,24 +0,0 @@
-
- */
-interface Autowiring
-{
- /**
- * Autowire the given definition.
- *
- * @throws InvalidDefinition An invalid definition was found.
- * @return ObjectDefinition|null
- */
- public function autowire(string $name, ObjectDefinition $definition = null);
-}
diff --git a/vendor/php-di/php-di/src/Definition/Source/DefinitionArray.php b/vendor/php-di/php-di/src/Definition/Source/DefinitionArray.php
deleted file mode 100644
index 88f2cac..0000000
--- a/vendor/php-di/php-di/src/Definition/Source/DefinitionArray.php
+++ /dev/null
@@ -1,127 +0,0 @@
-
- */
-class DefinitionArray implements DefinitionSource, MutableDefinitionSource
-{
- const WILDCARD = '*';
- /**
- * Matches anything except "\".
- */
- const WILDCARD_PATTERN = '([^\\\\]+)';
-
- /**
- * DI definitions in a PHP array.
- * @var array
- */
- private $definitions = [];
-
- /**
- * Cache of wildcard definitions.
- * @var array|null
- */
- private $wildcardDefinitions;
-
- /**
- * @var DefinitionNormalizer
- */
- private $normalizer;
-
- public function __construct(array $definitions = [], Autowiring $autowiring = null)
- {
- if (isset($definitions[0])) {
- throw new \Exception('The PHP-DI definition is not indexed by an entry name in the definition array');
- }
-
- $this->definitions = $definitions;
-
- $autowiring = $autowiring ?: new NoAutowiring;
- $this->normalizer = new DefinitionNormalizer($autowiring);
- }
-
- /**
- * @param array $definitions DI definitions in a PHP array indexed by the definition name.
- */
- public function addDefinitions(array $definitions)
- {
- if (isset($definitions[0])) {
- throw new \Exception('The PHP-DI definition is not indexed by an entry name in the definition array');
- }
-
- // The newly added data prevails
- // "for keys that exist in both arrays, the elements from the left-hand array will be used"
- $this->definitions = $definitions + $this->definitions;
-
- // Clear cache
- $this->wildcardDefinitions = null;
- }
-
- /**
- * {@inheritdoc}
- */
- public function addDefinition(Definition $definition)
- {
- $this->definitions[$definition->getName()] = $definition;
-
- // Clear cache
- $this->wildcardDefinitions = null;
- }
-
- public function getDefinition(string $name)
- {
- // Look for the definition by name
- if (array_key_exists($name, $this->definitions)) {
- $definition = $this->definitions[$name];
- $definition = $this->normalizer->normalizeRootDefinition($definition, $name);
-
- return $definition;
- }
-
- // Build the cache of wildcard definitions
- if ($this->wildcardDefinitions === null) {
- $this->wildcardDefinitions = [];
- foreach ($this->definitions as $key => $definition) {
- if (strpos($key, self::WILDCARD) !== false) {
- $this->wildcardDefinitions[$key] = $definition;
- }
- }
- }
-
- // Look in wildcards definitions
- foreach ($this->wildcardDefinitions as $key => $definition) {
- // Turn the pattern into a regex
- $key = preg_quote($key);
- $key = '#' . str_replace('\\' . self::WILDCARD, self::WILDCARD_PATTERN, $key) . '#';
- if (preg_match($key, $name, $matches) === 1) {
- array_shift($matches);
- $definition = $this->normalizer->normalizeRootDefinition($definition, $name, $matches);
-
- return $definition;
- }
- }
-
- return null;
- }
-
- public function getDefinitions() : array
- {
- // Return all definitions except wildcard definitions
- $definitions = [];
- foreach ($this->definitions as $key => $definition) {
- if (strpos($key, self::WILDCARD) === false) {
- $definitions[$key] = $definition;
- }
- }
-
- return $definitions;
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Source/DefinitionFile.php b/vendor/php-di/php-di/src/Definition/Source/DefinitionFile.php
deleted file mode 100644
index 0c6caff..0000000
--- a/vendor/php-di/php-di/src/Definition/Source/DefinitionFile.php
+++ /dev/null
@@ -1,69 +0,0 @@
-
- */
-class DefinitionFile extends DefinitionArray
-{
- /**
- * @var bool
- */
- private $initialized = false;
-
- /**
- * File containing definitions, or null if the definitions are given as a PHP array.
- * @var string|null
- */
- private $file;
-
- /**
- * @param string $file File in which the definitions are returned as an array.
- */
- public function __construct($file, Autowiring $autowiring = null)
- {
- // Lazy-loading to improve performances
- $this->file = $file;
-
- parent::__construct([], $autowiring);
- }
-
- public function getDefinition(string $name)
- {
- $this->initialize();
-
- return parent::getDefinition($name);
- }
-
- public function getDefinitions() : array
- {
- $this->initialize();
-
- return parent::getDefinitions();
- }
-
- /**
- * Lazy-loading of the definitions.
- */
- private function initialize()
- {
- if ($this->initialized === true) {
- return;
- }
-
- $definitions = require $this->file;
-
- if (! is_array($definitions)) {
- throw new \Exception("File {$this->file} should return an array of definitions");
- }
-
- $this->addDefinitions($definitions);
-
- $this->initialized = true;
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Source/DefinitionNormalizer.php b/vendor/php-di/php-di/src/Definition/Source/DefinitionNormalizer.php
deleted file mode 100644
index 99ea36b..0000000
--- a/vendor/php-di/php-di/src/Definition/Source/DefinitionNormalizer.php
+++ /dev/null
@@ -1,120 +0,0 @@
-
- */
-class DefinitionNormalizer
-{
- /**
- * @var Autowiring
- */
- private $autowiring;
-
- public function __construct(Autowiring $autowiring)
- {
- $this->autowiring = $autowiring;
- }
-
- /**
- * Normalize a definition that is *not* nested in another one.
- *
- * This is usually a definition declared at the root of a definition array.
- *
- * @param mixed $definition
- * @param string $name The definition name.
- * @param string[] $wildcardsReplacements Replacements for wildcard definitions.
- *
- * @throws InvalidDefinition
- */
- public function normalizeRootDefinition($definition, string $name, array $wildcardsReplacements = null) : Definition
- {
- if ($definition instanceof DefinitionHelper) {
- $definition = $definition->getDefinition($name);
- } elseif (is_array($definition)) {
- $definition = new ArrayDefinition($definition);
- } elseif ($definition instanceof \Closure) {
- $definition = new FactoryDefinition($name, $definition);
- } elseif (! $definition instanceof Definition) {
- $definition = new ValueDefinition($definition);
- }
-
- // For a class definition, we replace * in the class name with the matches
- // *Interface -> *Impl => FooInterface -> FooImpl
- if ($wildcardsReplacements && $definition instanceof ObjectDefinition) {
- $definition->replaceWildcards($wildcardsReplacements);
- }
-
- if ($definition instanceof AutowireDefinition) {
- $definition = $this->autowiring->autowire($name, $definition);
- }
-
- $definition->setName($name);
-
- try {
- $definition->replaceNestedDefinitions([$this, 'normalizeNestedDefinition']);
- } catch (InvalidDefinition $e) {
- throw InvalidDefinition::create($definition, sprintf(
- 'Definition "%s" contains an error: %s',
- $definition->getName(),
- $e->getMessage()
- ), $e);
- }
-
- return $definition;
- }
-
- /**
- * Normalize a definition that is nested in another one.
- *
- * @param mixed $definition
- * @return mixed
- *
- * @throws InvalidDefinition
- */
- public function normalizeNestedDefinition($definition)
- {
- $name = '';
-
- if ($definition instanceof DefinitionHelper) {
- $definition = $definition->getDefinition($name);
- } elseif (is_array($definition)) {
- $definition = new ArrayDefinition($definition);
- } elseif ($definition instanceof \Closure) {
- $definition = new FactoryDefinition($name, $definition);
- }
-
- if ($definition instanceof DecoratorDefinition) {
- throw new InvalidDefinition('Decorators cannot be nested in another definition');
- }
-
- if ($definition instanceof AutowireDefinition) {
- $definition = $this->autowiring->autowire($name, $definition);
- }
-
- if ($definition instanceof Definition) {
- $definition->setName($name);
-
- // Recursively traverse nested definitions
- $definition->replaceNestedDefinitions([$this, 'normalizeNestedDefinition']);
- }
-
- return $definition;
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Source/DefinitionSource.php b/vendor/php-di/php-di/src/Definition/Source/DefinitionSource.php
deleted file mode 100644
index 5aa95dd..0000000
--- a/vendor/php-di/php-di/src/Definition/Source/DefinitionSource.php
+++ /dev/null
@@ -1,29 +0,0 @@
-
- */
-interface DefinitionSource
-{
- /**
- * Returns the DI definition for the entry name.
- *
- * @throws InvalidDefinition An invalid definition was found.
- * @return Definition|null
- */
- public function getDefinition(string $name);
-
- /**
- * @return Definition[] Definitions indexed by their name.
- */
- public function getDefinitions() : array;
-}
diff --git a/vendor/php-di/php-di/src/Definition/Source/MutableDefinitionSource.php b/vendor/php-di/php-di/src/Definition/Source/MutableDefinitionSource.php
deleted file mode 100644
index 0422174..0000000
--- a/vendor/php-di/php-di/src/Definition/Source/MutableDefinitionSource.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- */
-interface MutableDefinitionSource extends DefinitionSource
-{
- public function addDefinition(Definition $definition);
-}
diff --git a/vendor/php-di/php-di/src/Definition/Source/NoAutowiring.php b/vendor/php-di/php-di/src/Definition/Source/NoAutowiring.php
deleted file mode 100644
index dda3e30..0000000
--- a/vendor/php-di/php-di/src/Definition/Source/NoAutowiring.php
+++ /dev/null
@@ -1,24 +0,0 @@
-
- */
-class NoAutowiring implements Autowiring
-{
- public function autowire(string $name, ObjectDefinition $definition = null)
- {
- throw new InvalidDefinition(sprintf(
- 'Cannot autowire entry "%s" because autowiring is disabled',
- $name
- ));
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Source/ReflectionBasedAutowiring.php b/vendor/php-di/php-di/src/Definition/Source/ReflectionBasedAutowiring.php
deleted file mode 100644
index fdc3748..0000000
--- a/vendor/php-di/php-di/src/Definition/Source/ReflectionBasedAutowiring.php
+++ /dev/null
@@ -1,85 +0,0 @@
-
- */
-class ReflectionBasedAutowiring implements DefinitionSource, Autowiring
-{
- public function autowire(string $name, ObjectDefinition $definition = null)
- {
- $className = $definition ? $definition->getClassName() : $name;
-
- if (!class_exists($className) && !interface_exists($className)) {
- return $definition;
- }
-
- $definition = $definition ?: new ObjectDefinition($name);
-
- // Constructor
- $class = new \ReflectionClass($className);
- $constructor = $class->getConstructor();
- if ($constructor && $constructor->isPublic()) {
- $constructorInjection = MethodInjection::constructor($this->getParametersDefinition($constructor));
- $definition->completeConstructorInjection($constructorInjection);
- }
-
- return $definition;
- }
-
- public function getDefinition(string $name)
- {
- return $this->autowire($name);
- }
-
- /**
- * Autowiring cannot guess all existing definitions.
- */
- public function getDefinitions() : array
- {
- return [];
- }
-
- /**
- * Read the type-hinting from the parameters of the function.
- */
- private function getParametersDefinition(\ReflectionFunctionAbstract $constructor) : array
- {
- $parameters = [];
-
- foreach ($constructor->getParameters() as $index => $parameter) {
- // Skip optional parameters
- if ($parameter->isOptional()) {
- continue;
- }
-
- $parameterType = $parameter->getType();
- if (!$parameterType) {
- // No type
- continue;
- }
- if (!$parameterType instanceof ReflectionNamedType) {
- // Union types are not supported
- continue;
- }
- if ($parameterType->isBuiltin()) {
- // Primitive types are not supported
- continue;
- }
-
- $parameters[$index] = new Reference($parameterType->getName());
- }
-
- return $parameters;
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Source/SourceCache.php b/vendor/php-di/php-di/src/Definition/Source/SourceCache.php
deleted file mode 100644
index 6487c2c..0000000
--- a/vendor/php-di/php-di/src/Definition/Source/SourceCache.php
+++ /dev/null
@@ -1,88 +0,0 @@
-
- */
-class SourceCache implements DefinitionSource, MutableDefinitionSource
-{
- /**
- * @var string
- */
- const CACHE_KEY = 'php-di.definitions.';
-
- /**
- * @var DefinitionSource
- */
- private $cachedSource;
-
- /**
- * @var string
- */
- private $cacheNamespace;
-
- public function __construct(DefinitionSource $cachedSource, string $cacheNamespace = '')
- {
- $this->cachedSource = $cachedSource;
- $this->cacheNamespace = $cacheNamespace;
- }
-
- public function getDefinition(string $name)
- {
- $definition = apcu_fetch($this->getCacheKey($name));
-
- if ($definition === false) {
- $definition = $this->cachedSource->getDefinition($name);
-
- // Update the cache
- if ($this->shouldBeCached($definition)) {
- apcu_store($this->getCacheKey($name), $definition);
- }
- }
-
- return $definition;
- }
-
- /**
- * Used only for the compilation so we can skip the cache safely.
- */
- public function getDefinitions() : array
- {
- return $this->cachedSource->getDefinitions();
- }
-
- public static function isSupported() : bool
- {
- return function_exists('apcu_fetch')
- && ini_get('apc.enabled')
- && ! ('cli' === \PHP_SAPI && ! ini_get('apc.enable_cli'));
- }
-
- public function getCacheKey(string $name) : string
- {
- return self::CACHE_KEY . $this->cacheNamespace . $name;
- }
-
- public function addDefinition(Definition $definition)
- {
- throw new \LogicException('You cannot set a definition at runtime on a container that has caching enabled. Doing so would risk caching the definition for the next execution, where it might be different. You can either put your definitions in a file, remove the cache or ->set() a raw value directly (PHP object, string, int, ...) instead of a PHP-DI definition.');
- }
-
- private function shouldBeCached(Definition $definition = null) : bool
- {
- return
- // Cache missing definitions
- ($definition === null)
- // Object definitions are used with `make()`
- || ($definition instanceof ObjectDefinition)
- // Autowired definitions cannot be all compiled and are used with `make()`
- || ($definition instanceof AutowireDefinition);
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/Source/SourceChain.php b/vendor/php-di/php-di/src/Definition/Source/SourceChain.php
deleted file mode 100644
index b82d618..0000000
--- a/vendor/php-di/php-di/src/Definition/Source/SourceChain.php
+++ /dev/null
@@ -1,110 +0,0 @@
-
- */
-class SourceChain implements DefinitionSource, MutableDefinitionSource
-{
- /**
- * @var DefinitionSource[]
- */
- private $sources;
-
- /**
- * @var DefinitionSource
- */
- private $rootSource;
-
- /**
- * @var MutableDefinitionSource|null
- */
- private $mutableSource;
-
- /**
- * @param DefinitionSource[] $sources
- */
- public function __construct(array $sources)
- {
- // We want a numerically indexed array to ease the traversal later
- $this->sources = array_values($sources);
- $this->rootSource = $this;
- }
-
- /**
- * {@inheritdoc}
- *
- * @param int $startIndex Use this parameter to start looking from a specific
- * point in the source chain.
- */
- public function getDefinition(string $name, int $startIndex = 0)
- {
- $count = count($this->sources);
- for ($i = $startIndex; $i < $count; ++$i) {
- $source = $this->sources[$i];
-
- $definition = $source->getDefinition($name);
-
- if ($definition) {
- if ($definition instanceof ExtendsPreviousDefinition) {
- $this->resolveExtendedDefinition($definition, $i);
- }
-
- return $definition;
- }
- }
-
- return null;
- }
-
- public function getDefinitions() : array
- {
- $names = [];
- foreach ($this->sources as $source) {
- $names = array_merge($names, $source->getDefinitions());
- }
- $names = array_keys($names);
-
- $definitions = array_combine($names, array_map(function (string $name) {
- return $this->getDefinition($name);
- }, $names));
-
- return $definitions;
- }
-
- public function addDefinition(Definition $definition)
- {
- if (! $this->mutableSource) {
- throw new \LogicException("The container's definition source has not been initialized correctly");
- }
-
- $this->mutableSource->addDefinition($definition);
- }
-
- private function resolveExtendedDefinition(ExtendsPreviousDefinition $definition, int $currentIndex)
- {
- // Look in the next sources only (else infinite recursion, and we can only extend
- // entries defined in the previous definition files - a previous == next here because
- // the array was reversed ;) )
- $subDefinition = $this->getDefinition($definition->getName(), $currentIndex + 1);
-
- if ($subDefinition) {
- $definition->setExtendedDefinition($subDefinition);
- }
- }
-
- public function setMutableDefinitionSource(MutableDefinitionSource $mutableSource)
- {
- $this->mutableSource = $mutableSource;
-
- array_unshift($this->sources, $mutableSource);
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/StringDefinition.php b/vendor/php-di/php-di/src/Definition/StringDefinition.php
deleted file mode 100644
index 52207e7..0000000
--- a/vendor/php-di/php-di/src/Definition/StringDefinition.php
+++ /dev/null
@@ -1,97 +0,0 @@
-
- */
-class StringDefinition implements Definition, SelfResolvingDefinition
-{
- /**
- * Entry name.
- * @var string
- */
- private $name = '';
-
- /**
- * @var string
- */
- private $expression;
-
- public function __construct(string $expression)
- {
- $this->expression = $expression;
- }
-
- public function getName() : string
- {
- return $this->name;
- }
-
- public function setName(string $name)
- {
- $this->name = $name;
- }
-
- public function getExpression() : string
- {
- return $this->expression;
- }
-
- public function resolve(ContainerInterface $container) : string
- {
- return self::resolveExpression($this->name, $this->expression, $container);
- }
-
- public function isResolvable(ContainerInterface $container) : bool
- {
- return true;
- }
-
- public function replaceNestedDefinitions(callable $replacer)
- {
- // no nested definitions
- }
-
- public function __toString()
- {
- return $this->expression;
- }
-
- /**
- * Resolve a string expression.
- */
- public static function resolveExpression(
- string $entryName,
- string $expression,
- ContainerInterface $container
- ) : string {
- $callback = function (array $matches) use ($entryName, $container) {
- try {
- return $container->get($matches[1]);
- } catch (NotFoundExceptionInterface $e) {
- throw new DependencyException(sprintf(
- "Error while parsing string expression for entry '%s': %s",
- $entryName,
- $e->getMessage()
- ), 0, $e);
- }
- };
-
- $result = preg_replace_callback('#\{([^\{\}]+)\}#', $callback, $expression);
- if ($result === null) {
- throw new \RuntimeException(sprintf('An unknown error occurred while parsing the string definition: \'%s\'', $expression));
- }
-
- return $result;
- }
-}
diff --git a/vendor/php-di/php-di/src/Definition/ValueDefinition.php b/vendor/php-di/php-di/src/Definition/ValueDefinition.php
deleted file mode 100644
index d647582..0000000
--- a/vendor/php-di/php-di/src/Definition/ValueDefinition.php
+++ /dev/null
@@ -1,72 +0,0 @@
-
- */
-class ValueDefinition implements Definition, SelfResolvingDefinition
-{
- /**
- * Entry name.
- * @var string
- */
- private $name = '';
-
- /**
- * @var mixed
- */
- private $value;
-
- /**
- * @param mixed $value
- */
- public function __construct($value)
- {
- $this->value = $value;
- }
-
- public function getName() : string
- {
- return $this->name;
- }
-
- public function setName(string $name)
- {
- $this->name = $name;
- }
-
- /**
- * @return mixed
- */
- public function getValue()
- {
- return $this->value;
- }
-
- public function resolve(ContainerInterface $container)
- {
- return $this->getValue();
- }
-
- public function isResolvable(ContainerInterface $container) : bool
- {
- return true;
- }
-
- public function replaceNestedDefinitions(callable $replacer)
- {
- // no nested definitions
- }
-
- public function __toString()
- {
- return sprintf('Value (%s)', var_export($this->value, true));
- }
-}
diff --git a/vendor/php-di/php-di/src/DependencyException.php b/vendor/php-di/php-di/src/DependencyException.php
deleted file mode 100644
index 63b5fdd..0000000
--- a/vendor/php-di/php-di/src/DependencyException.php
+++ /dev/null
@@ -1,14 +0,0 @@
-
- */
-interface RequestedEntry
-{
- /**
- * Returns the name of the entry that was requested by the container.
- */
- public function getName() : string;
-}
diff --git a/vendor/php-di/php-di/src/FactoryInterface.php b/vendor/php-di/php-di/src/FactoryInterface.php
deleted file mode 100644
index 59b410f..0000000
--- a/vendor/php-di/php-di/src/FactoryInterface.php
+++ /dev/null
@@ -1,31 +0,0 @@
-
- */
-interface FactoryInterface
-{
- /**
- * Resolves an entry by its name. If given a class name, it will return a new instance of that class.
- *
- * @param string $name Entry name or a class name.
- * @param array $parameters Optional parameters to use to build the entry. Use this to force specific
- * parameters to specific values. Parameters not defined in this array will
- * be automatically resolved.
- *
- * @throws \InvalidArgumentException The name parameter must be of type string.
- * @throws DependencyException Error while resolving the entry.
- * @throws NotFoundException No entry or class found for the given name.
- * @return mixed
- */
- public function make($name, array $parameters = []);
-}
diff --git a/vendor/php-di/php-di/src/Invoker/DefinitionParameterResolver.php b/vendor/php-di/php-di/src/Invoker/DefinitionParameterResolver.php
deleted file mode 100644
index b17ebd9..0000000
--- a/vendor/php-di/php-di/src/Invoker/DefinitionParameterResolver.php
+++ /dev/null
@@ -1,69 +0,0 @@
-
- */
-class DefinitionParameterResolver implements ParameterResolver
-{
- /**
- * @var DefinitionResolver
- */
- private $definitionResolver;
-
- public function __construct(DefinitionResolver $definitionResolver)
- {
- $this->definitionResolver = $definitionResolver;
- }
-
- public function getParameters(
- ReflectionFunctionAbstract $reflection,
- array $providedParameters,
- array $resolvedParameters
- ) : array {
- // Skip parameters already resolved
- if (! empty($resolvedParameters)) {
- $providedParameters = array_diff_key($providedParameters, $resolvedParameters);
- }
-
- foreach ($providedParameters as $key => $value) {
- if ($value instanceof DefinitionHelper) {
- $value = $value->getDefinition('');
- }
-
- if (! $value instanceof Definition) {
- continue;
- }
-
- $value = $this->definitionResolver->resolve($value);
-
- if (is_int($key)) {
- // Indexed by position
- $resolvedParameters[$key] = $value;
- } else {
- // Indexed by parameter name
- // TODO optimize?
- $reflectionParameters = $reflection->getParameters();
- foreach ($reflectionParameters as $reflectionParameter) {
- if ($key === $reflectionParameter->name) {
- $resolvedParameters[$reflectionParameter->getPosition()] = $value;
- }
- }
- }
- }
-
- return $resolvedParameters;
- }
-}
diff --git a/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php b/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php
deleted file mode 100644
index f5ace87..0000000
--- a/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php
+++ /dev/null
@@ -1,74 +0,0 @@
-
- * @author Matthieu Napoli
- */
-class FactoryParameterResolver implements ParameterResolver
-{
- /**
- * @var ContainerInterface
- */
- private $container;
-
- public function __construct(ContainerInterface $container)
- {
- $this->container = $container;
- }
-
- public function getParameters(
- ReflectionFunctionAbstract $reflection,
- array $providedParameters,
- array $resolvedParameters
- ) : array {
- $parameters = $reflection->getParameters();
-
- // Skip parameters already resolved
- if (! empty($resolvedParameters)) {
- $parameters = array_diff_key($parameters, $resolvedParameters);
- }
-
- foreach ($parameters as $index => $parameter) {
- $parameterType = $parameter->getType();
- if (!$parameterType) {
- // No type
- continue;
- }
- if (!$parameterType instanceof ReflectionNamedType) {
- // Union types are not supported
- continue;
- }
- if ($parameterType->isBuiltin()) {
- // Primitive types are not supported
- continue;
- }
-
- $parameterClass = $parameterType->getName();
-
- if ($parameterClass === 'Psr\Container\ContainerInterface') {
- $resolvedParameters[$index] = $this->container;
- } elseif ($parameterClass === 'DI\Factory\RequestedEntry') {
- // By convention the second parameter is the definition
- $resolvedParameters[$index] = $providedParameters[1];
- } elseif ($this->container->has($parameterClass)) {
- $resolvedParameters[$index] = $this->container->get($parameterClass);
- }
- }
-
- return $resolvedParameters;
- }
-}
diff --git a/vendor/php-di/php-di/src/NotFoundException.php b/vendor/php-di/php-di/src/NotFoundException.php
deleted file mode 100644
index 67dbacd..0000000
--- a/vendor/php-di/php-di/src/NotFoundException.php
+++ /dev/null
@@ -1,14 +0,0 @@
-
- */
-class ProxyFactory
-{
- /**
- * If true, write the proxies to disk to improve performances.
- * @var bool
- */
- private $writeProxiesToFile;
-
- /**
- * Directory where to write the proxies (if $writeProxiesToFile is enabled).
- * @var string|null
- */
- private $proxyDirectory;
-
- /**
- * @var LazyLoadingValueHolderFactory|null
- */
- private $proxyManager;
-
- public function __construct(bool $writeProxiesToFile = false, string $proxyDirectory = null)
- {
- $this->writeProxiesToFile = $writeProxiesToFile;
- $this->proxyDirectory = $proxyDirectory;
- }
-
- /**
- * Creates a new lazy proxy instance of the given class with
- * the given initializer.
- *
- * @param string $className name of the class to be proxied
- * @param \Closure $initializer initializer to be passed to the proxy
- */
- public function createProxy(string $className, \Closure $initializer) : LazyLoadingInterface
- {
- $this->createProxyManager();
-
- return $this->proxyManager->createProxy($className, $initializer);
- }
-
- /**
- * Generates and writes the proxy class to file.
- *
- * @param string $className name of the class to be proxied
- */
- public function generateProxyClass(string $className)
- {
- // If proxy classes a written to file then we pre-generate the class
- // If they are not written to file then there is no point to do this
- if ($this->writeProxiesToFile) {
- $this->createProxyManager();
- $this->createProxy($className, function () {});
- }
- }
-
- private function createProxyManager()
- {
- if ($this->proxyManager !== null) {
- return;
- }
-
- if (! class_exists(Configuration::class)) {
- throw new \RuntimeException('The ocramius/proxy-manager library is not installed. Lazy injection requires that library to be installed with Composer in order to work. Run "composer require ocramius/proxy-manager:~2.0".');
- }
-
- $config = new Configuration();
-
- if ($this->writeProxiesToFile) {
- $config->setProxiesTargetDir($this->proxyDirectory);
- $config->setGeneratorStrategy(new FileWriterGeneratorStrategy(new FileLocator($this->proxyDirectory)));
- // @phpstan-ignore-next-line
- spl_autoload_register($config->getProxyAutoloader());
- } else {
- $config->setGeneratorStrategy(new EvaluatingGeneratorStrategy());
- }
-
- $this->proxyManager = new LazyLoadingValueHolderFactory($config);
- }
-}
diff --git a/vendor/php-di/php-di/src/functions.php b/vendor/php-di/php-di/src/functions.php
deleted file mode 100644
index 0504edb..0000000
--- a/vendor/php-di/php-di/src/functions.php
+++ /dev/null
@@ -1,156 +0,0 @@
- decorate(function ($foo, $container) {
- * return new CachedFoo($foo, $container->get('cache'));
- * })
- *
- * @param callable $callable The callable takes the decorated object as first parameter and
- * the container as second.
- */
- function decorate($callable) : FactoryDefinitionHelper
- {
- return new FactoryDefinitionHelper($callable, true);
- }
-}
-
-if (! function_exists('DI\get')) {
- /**
- * Helper for referencing another container entry in an object definition.
- */
- function get(string $entryName) : Reference
- {
- return new Reference($entryName);
- }
-}
-
-if (! function_exists('DI\env')) {
- /**
- * Helper for referencing environment variables.
- *
- * @param string $variableName The name of the environment variable.
- * @param mixed $defaultValue The default value to be used if the environment variable is not defined.
- */
- function env(string $variableName, $defaultValue = null) : EnvironmentVariableDefinition
- {
- // Only mark as optional if the default value was *explicitly* provided.
- $isOptional = 2 === func_num_args();
-
- return new EnvironmentVariableDefinition($variableName, $isOptional, $defaultValue);
- }
-}
-
-if (! function_exists('DI\add')) {
- /**
- * Helper for extending another definition.
- *
- * Example:
- *
- * 'log.backends' => DI\add(DI\get('My\Custom\LogBackend'))
- *
- * or:
- *
- * 'log.backends' => DI\add([
- * DI\get('My\Custom\LogBackend')
- * ])
- *
- * @param mixed|array $values A value or an array of values to add to the array.
- *
- * @since 5.0
- */
- function add($values) : ArrayDefinitionExtension
- {
- if (! is_array($values)) {
- $values = [$values];
- }
-
- return new ArrayDefinitionExtension($values);
- }
-}
-
-if (! function_exists('DI\string')) {
- /**
- * Helper for concatenating strings.
- *
- * Example:
- *
- * 'log.filename' => DI\string('{app.path}/app.log')
- *
- * @param string $expression A string expression. Use the `{}` placeholders to reference other container entries.
- *
- * @since 5.0
- */
- function string(string $expression) : StringDefinition
- {
- return new StringDefinition($expression);
- }
-}
diff --git a/vendor/php-di/php-di/support.md b/vendor/php-di/php-di/support.md
deleted file mode 100644
index 22dd39a..0000000
--- a/vendor/php-di/php-di/support.md
+++ /dev/null
@@ -1,42 +0,0 @@
----
-layout: documentation
-current_menu: enterprise-support
-title: Enterprise support for PHP-DI
----
-
-# PHP-DI for Enterprise
-
-> *Available as part of the Tidelift Subscription*
-
-Tidelift is working with the maintainers of PHP-DI and thousands of other
-open source projects to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use.
-
-#### [Learn more](https://tidelift.com/subscription/pkg/packagist-php-di-php-di?utm_source=packagist-php-di-php-di&utm_medium=referral&utm_campaign=enterprise) | [**Request a demo**](https://tidelift.com/subscription/request-a-demo?utm_source=packagist-php-di-php-di&utm_medium=referral&utm_campaign=enterprise)
-
-## Enterprise-ready open source software—managed for you
-
-The Tidelift Subscription is a managed open source subscription for application dependencies covering millions of open source projects across JavaScript, Python, Java, PHP, Ruby, .NET, and more.
-
-Your subscription includes:
-
-- **Security updates**
- Tidelift’s security response team coordinates patches for new breaking security vulnerabilities and alerts immediately through a private channel, so your software supply chain is always secure.
-
-- **Licensing verification and indemnification**
- Tidelift verifies license information to enable easy policy enforcement and adds intellectual property indemnification to cover creators and users in case something goes wrong. You always have a 100% up-to-date bill of materials for your dependencies to share with your legal team, customers, or partners.
-
-- **Maintenance and code improvement**
- Tidelift ensures the software you rely on keeps working as long as you need it to work. Your managed dependencies are actively maintained and we recruit additional maintainers where required.
-
-- **Package selection and version guidance**
- We help you choose the best open source packages from the start—and then guide you through updates to stay on the best releases as new issues arise.
-
-- **Roadmap input**
- Take a seat at the table with the creators behind the software you use. Tidelift’s participating maintainers earn more income as their software is used by more subscribers, so they’re interested in knowing what you need.
-
-- **Tooling and cloud integration**
- Tidelift works with GitHub, GitLab, BitBucket, and more. We support every cloud platform (and other deployment targets, too).
-
-The end result? All of the capabilities you expect from commercial-grade software, for the full breadth of open source you use. That means less time grappling with esoteric open source trivia, and more time building your own applications—and your business.
-
-[Learn more](https://tidelift.com/subscription/pkg/packagist-php-di-php-di?utm_source=packagist-php-di-php-di&utm_medium=referral&utm_campaign=enterprise) | [**Request a demo**](https://tidelift.com/subscription/request-a-demo?utm_source=packagist-php-di-php-di&utm_medium=referral&utm_campaign=enterprise)
diff --git a/vendor/php-di/phpdoc-reader/.gitattributes b/vendor/php-di/phpdoc-reader/.gitattributes
deleted file mode 100644
index 912292c..0000000
--- a/vendor/php-di/phpdoc-reader/.gitattributes
+++ /dev/null
@@ -1,7 +0,0 @@
-# .gitattributes
-tests/ export-ignore
-phpunit.xml.dist export-ignore
-.travis.yml export-ignore
-
-# Auto detect text files and perform LF normalization
-* text=auto
diff --git a/vendor/php-di/phpdoc-reader/.github/workflows/ci.yml b/vendor/php-di/phpdoc-reader/.github/workflows/ci.yml
deleted file mode 100644
index 5b7421d..0000000
--- a/vendor/php-di/phpdoc-reader/.github/workflows/ci.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-name: CI
-
-on:
- push:
- branches: ['master']
- pull_request:
- branches: ['*']
- schedule:
- - cron: '0 0 * * *'
-
-jobs:
-
- tests:
- name: Tests - PHP ${{ matrix.php }} ${{ matrix.dependency-version }}
- runs-on: ubuntu-latest
- timeout-minutes: 15
- strategy:
- matrix:
- php: [ '7.2', '7.3', '7.4', '8.0' ]
- dependency-version: [ '' ]
- include:
- - php: '7.2'
- dependency-version: '--prefer-lowest'
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Setup PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: ${{ matrix.php }}
- tools: composer:v2
- coverage: none
- - name: Cache Composer dependencies
- uses: actions/cache@v2
- with:
- path: ~/.composer/cache
- key: php-${{ matrix.php }}-composer-locked-${{ hashFiles('composer.lock') }}
- restore-keys: php-${{ matrix.php }}-composer-locked-
- - name: Install PHP dependencies
- run: composer update ${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress --no-suggest
- - name: PHPUnit
- run: vendor/bin/phpunit
-
- cs:
- name: Coding standards
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Setup PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: 7.4
- tools: composer:v2, cs2pr
- coverage: none
- - name: Cache Composer dependencies
- uses: actions/cache@v2
- with:
- path: ~/.composer/cache
- key: php-74-composer-locked-${{ hashFiles('composer.lock') }}
- restore-keys: php-74-composer-locked-
- - name: Install PHP dependencies
- run: composer install --no-interaction --no-progress --no-suggest
- - name: PHP CodeSniffer
- run: vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr
diff --git a/vendor/php-di/phpdoc-reader/.gitignore b/vendor/php-di/phpdoc-reader/.gitignore
deleted file mode 100644
index 9abe135..0000000
--- a/vendor/php-di/phpdoc-reader/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-.DS_Store
-.idea/*
-vendor/*
-composer.phar
-composer.lock
-.phpcs-cache
-.phpunit.result.cache
diff --git a/vendor/php-di/phpdoc-reader/.phpcs.xml.dist b/vendor/php-di/phpdoc-reader/.phpcs.xml.dist
deleted file mode 100644
index 191db96..0000000
--- a/vendor/php-di/phpdoc-reader/.phpcs.xml.dist
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
- src
- src/PhpDocReader/PhpParser/TokenParser.php
- tests
- tests/Fixtures
-
-
-
-
-
- 0
-
-
-
diff --git a/vendor/php-di/phpdoc-reader/LICENSE b/vendor/php-di/phpdoc-reader/LICENSE
deleted file mode 100644
index f3d2a02..0000000
--- a/vendor/php-di/phpdoc-reader/LICENSE
+++ /dev/null
@@ -1,16 +0,0 @@
-Copyright (C) 2019 Matthieu Napoli
-
-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.
diff --git a/vendor/php-di/phpdoc-reader/README.md b/vendor/php-di/phpdoc-reader/README.md
deleted file mode 100644
index bfaa6c3..0000000
--- a/vendor/php-di/phpdoc-reader/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-# PhpDocReader
-
-
-
-This project is used by:
-
-- [PHP-DI 6](http://php-di.org/)
-- [phockito-unit-php-di](https://github.com/balihoo/phockito-unit-php-di)
-
-Fork the README to add your project here.
-
-## Features
-
-PhpDocReader parses `@var` and `@param` values in PHP docblocks:
-
-```php
-
-use My\Cache\Backend;
-
-class Cache
-{
- /**
- * @var Backend
- */
- protected $backend;
-
- /**
- * @param Backend $backend
- */
- public function __construct($backend)
- {
- }
-}
-```
-
-It supports namespaced class names with the same resolution rules as PHP:
-
-- fully qualified name (starting with `\`)
-- imported class name (eg. `use My\Cache\Backend;`)
-- relative class name (from the current namespace, like `SubNamespace\MyClass`)
-- aliased class name (eg. `use My\Cache\Backend as FooBar;`)
-
-Primitive types (`@var string`) are ignored (returns null), only valid class names are returned.
-
-## Usage
-
-```php
-$reader = new PhpDocReader();
-
-// Read a property type (@var phpdoc)
-$property = new ReflectionProperty($className, $propertyName);
-$propertyClass = $reader->getPropertyClass($property);
-
-// Read a parameter type (@param phpdoc)
-$parameter = new ReflectionParameter(array($className, $methodName), $parameterName);
-$parameterClass = $reader->getParameterClass($parameter);
-```
diff --git a/vendor/php-di/phpdoc-reader/composer.json b/vendor/php-di/phpdoc-reader/composer.json
deleted file mode 100644
index 64d7262..0000000
--- a/vendor/php-di/phpdoc-reader/composer.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "php-di/phpdoc-reader",
- "type": "library",
- "description": "PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)",
- "keywords": ["phpdoc", "reflection"],
- "license": "MIT",
- "autoload": {
- "psr-4": {
- "PhpDocReader\\": "src/PhpDocReader"
- }
- },
- "autoload-dev": {
- "psr-4": {
- "UnitTest\\PhpDocReader\\": "tests/"
- }
- },
- "require": {
- "php": ">=7.2.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^8.5|^9.0",
- "mnapoli/hard-mode": "~0.3.0"
- }
-}
diff --git a/vendor/php-di/phpdoc-reader/src/PhpDocReader/AnnotationException.php b/vendor/php-di/phpdoc-reader/src/PhpDocReader/AnnotationException.php
deleted file mode 100644
index 1466a9b..0000000
--- a/vendor/php-di/phpdoc-reader/src/PhpDocReader/AnnotationException.php
+++ /dev/null
@@ -1,10 +0,0 @@
- 'bool',
- 'boolean' => 'bool',
- 'string' => 'string',
- 'int' => 'int',
- 'integer' => 'int',
- 'float' => 'float',
- 'double' => 'float',
- 'array' => 'array',
- 'object' => 'object',
- 'callable' => 'callable',
- 'resource' => 'resource',
- 'mixed' => 'mixed',
- 'iterable' => 'iterable',
- ];
-
- /** @var bool */
- private $ignorePhpDocErrors;
-
- /**
- * @param bool $ignorePhpDocErrors Enable or disable throwing errors when PhpDoc errors occur (when parsing annotations).
- */
- public function __construct(bool $ignorePhpDocErrors = false)
- {
- $this->parser = new UseStatementParser;
- $this->ignorePhpDocErrors = $ignorePhpDocErrors;
- }
-
- /**
- * Parse the docblock of the property to get the type (class or primitive type) of the var annotation.
- *
- * @return string|null Type of the property (content of var annotation)
- * @throws AnnotationException
- */
- public function getPropertyType(ReflectionProperty $property): ?string
- {
- return $this->readPropertyType($property, true);
- }
-
- /**
- * Parse the docblock of the property to get the class of the var annotation.
- *
- * @return string|null Type of the property (content of var annotation)
- * @throws AnnotationException
- */
- public function getPropertyClass(ReflectionProperty $property): ?string
- {
- return $this->readPropertyType($property, false);
- }
-
- private function readPropertyType(ReflectionProperty $property, bool $allowPrimitiveTypes): ?string
- {
- // Get the content of the @var annotation
- $docComment = $property->getDocComment();
- if (! $docComment) {
- return null;
- }
- if (preg_match('/@var\s+([^\s]+)/', $docComment, $matches)) {
- [, $type] = $matches;
- } else {
- return null;
- }
-
- // Ignore primitive types
- if (isset(self::PRIMITIVE_TYPES[$type])) {
- if ($allowPrimitiveTypes) {
- return self::PRIMITIVE_TYPES[$type];
- }
- return null;
- }
-
- // Ignore types containing special characters ([], <> ...)
- if (! preg_match('/^[a-zA-Z0-9\\\\_]+$/', $type)) {
- return null;
- }
-
- $class = $property->getDeclaringClass();
-
- // If the class name is not fully qualified (i.e. doesn't start with a \)
- if ($type[0] !== '\\') {
- // Try to resolve the FQN using the class context
- $resolvedType = $this->tryResolveFqn($type, $class, $property);
-
- if (! $resolvedType && ! $this->ignorePhpDocErrors) {
- throw new AnnotationException(sprintf(
- 'The @var annotation on %s::%s contains a non existent class "%s". '
- . 'Did you maybe forget to add a "use" statement for this annotation?',
- $class->name,
- $property->getName(),
- $type
- ));
- }
-
- $type = $resolvedType;
- }
-
- if (! $this->ignorePhpDocErrors && ! $this->classExists($type)) {
- throw new AnnotationException(sprintf(
- 'The @var annotation on %s::%s contains a non existent class "%s"',
- $class->name,
- $property->getName(),
- $type
- ));
- }
-
- // Remove the leading \ (FQN shouldn't contain it)
- $type = is_string($type) ? ltrim($type, '\\') : null;
-
- return $type;
- }
-
- /**
- * Parse the docblock of the property to get the type (class or primitive type) of the param annotation.
- *
- * @return string|null Type of the property (content of var annotation)
- * @throws AnnotationException
- */
- public function getParameterType(ReflectionParameter $parameter): ?string
- {
- return $this->readParameterClass($parameter, true);
- }
-
- /**
- * Parse the docblock of the property to get the class of the param annotation.
- *
- * @return string|null Type of the property (content of var annotation)
- * @throws AnnotationException
- */
- public function getParameterClass(ReflectionParameter $parameter): ?string
- {
- return $this->readParameterClass($parameter, false);
- }
-
- private function readParameterClass(ReflectionParameter $parameter, bool $allowPrimitiveTypes): ?string
- {
- // Use reflection
- $parameterType = $parameter->getType();
- if ($parameterType && $parameterType instanceof \ReflectionNamedType && ! $parameterType->isBuiltin()) {
- return $parameterType->getName();
- }
-
- $parameterName = $parameter->name;
- // Get the content of the @param annotation
- $method = $parameter->getDeclaringFunction();
- $docComment = $method->getDocComment();
- if (! $docComment) {
- return null;
- }
- if (preg_match('/@param\s+([^\s]+)\s+\$' . $parameterName . '/', $docComment, $matches)) {
- [, $type] = $matches;
- } else {
- return null;
- }
-
- // Ignore primitive types
- if (isset(self::PRIMITIVE_TYPES[$type])) {
- if ($allowPrimitiveTypes) {
- return self::PRIMITIVE_TYPES[$type];
- }
- return null;
- }
-
- // Ignore types containing special characters ([], <> ...)
- if (! preg_match('/^[a-zA-Z0-9\\\\_]+$/', $type)) {
- return null;
- }
-
- $class = $parameter->getDeclaringClass();
-
- // If the class name is not fully qualified (i.e. doesn't start with a \)
- if ($type[0] !== '\\') {
- // Try to resolve the FQN using the class context
- $resolvedType = $this->tryResolveFqn($type, $class, $parameter);
-
- if (! $resolvedType && ! $this->ignorePhpDocErrors) {
- throw new AnnotationException(sprintf(
- 'The @param annotation for parameter "%s" of %s::%s contains a non existent class "%s". '
- . 'Did you maybe forget to add a "use" statement for this annotation?',
- $parameterName,
- $class->name,
- $method->name,
- $type
- ));
- }
-
- $type = $resolvedType;
- }
-
- if (! $this->ignorePhpDocErrors && ! $this->classExists($type)) {
- throw new AnnotationException(sprintf(
- 'The @param annotation for parameter "%s" of %s::%s contains a non existent class "%s"',
- $parameterName,
- $class->name,
- $method->name,
- $type
- ));
- }
-
- // Remove the leading \ (FQN shouldn't contain it)
- $type = is_string($type) ? ltrim($type, '\\') : null;
-
- return $type;
- }
-
- /**
- * Attempts to resolve the FQN of the provided $type based on the $class and $member context.
- *
- * @return string|null Fully qualified name of the type, or null if it could not be resolved
- */
- private function tryResolveFqn(string $type, ReflectionClass $class, Reflector $member): ?string
- {
- $alias = ($pos = strpos($type, '\\')) === false ? $type : substr($type, 0, $pos);
- $loweredAlias = strtolower($alias);
-
- // Retrieve "use" statements
- $uses = $this->parser->parseUseStatements($class);
-
- if (isset($uses[$loweredAlias])) {
- // Imported classes
- if ($pos !== false) {
- return $uses[$loweredAlias] . substr($type, $pos);
- }
- return $uses[$loweredAlias];
- }
-
- if ($this->classExists($class->getNamespaceName() . '\\' . $type)) {
- return $class->getNamespaceName() . '\\' . $type;
- }
-
- if (isset($uses['__NAMESPACE__']) && $this->classExists($uses['__NAMESPACE__'] . '\\' . $type)) {
- // Class namespace
- return $uses['__NAMESPACE__'] . '\\' . $type;
- }
-
- if ($this->classExists($type)) {
- // No namespace
- return $type;
- }
-
- // If all fail, try resolving through related traits
- return $this->tryResolveFqnInTraits($type, $class, $member);
- }
-
- /**
- * Attempts to resolve the FQN of the provided $type based on the $class and $member context, specifically searching
- * through the traits that are used by the provided $class.
- *
- * @return string|null Fully qualified name of the type, or null if it could not be resolved
- */
- private function tryResolveFqnInTraits(string $type, ReflectionClass $class, Reflector $member): ?string
- {
- /** @var ReflectionClass[] $traits */
- $traits = [];
-
- // Get traits for the class and its parents
- while ($class) {
- $traits = array_merge($traits, $class->getTraits());
- $class = $class->getParentClass();
- }
-
- foreach ($traits as $trait) {
- // Eliminate traits that don't have the property/method/parameter
- if ($member instanceof ReflectionProperty && ! $trait->hasProperty($member->name)) {
- continue;
- }
- if ($member instanceof ReflectionMethod && ! $trait->hasMethod($member->name)) {
- continue;
- }
- if ($member instanceof ReflectionParameter && ! $trait->hasMethod($member->getDeclaringFunction()->name)) {
- continue;
- }
-
- // Run the resolver again with the ReflectionClass instance for the trait
- $resolvedType = $this->tryResolveFqn($type, $trait, $member);
-
- if ($resolvedType) {
- return $resolvedType;
- }
- }
-
- return null;
- }
-
- private function classExists(string $class): bool
- {
- return class_exists($class) || interface_exists($class);
- }
-}
diff --git a/vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/TokenParser.php b/vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/TokenParser.php
deleted file mode 100644
index 1f6ec70..0000000
--- a/vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/TokenParser.php
+++ /dev/null
@@ -1,182 +0,0 @@
-
- * @author Christian Kaps
- */
-class TokenParser
-{
- /**
- * The token list.
- *
- * @var list
- */
- private $tokens;
-
- /**
- * The number of tokens.
- *
- * @var int
- */
- private $numTokens;
-
- /**
- * The current array pointer.
- *
- * @var int
- */
- private $pointer = 0;
-
- /**
- * @param string $contents
- */
- public function __construct($contents)
- {
- $this->tokens = token_get_all($contents);
-
- // The PHP parser sets internal compiler globals for certain things. Annoyingly, the last docblock comment it
- // saw gets stored in doc_comment. When it comes to compile the next thing to be include()d this stored
- // doc_comment becomes owned by the first thing the compiler sees in the file that it considers might have a
- // docblock. If the first thing in the file is a class without a doc block this would cause calls to
- // getDocBlock() on said class to return our long lost doc_comment. Argh.
- // To workaround, cause the parser to parse an empty docblock. Sure getDocBlock() will return this, but at least
- // it's harmless to us.
- token_get_all("numTokens = count($this->tokens);
- }
-
- /**
- * Gets all use statements.
- *
- * @param string $namespaceName The namespace name of the reflected class.
- *
- * @return array A list with all found use statements.
- */
- public function parseUseStatements($namespaceName)
- {
- $statements = [];
- while (($token = $this->next())) {
- if ($token[0] === T_USE) {
- $statements = array_merge($statements, $this->parseUseStatement());
- continue;
- }
-
- if ($token[0] !== T_NAMESPACE || $this->parseNamespace() !== $namespaceName) {
- continue;
- }
-
- // Get fresh array for new namespace. This is to prevent the parser to collect the use statements
- // for a previous namespace with the same name. This is the case if a namespace is defined twice
- // or if a namespace with the same name is commented out.
- $statements = [];
- }
-
- return $statements;
- }
-
- /**
- * Gets the next non whitespace and non comment token.
- *
- * @param bool $docCommentIsComment If TRUE then a doc comment is considered a comment and skipped.
- * If FALSE then only whitespace and normal comments are skipped.
- *
- * @return mixed[]|string|null The token if exists, null otherwise.
- */
- private function next($docCommentIsComment = true)
- {
- for ($i = $this->pointer; $i < $this->numTokens; $i++) {
- $this->pointer++;
- if (
- $this->tokens[$i][0] === T_WHITESPACE ||
- $this->tokens[$i][0] === T_COMMENT ||
- ($docCommentIsComment && $this->tokens[$i][0] === T_DOC_COMMENT)
- ) {
- continue;
- }
-
- return $this->tokens[$i];
- }
-
- return null;
- }
-
- /**
- * Parses a single use statement.
- *
- * @return array A list with all found class names for a use statement.
- */
- private function parseUseStatement()
- {
- $groupRoot = '';
- $class = '';
- $alias = '';
- $statements = [];
- $explicitAlias = false;
- while (($token = $this->next())) {
- if (! $explicitAlias && $token[0] === T_STRING) {
- $class .= $token[1];
- $alias = $token[1];
- } elseif ($explicitAlias && $token[0] === T_STRING) {
- $alias = $token[1];
- } elseif (
- PHP_VERSION_ID >= 80000 &&
- ($token[0] === T_NAME_QUALIFIED || $token[0] === T_NAME_FULLY_QUALIFIED)
- ) {
- $class .= $token[1];
-
- $classSplit = explode('\\', $token[1]);
- $alias = $classSplit[count($classSplit) - 1];
- } elseif ($token[0] === T_NS_SEPARATOR) {
- $class .= '\\';
- $alias = '';
- } elseif ($token[0] === T_AS) {
- $explicitAlias = true;
- $alias = '';
- } elseif ($token === ',') {
- $statements[strtolower($alias)] = $groupRoot . $class;
- $class = '';
- $alias = '';
- $explicitAlias = false;
- } elseif ($token === ';') {
- $statements[strtolower($alias)] = $groupRoot . $class;
- break;
- } elseif ($token === '{') {
- $groupRoot = $class;
- $class = '';
- } elseif ($token === '}') {
- continue;
- } else {
- break;
- }
- }
-
- return $statements;
- }
-
- /**
- * Gets the namespace.
- *
- * @return string The found namespace.
- */
- private function parseNamespace()
- {
- $name = '';
- while (
- ($token = $this->next()) && ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR || (
- PHP_VERSION_ID >= 80000 &&
- ($token[0] === T_NAME_QUALIFIED || $token[0] === T_NAME_FULLY_QUALIFIED)
- ))
- ) {
- $name .= $token[1];
- }
-
- return $name;
- }
-}
diff --git a/vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/UseStatementParser.php b/vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/UseStatementParser.php
deleted file mode 100644
index 39515df..0000000
--- a/vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/UseStatementParser.php
+++ /dev/null
@@ -1,64 +0,0 @@
- and Christian Kaps
- */
-class UseStatementParser
-{
- /**
- * @return array A list with use statements in the form (Alias => FQN).
- */
- public function parseUseStatements(\ReflectionClass $class): array
- {
- $filename = $class->getFilename();
- if ($filename === false) {
- return [];
- }
-
- $content = $this->getFileContent($filename, $class->getStartLine());
-
- if ($content === null) {
- return [];
- }
-
- $namespace = preg_quote($class->getNamespaceName(), '/');
- $content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content);
- $tokenizer = new TokenParser('parseUseStatements($class->getNamespaceName());
- }
-
- /**
- * Gets the content of the file right up to the given line number.
- *
- * @param string $filename The name of the file to load.
- * @param int $lineNumber The number of lines to read from file.
- */
- private function getFileContent(string $filename, int $lineNumber): string
- {
- if (! is_file($filename)) {
- throw new \RuntimeException("Unable to read file $filename");
- }
-
- $content = '';
- $lineCnt = 0;
- $file = new SplFileObject($filename);
- while (! $file->eof()) {
- if ($lineCnt++ === $lineNumber) {
- break;
- }
-
- $content .= $file->fgets();
- }
-
- return $content;
- }
-}
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php
deleted file mode 100644
index 500c952..0000000
--- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
- */
-
-$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:身份验证失败。';
-$PHPMAILER_LANG['connect_host'] = 'SMTP 错误: 不能连接SMTP主机。';
-$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误: 数据不可接受。';
-//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
-$PHPMAILER_LANG['encoding'] = '未知编码:';
-$PHPMAILER_LANG['execute'] = '不能执行: ';
-$PHPMAILER_LANG['file_access'] = '不能访问文件:';
-$PHPMAILER_LANG['file_open'] = '文件错误:不能打开文件:';
-$PHPMAILER_LANG['from_failed'] = '下面的发送地址邮件发送失败了: ';
-$PHPMAILER_LANG['instantiate'] = '不能实现mail方法。';
-//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: ';
-$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。';
-$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。';
-$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下面的 收件人失败了: ';
-//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
-//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
-//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
-//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
-//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
diff --git a/vendor/psr/cache/CHANGELOG.md b/vendor/psr/cache/CHANGELOG.md
deleted file mode 100644
index 58ddab0..0000000
--- a/vendor/psr/cache/CHANGELOG.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file, in reverse chronological order by release.
-
-## 1.0.1 - 2016-08-06
-
-### Fixed
-
-- Make spacing consistent in phpdoc annotations php-fig/cache#9 - chalasr
-- Fix grammar in phpdoc annotations php-fig/cache#10 - chalasr
-- Be more specific in docblocks that `getItems()` and `deleteItems()` take an array of strings (`string[]`) compared to just `array` php-fig/cache#8 - GrahamCampbell
-- For `expiresAt()` and `expiresAfter()` in CacheItemInterface fix docblock to specify null as a valid parameters as well as an implementation of DateTimeInterface php-fig/cache#7 - GrahamCampbell
-
-## 1.0.0 - 2015-12-11
-
-Initial stable release; reflects accepted PSR-6 specification
diff --git a/vendor/psr/cache/LICENSE.txt b/vendor/psr/cache/LICENSE.txt
deleted file mode 100644
index b1c2c97..0000000
--- a/vendor/psr/cache/LICENSE.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2015 PHP Framework Interoperability Group
-
-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.
diff --git a/vendor/psr/cache/README.md b/vendor/psr/cache/README.md
deleted file mode 100644
index c8706ce..0000000
--- a/vendor/psr/cache/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-PSR Cache
-=========
-
-This repository holds all interfaces defined by
-[PSR-6](http://www.php-fig.org/psr/psr-6/).
-
-Note that this is not a Cache implementation of its own. It is merely an
-interface that describes a Cache implementation. See the specification for more
-details.
diff --git a/vendor/psr/cache/composer.json b/vendor/psr/cache/composer.json
deleted file mode 100644
index e828fec..0000000
--- a/vendor/psr/cache/composer.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "name": "psr/cache",
- "description": "Common interface for caching libraries",
- "keywords": ["psr", "psr-6", "cache"],
- "license": "MIT",
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "require": {
- "php": ">=5.3.0"
- },
- "autoload": {
- "psr-4": {
- "Psr\\Cache\\": "src/"
- }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- }
-}
diff --git a/vendor/psr/cache/src/CacheException.php b/vendor/psr/cache/src/CacheException.php
deleted file mode 100644
index e27f22f..0000000
--- a/vendor/psr/cache/src/CacheException.php
+++ /dev/null
@@ -1,10 +0,0 @@
-=7.2.0"
- },
- "autoload": {
- "psr-4": {
- "Psr\\EventDispatcher\\": "src/"
- }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- }
-}
diff --git a/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php b/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php
deleted file mode 100644
index 4306fa9..0000000
--- a/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php
+++ /dev/null
@@ -1,21 +0,0 @@
-=7.0.0",
+ "psr/http-message": "^1.0 || ^2.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ }
+}
diff --git a/vendor/psr/http-factory/src/RequestFactoryInterface.php b/vendor/psr/http-factory/src/RequestFactoryInterface.php
new file mode 100644
index 0000000..cb39a08
--- /dev/null
+++ b/vendor/psr/http-factory/src/RequestFactoryInterface.php
@@ -0,0 +1,18 @@
+log(LogLevel::EMERGENCY, $message, $context);
- }
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param mixed[] $context
- *
- * @return void
- */
- public function alert($message, array $context = array())
- {
- $this->log(LogLevel::ALERT, $message, $context);
- }
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param mixed[] $context
- *
- * @return void
- */
- public function critical($message, array $context = array())
- {
- $this->log(LogLevel::CRITICAL, $message, $context);
- }
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param mixed[] $context
- *
- * @return void
- */
- public function error($message, array $context = array())
- {
- $this->log(LogLevel::ERROR, $message, $context);
- }
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param mixed[] $context
- *
- * @return void
- */
- public function warning($message, array $context = array())
- {
- $this->log(LogLevel::WARNING, $message, $context);
- }
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param mixed[] $context
- *
- * @return void
- */
- public function notice($message, array $context = array())
- {
- $this->log(LogLevel::NOTICE, $message, $context);
- }
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param mixed[] $context
- *
- * @return void
- */
- public function info($message, array $context = array())
- {
- $this->log(LogLevel::INFO, $message, $context);
- }
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param mixed[] $context
- *
- * @return void
- */
- public function debug($message, array $context = array())
- {
- $this->log(LogLevel::DEBUG, $message, $context);
- }
-}
diff --git a/vendor/psr/log/Psr/Log/Test/DummyTest.php b/vendor/psr/log/Psr/Log/Test/DummyTest.php
deleted file mode 100644
index 9638c11..0000000
--- a/vendor/psr/log/Psr/Log/Test/DummyTest.php
+++ /dev/null
@@ -1,18 +0,0 @@
- ".
- *
- * Example ->error('Foo') would yield "error Foo".
- *
- * @return string[]
- */
- abstract public function getLogs();
-
- public function testImplements()
- {
- $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger());
- }
-
- /**
- * @dataProvider provideLevelsAndMessages
- */
- public function testLogsAtAllLevels($level, $message)
- {
- $logger = $this->getLogger();
- $logger->{$level}($message, array('user' => 'Bob'));
- $logger->log($level, $message, array('user' => 'Bob'));
-
- $expected = array(
- $level.' message of level '.$level.' with context: Bob',
- $level.' message of level '.$level.' with context: Bob',
- );
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function provideLevelsAndMessages()
- {
- return array(
- LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'),
- LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'),
- LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'),
- LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'),
- LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'),
- LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'),
- LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'),
- LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'),
- );
- }
-
- /**
- * @expectedException \Psr\Log\InvalidArgumentException
- */
- public function testThrowsOnInvalidLevel()
- {
- $logger = $this->getLogger();
- $logger->log('invalid level', 'Foo');
- }
-
- public function testContextReplacement()
- {
- $logger = $this->getLogger();
- $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));
-
- $expected = array('info {Message {nothing} Bob Bar a}');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testObjectCastToString()
- {
- if (method_exists($this, 'createPartialMock')) {
- $dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString'));
- } else {
- $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString'));
- }
- $dummy->expects($this->once())
- ->method('__toString')
- ->will($this->returnValue('DUMMY'));
-
- $this->getLogger()->warning($dummy);
-
- $expected = array('warning DUMMY');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testContextCanContainAnything()
- {
- $closed = fopen('php://memory', 'r');
- fclose($closed);
-
- $context = array(
- 'bool' => true,
- 'null' => null,
- 'string' => 'Foo',
- 'int' => 0,
- 'float' => 0.5,
- 'nested' => array('with object' => new DummyTest),
- 'object' => new \DateTime,
- 'resource' => fopen('php://memory', 'r'),
- 'closed' => $closed,
- );
-
- $this->getLogger()->warning('Crazy context data', $context);
-
- $expected = array('warning Crazy context data');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testContextExceptionKeyCanBeExceptionOrOtherValues()
- {
- $logger = $this->getLogger();
- $logger->warning('Random message', array('exception' => 'oops'));
- $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail')));
-
- $expected = array(
- 'warning Random message',
- 'critical Uncaught Exception!'
- );
- $this->assertEquals($expected, $this->getLogs());
- }
-}
diff --git a/vendor/psr/log/Psr/Log/Test/TestLogger.php b/vendor/psr/log/Psr/Log/Test/TestLogger.php
deleted file mode 100644
index 1be3230..0000000
--- a/vendor/psr/log/Psr/Log/Test/TestLogger.php
+++ /dev/null
@@ -1,147 +0,0 @@
- $level,
- 'message' => $message,
- 'context' => $context,
- ];
-
- $this->recordsByLevel[$record['level']][] = $record;
- $this->records[] = $record;
- }
-
- public function hasRecords($level)
- {
- return isset($this->recordsByLevel[$level]);
- }
-
- public function hasRecord($record, $level)
- {
- if (is_string($record)) {
- $record = ['message' => $record];
- }
- return $this->hasRecordThatPasses(function ($rec) use ($record) {
- if ($rec['message'] !== $record['message']) {
- return false;
- }
- if (isset($record['context']) && $rec['context'] !== $record['context']) {
- return false;
- }
- return true;
- }, $level);
- }
-
- public function hasRecordThatContains($message, $level)
- {
- return $this->hasRecordThatPasses(function ($rec) use ($message) {
- return strpos($rec['message'], $message) !== false;
- }, $level);
- }
-
- public function hasRecordThatMatches($regex, $level)
- {
- return $this->hasRecordThatPasses(function ($rec) use ($regex) {
- return preg_match($regex, $rec['message']) > 0;
- }, $level);
- }
-
- public function hasRecordThatPasses(callable $predicate, $level)
- {
- if (!isset($this->recordsByLevel[$level])) {
- return false;
- }
- foreach ($this->recordsByLevel[$level] as $i => $rec) {
- if (call_user_func($predicate, $rec, $i)) {
- return true;
- }
- }
- return false;
- }
-
- public function __call($method, $args)
- {
- if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
- $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
- $level = strtolower($matches[2]);
- if (method_exists($this, $genericMethod)) {
- $args[] = $level;
- return call_user_func_array([$this, $genericMethod], $args);
- }
- }
- throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');
- }
-
- public function reset()
- {
- $this->records = [];
- $this->recordsByLevel = [];
- }
-}
diff --git a/vendor/psr/log/composer.json b/vendor/psr/log/composer.json
index ca05695..879fc6f 100644
--- a/vendor/psr/log/composer.json
+++ b/vendor/psr/log/composer.json
@@ -11,16 +11,16 @@
}
],
"require": {
- "php": ">=5.3.0"
+ "php": ">=8.0.0"
},
"autoload": {
"psr-4": {
- "Psr\\Log\\": "Psr/Log/"
+ "Psr\\Log\\": "src"
}
},
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "3.x-dev"
}
}
}
diff --git a/vendor/psr/log/src/AbstractLogger.php b/vendor/psr/log/src/AbstractLogger.php
new file mode 100644
index 0000000..d60a091
--- /dev/null
+++ b/vendor/psr/log/src/AbstractLogger.php
@@ -0,0 +1,15 @@
+logger = $logger;
}
diff --git a/vendor/psr/log/Psr/Log/LoggerInterface.php b/vendor/psr/log/src/LoggerInterface.php
similarity index 66%
rename from vendor/psr/log/Psr/Log/LoggerInterface.php
rename to vendor/psr/log/src/LoggerInterface.php
index 2206cfd..b3a24b5 100644
--- a/vendor/psr/log/Psr/Log/LoggerInterface.php
+++ b/vendor/psr/log/src/LoggerInterface.php
@@ -22,12 +22,12 @@ interface LoggerInterface
/**
* System is unusable.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
- public function emergency($message, array $context = array());
+ public function emergency(string|\Stringable $message, array $context = []): void;
/**
* Action must be taken immediately.
@@ -35,35 +35,35 @@ interface LoggerInterface
* Example: Entire website down, database unavailable, etc. This should
* trigger the SMS alerts and wake you up.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
- public function alert($message, array $context = array());
+ public function alert(string|\Stringable $message, array $context = []): void;
/**
* Critical conditions.
*
* Example: Application component unavailable, unexpected exception.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
- public function critical($message, array $context = array());
+ public function critical(string|\Stringable $message, array $context = []): void;
/**
* Runtime errors that do not require immediate action but should typically
* be logged and monitored.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
- public function error($message, array $context = array());
+ public function error(string|\Stringable $message, array $context = []): void;
/**
* Exceptional occurrences that are not errors.
@@ -71,55 +71,55 @@ interface LoggerInterface
* Example: Use of deprecated APIs, poor use of an API, undesirable things
* that are not necessarily wrong.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
- public function warning($message, array $context = array());
+ public function warning(string|\Stringable $message, array $context = []): void;
/**
* Normal but significant events.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
- public function notice($message, array $context = array());
+ public function notice(string|\Stringable $message, array $context = []): void;
/**
* Interesting events.
*
* Example: User logs in, SQL logs.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
- public function info($message, array $context = array());
+ public function info(string|\Stringable $message, array $context = []): void;
/**
* Detailed debug information.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
- public function debug($message, array $context = array());
+ public function debug(string|\Stringable $message, array $context = []): void;
/**
* Logs with an arbitrary level.
*
* @param mixed $level
- * @param string $message
+ * @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*
* @throws \Psr\Log\InvalidArgumentException
*/
- public function log($level, $message, array $context = array());
+ public function log($level, string|\Stringable $message, array $context = []): void;
}
diff --git a/vendor/psr/log/Psr/Log/LoggerTrait.php b/vendor/psr/log/src/LoggerTrait.php
similarity index 69%
rename from vendor/psr/log/Psr/Log/LoggerTrait.php
rename to vendor/psr/log/src/LoggerTrait.php
index e392fef..9c8733f 100644
--- a/vendor/psr/log/Psr/Log/LoggerTrait.php
+++ b/vendor/psr/log/src/LoggerTrait.php
@@ -15,12 +15,12 @@ trait LoggerTrait
/**
* System is unusable.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param array $context
*
* @return void
*/
- public function emergency($message, array $context = array())
+ public function emergency(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::EMERGENCY, $message, $context);
}
@@ -31,12 +31,12 @@ trait LoggerTrait
* Example: Entire website down, database unavailable, etc. This should
* trigger the SMS alerts and wake you up.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param array $context
*
* @return void
*/
- public function alert($message, array $context = array())
+ public function alert(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::ALERT, $message, $context);
}
@@ -46,12 +46,12 @@ trait LoggerTrait
*
* Example: Application component unavailable, unexpected exception.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param array $context
*
* @return void
*/
- public function critical($message, array $context = array())
+ public function critical(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::CRITICAL, $message, $context);
}
@@ -60,12 +60,12 @@ trait LoggerTrait
* Runtime errors that do not require immediate action but should typically
* be logged and monitored.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param array $context
*
* @return void
*/
- public function error($message, array $context = array())
+ public function error(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::ERROR, $message, $context);
}
@@ -76,12 +76,12 @@ trait LoggerTrait
* Example: Use of deprecated APIs, poor use of an API, undesirable things
* that are not necessarily wrong.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param array $context
*
* @return void
*/
- public function warning($message, array $context = array())
+ public function warning(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::WARNING, $message, $context);
}
@@ -89,12 +89,12 @@ trait LoggerTrait
/**
* Normal but significant events.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param array $context
*
* @return void
*/
- public function notice($message, array $context = array())
+ public function notice(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::NOTICE, $message, $context);
}
@@ -104,12 +104,12 @@ trait LoggerTrait
*
* Example: User logs in, SQL logs.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param array $context
*
* @return void
*/
- public function info($message, array $context = array())
+ public function info(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::INFO, $message, $context);
}
@@ -117,12 +117,12 @@ trait LoggerTrait
/**
* Detailed debug information.
*
- * @param string $message
+ * @param string|\Stringable $message
* @param array $context
*
* @return void
*/
- public function debug($message, array $context = array())
+ public function debug(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::DEBUG, $message, $context);
}
@@ -131,12 +131,12 @@ trait LoggerTrait
* Logs with an arbitrary level.
*
* @param mixed $level
- * @param string $message
+ * @param string|\Stringable $message
* @param array $context
*
* @return void
*
* @throws \Psr\Log\InvalidArgumentException
*/
- abstract public function log($level, $message, array $context = array());
+ abstract public function log($level, string|\Stringable $message, array $context = []): void;
}
diff --git a/vendor/psr/log/Psr/Log/NullLogger.php b/vendor/psr/log/src/NullLogger.php
similarity index 78%
rename from vendor/psr/log/Psr/Log/NullLogger.php
rename to vendor/psr/log/src/NullLogger.php
index c8f7293..c1cc3c0 100644
--- a/vendor/psr/log/Psr/Log/NullLogger.php
+++ b/vendor/psr/log/src/NullLogger.php
@@ -16,14 +16,14 @@ class NullLogger extends AbstractLogger
* Logs with an arbitrary level.
*
* @param mixed $level
- * @param string $message
- * @param array $context
+ * @param string|\Stringable $message
+ * @param array $context
*
* @return void
*
* @throws \Psr\Log\InvalidArgumentException
*/
- public function log($level, $message, array $context = array())
+ public function log($level, string|\Stringable $message, array $context = []): void
{
// noop
}
diff --git a/vendor/psr/simple-cache/composer.json b/vendor/psr/simple-cache/composer.json
index 2978fa5..f307a84 100644
--- a/vendor/psr/simple-cache/composer.json
+++ b/vendor/psr/simple-cache/composer.json
@@ -6,11 +6,11 @@
"authors": [
{
"name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "homepage": "https://www.php-fig.org/"
}
],
"require": {
- "php": ">=5.3.0"
+ "php": ">=8.0.0"
},
"autoload": {
"psr-4": {
@@ -19,7 +19,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "3.0.x-dev"
}
}
}
diff --git a/vendor/psr/simple-cache/src/CacheException.php b/vendor/psr/simple-cache/src/CacheException.php
index eba5381..f61b24c 100644
--- a/vendor/psr/simple-cache/src/CacheException.php
+++ b/vendor/psr/simple-cache/src/CacheException.php
@@ -5,6 +5,6 @@ namespace Psr\SimpleCache;
/**
* Interface used for all types of exceptions thrown by the implementing library.
*/
-interface CacheException
+interface CacheException extends \Throwable
{
}
diff --git a/vendor/psr/simple-cache/src/CacheInterface.php b/vendor/psr/simple-cache/src/CacheInterface.php
index 99e8d95..671e340 100644
--- a/vendor/psr/simple-cache/src/CacheInterface.php
+++ b/vendor/psr/simple-cache/src/CacheInterface.php
@@ -15,7 +15,7 @@ interface CacheInterface
* @throws \Psr\SimpleCache\InvalidArgumentException
* MUST be thrown if the $key string is not a legal value.
*/
- public function get($key, $default = null);
+ public function get(string $key, mixed $default = null): mixed;
/**
* Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
@@ -31,7 +31,7 @@ interface CacheInterface
* @throws \Psr\SimpleCache\InvalidArgumentException
* MUST be thrown if the $key string is not a legal value.
*/
- public function set($key, $value, $ttl = null);
+ public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool;
/**
* Delete an item from the cache by its unique key.
@@ -43,28 +43,28 @@ interface CacheInterface
* @throws \Psr\SimpleCache\InvalidArgumentException
* MUST be thrown if the $key string is not a legal value.
*/
- public function delete($key);
+ public function delete(string $key): bool;
/**
* Wipes clean the entire cache's keys.
*
* @return bool True on success and false on failure.
*/
- public function clear();
+ public function clear(): bool;
/**
* Obtains multiple cache items by their unique keys.
*
- * @param iterable $keys A list of keys that can obtained in a single operation.
- * @param mixed $default Default value to return for keys that do not exist.
+ * @param iterable $keys A list of keys that can be obtained in a single operation.
+ * @param mixed $default Default value to return for keys that do not exist.
*
- * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value.
+ * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value.
*
* @throws \Psr\SimpleCache\InvalidArgumentException
* MUST be thrown if $keys is neither an array nor a Traversable,
* or if any of the $keys are not a legal value.
*/
- public function getMultiple($keys, $default = null);
+ public function getMultiple(iterable $keys, mixed $default = null): iterable;
/**
* Persists a set of key => value pairs in the cache, with an optional TTL.
@@ -80,12 +80,12 @@ interface CacheInterface
* MUST be thrown if $values is neither an array nor a Traversable,
* or if any of the $values are not a legal value.
*/
- public function setMultiple($values, $ttl = null);
+ public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool;
/**
* Deletes multiple cache items in a single operation.
*
- * @param iterable $keys A list of string-based keys to be deleted.
+ * @param iterable $keys A list of string-based keys to be deleted.
*
* @return bool True if the items were successfully removed. False if there was an error.
*
@@ -93,7 +93,7 @@ interface CacheInterface
* MUST be thrown if $keys is neither an array nor a Traversable,
* or if any of the $keys are not a legal value.
*/
- public function deleteMultiple($keys);
+ public function deleteMultiple(iterable $keys): bool;
/**
* Determines whether an item is present in the cache.
@@ -110,5 +110,5 @@ interface CacheInterface
* @throws \Psr\SimpleCache\InvalidArgumentException
* MUST be thrown if the $key string is not a legal value.
*/
- public function has($key);
+ public function has(string $key): bool;
}
diff --git a/vendor/services.php b/vendor/services.php
index 4426f92..2cf0142 100644
--- a/vendor/services.php
+++ b/vendor/services.php
@@ -1,10 +1,8 @@
'taoser\\addons\\Service',
1 => 'think\\captcha\\CaptchaService',
- 2 => 'think\\migration\\Service',
- 3 => 'think\\app\\Service',
- 4 => 'think\\trace\\Service',
+ 2 => 'think\\app\\Service',
);
\ No newline at end of file
diff --git a/vendor/symfony/deprecation-contracts/CHANGELOG.md b/vendor/symfony/deprecation-contracts/CHANGELOG.md
new file mode 100644
index 0000000..7932e26
--- /dev/null
+++ b/vendor/symfony/deprecation-contracts/CHANGELOG.md
@@ -0,0 +1,5 @@
+CHANGELOG
+=========
+
+The changelog is maintained for all Symfony contracts at the following URL:
+https://github.com/symfony/contracts/blob/main/CHANGELOG.md
diff --git a/vendor/league/flysystem-cached-adapter/LICENSE b/vendor/symfony/deprecation-contracts/LICENSE
similarity index 95%
rename from vendor/league/flysystem-cached-adapter/LICENSE
rename to vendor/symfony/deprecation-contracts/LICENSE
index 666f6c8..0ed3a24 100644
--- a/vendor/league/flysystem-cached-adapter/LICENSE
+++ b/vendor/symfony/deprecation-contracts/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2015 Frank de Jonge
+Copyright (c) 2020-present 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
diff --git a/vendor/symfony/deprecation-contracts/README.md b/vendor/symfony/deprecation-contracts/README.md
new file mode 100644
index 0000000..9814864
--- /dev/null
+++ b/vendor/symfony/deprecation-contracts/README.md
@@ -0,0 +1,26 @@
+Symfony Deprecation Contracts
+=============================
+
+A generic function and convention to trigger deprecation notices.
+
+This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices.
+
+By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component,
+the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments.
+
+The function requires at least 3 arguments:
+ - the name of the Composer package that is triggering the deprecation
+ - the version of the package that introduced the deprecation
+ - the message of the deprecation
+ - more arguments can be provided: they will be inserted in the message using `printf()` formatting
+
+Example:
+```php
+trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin');
+```
+
+This will generate the following message:
+`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.`
+
+While not recommended, the deprecation notices can be completely ignored by declaring an empty
+`function trigger_deprecation() {}` in your application.
diff --git a/vendor/symfony/polyfill-php72/composer.json b/vendor/symfony/deprecation-contracts/composer.json
similarity index 52%
rename from vendor/symfony/polyfill-php72/composer.json
rename to vendor/symfony/deprecation-contracts/composer.json
index 5f17af3..c6d02d8 100644
--- a/vendor/symfony/polyfill-php72/composer.json
+++ b/vendor/symfony/deprecation-contracts/composer.json
@@ -1,8 +1,7 @@
{
- "name": "symfony/polyfill-php72",
+ "name": "symfony/deprecation-contracts",
"type": "library",
- "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
- "keywords": ["polyfill", "shim", "compatibility", "portable"],
+ "description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"license": "MIT",
"authors": [
@@ -16,20 +15,21 @@
}
],
"require": {
- "php": ">=7.1"
+ "php": ">=8.1"
},
"autoload": {
- "psr-4": { "Symfony\\Polyfill\\Php72\\": "" },
- "files": [ "bootstrap.php" ]
+ "files": [
+ "function.php"
+ ]
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-main": "1.27-dev"
+ "dev-main": "3.4-dev"
},
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
}
}
}
diff --git a/vendor/symfony/deprecation-contracts/function.php b/vendor/symfony/deprecation-contracts/function.php
new file mode 100644
index 0000000..2d56512
--- /dev/null
+++ b/vendor/symfony/deprecation-contracts/function.php
@@ -0,0 +1,27 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+if (!function_exists('trigger_deprecation')) {
+ /**
+ * Triggers a silenced deprecation notice.
+ *
+ * @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 $message The message of the deprecation
+ * @param mixed ...$args Values to insert in the message using printf() formatting
+ *
+ * @author Nicolas Grekas
+ */
+ function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void
+ {
+ @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
+ }
+}
diff --git a/vendor/symfony/polyfill-mbstring/LICENSE b/vendor/symfony/polyfill-mbstring/LICENSE
deleted file mode 100644
index 4cd8bdd..0000000
--- a/vendor/symfony/polyfill-mbstring/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2015-2019 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.
diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php
deleted file mode 100644
index bce5c4a..0000000
--- a/vendor/symfony/polyfill-mbstring/Mbstring.php
+++ /dev/null
@@ -1,874 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Polyfill\Mbstring;
-
-/**
- * Partial mbstring implementation in PHP, iconv based, UTF-8 centric.
- *
- * Implemented:
- * - mb_chr - Returns a specific character from its Unicode code point
- * - mb_convert_encoding - Convert character encoding
- * - mb_convert_variables - Convert character code in variable(s)
- * - mb_decode_mimeheader - Decode string in MIME header field
- * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED
- * - mb_decode_numericentity - Decode HTML numeric string reference to character
- * - mb_encode_numericentity - Encode character to HTML numeric string reference
- * - mb_convert_case - Perform case folding on a string
- * - mb_detect_encoding - Detect character encoding
- * - mb_get_info - Get internal settings of mbstring
- * - mb_http_input - Detect HTTP input character encoding
- * - mb_http_output - Set/Get HTTP output character encoding
- * - mb_internal_encoding - Set/Get internal character encoding
- * - mb_list_encodings - Returns an array of all supported encodings
- * - mb_ord - Returns the Unicode code point of a character
- * - mb_output_handler - Callback function converts character encoding in output buffer
- * - mb_scrub - Replaces ill-formed byte sequences with substitute characters
- * - mb_strlen - Get string length
- * - mb_strpos - Find position of first occurrence of string in a string
- * - mb_strrpos - Find position of last occurrence of a string in a string
- * - mb_str_split - Convert a string to an array
- * - mb_strtolower - Make a string lowercase
- * - mb_strtoupper - Make a string uppercase
- * - mb_substitute_character - Set/Get substitution character
- * - mb_substr - Get part of string
- * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive
- * - mb_stristr - Finds first occurrence of a string within another, case insensitive
- * - mb_strrchr - Finds the last occurrence of a character in a string within another
- * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive
- * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive
- * - mb_strstr - Finds first occurrence of a string within another
- * - mb_strwidth - Return width of string
- * - mb_substr_count - Count the number of substring occurrences
- *
- * Not implemented:
- * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more)
- * - mb_ereg_* - Regular expression with multibyte support
- * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable
- * - mb_preferred_mime_name - Get MIME charset string
- * - mb_regex_encoding - Returns current encoding for multibyte regex as string
- * - mb_regex_set_options - Set/Get the default options for mbregex functions
- * - mb_send_mail - Send encoded mail
- * - mb_split - Split multibyte string using regular expression
- * - mb_strcut - Get part of string
- * - mb_strimwidth - Get truncated string with specified width
- *
- * @author Nicolas Grekas
- *
- * @internal
- */
-final class Mbstring
-{
- public const MB_CASE_FOLD = \PHP_INT_MAX;
-
- private const CASE_FOLD = [
- ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"],
- ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'],
- ];
-
- private static $encodingList = ['ASCII', 'UTF-8'];
- private static $language = 'neutral';
- private static $internalEncoding = 'UTF-8';
-
- public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
- {
- if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) {
- $fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
- } else {
- $fromEncoding = self::getEncoding($fromEncoding);
- }
-
- $toEncoding = self::getEncoding($toEncoding);
-
- if ('BASE64' === $fromEncoding) {
- $s = base64_decode($s);
- $fromEncoding = $toEncoding;
- }
-
- if ('BASE64' === $toEncoding) {
- return base64_encode($s);
- }
-
- if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) {
- if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) {
- $fromEncoding = 'Windows-1252';
- }
- if ('UTF-8' !== $fromEncoding) {
- $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s);
- }
-
- return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s);
- }
-
- if ('HTML-ENTITIES' === $fromEncoding) {
- $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8');
- $fromEncoding = 'UTF-8';
- }
-
- return iconv($fromEncoding, $toEncoding.'//IGNORE', $s);
- }
-
- public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars)
- {
- $ok = true;
- array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) {
- if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) {
- $ok = false;
- }
- });
-
- return $ok ? $fromEncoding : false;
- }
-
- public static function mb_decode_mimeheader($s)
- {
- return iconv_mime_decode($s, 2, self::$internalEncoding);
- }
-
- public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null)
- {
- trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING);
- }
-
- public static function mb_decode_numericentity($s, $convmap, $encoding = null)
- {
- if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
- trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING);
-
- return null;
- }
-
- if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) {
- return false;
- }
-
- if (null !== $encoding && !\is_scalar($encoding)) {
- trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING);
-
- return ''; // Instead of null (cf. mb_encode_numericentity).
- }
-
- $s = (string) $s;
- if ('' === $s) {
- return '';
- }
-
- $encoding = self::getEncoding($encoding);
-
- if ('UTF-8' === $encoding) {
- $encoding = null;
- if (!preg_match('//u', $s)) {
- $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s);
- }
- } else {
- $s = iconv($encoding, 'UTF-8//IGNORE', $s);
- }
-
- $cnt = floor(\count($convmap) / 4) * 4;
-
- for ($i = 0; $i < $cnt; $i += 4) {
- // collector_decode_htmlnumericentity ignores $convmap[$i + 3]
- $convmap[$i] += $convmap[$i + 2];
- $convmap[$i + 1] += $convmap[$i + 2];
- }
-
- $s = preg_replace_callback('/(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) {
- $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1];
- for ($i = 0; $i < $cnt; $i += 4) {
- if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) {
- return self::mb_chr($c - $convmap[$i + 2]);
- }
- }
-
- return $m[0];
- }, $s);
-
- if (null === $encoding) {
- return $s;
- }
-
- return iconv('UTF-8', $encoding.'//IGNORE', $s);
- }
-
- public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false)
- {
- if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
- trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING);
-
- return null;
- }
-
- if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) {
- return false;
- }
-
- if (null !== $encoding && !\is_scalar($encoding)) {
- trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING);
-
- return null; // Instead of '' (cf. mb_decode_numericentity).
- }
-
- if (null !== $is_hex && !\is_scalar($is_hex)) {
- trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING);
-
- return null;
- }
-
- $s = (string) $s;
- if ('' === $s) {
- return '';
- }
-
- $encoding = self::getEncoding($encoding);
-
- if ('UTF-8' === $encoding) {
- $encoding = null;
- if (!preg_match('//u', $s)) {
- $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s);
- }
- } else {
- $s = iconv($encoding, 'UTF-8//IGNORE', $s);
- }
-
- static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4];
-
- $cnt = floor(\count($convmap) / 4) * 4;
- $i = 0;
- $len = \strlen($s);
- $result = '';
-
- while ($i < $len) {
- $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"];
- $uchr = substr($s, $i, $ulen);
- $i += $ulen;
- $c = self::mb_ord($uchr);
-
- for ($j = 0; $j < $cnt; $j += 4) {
- if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) {
- $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3];
- $result .= $is_hex ? sprintf('%X;', $cOffset) : ''.$cOffset.';';
- continue 2;
- }
- }
- $result .= $uchr;
- }
-
- if (null === $encoding) {
- return $result;
- }
-
- return iconv('UTF-8', $encoding.'//IGNORE', $result);
- }
-
- public static function mb_convert_case($s, $mode, $encoding = null)
- {
- $s = (string) $s;
- if ('' === $s) {
- return '';
- }
-
- $encoding = self::getEncoding($encoding);
-
- if ('UTF-8' === $encoding) {
- $encoding = null;
- if (!preg_match('//u', $s)) {
- $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s);
- }
- } else {
- $s = iconv($encoding, 'UTF-8//IGNORE', $s);
- }
-
- if (\MB_CASE_TITLE == $mode) {
- static $titleRegexp = null;
- if (null === $titleRegexp) {
- $titleRegexp = self::getData('titleCaseRegexp');
- }
- $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s);
- } else {
- if (\MB_CASE_UPPER == $mode) {
- static $upper = null;
- if (null === $upper) {
- $upper = self::getData('upperCase');
- }
- $map = $upper;
- } else {
- if (self::MB_CASE_FOLD === $mode) {
- $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s);
- }
-
- static $lower = null;
- if (null === $lower) {
- $lower = self::getData('lowerCase');
- }
- $map = $lower;
- }
-
- static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4];
-
- $i = 0;
- $len = \strlen($s);
-
- while ($i < $len) {
- $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"];
- $uchr = substr($s, $i, $ulen);
- $i += $ulen;
-
- if (isset($map[$uchr])) {
- $uchr = $map[$uchr];
- $nlen = \strlen($uchr);
-
- if ($nlen == $ulen) {
- $nlen = $i;
- do {
- $s[--$nlen] = $uchr[--$ulen];
- } while ($ulen);
- } else {
- $s = substr_replace($s, $uchr, $i - $ulen, $ulen);
- $len += $nlen - $ulen;
- $i += $nlen - $ulen;
- }
- }
- }
- }
-
- if (null === $encoding) {
- return $s;
- }
-
- return iconv('UTF-8', $encoding.'//IGNORE', $s);
- }
-
- public static function mb_internal_encoding($encoding = null)
- {
- if (null === $encoding) {
- return self::$internalEncoding;
- }
-
- $normalizedEncoding = self::getEncoding($encoding);
-
- if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) {
- self::$internalEncoding = $normalizedEncoding;
-
- return true;
- }
-
- if (80000 > \PHP_VERSION_ID) {
- return false;
- }
-
- throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding));
- }
-
- public static function mb_language($lang = null)
- {
- if (null === $lang) {
- return self::$language;
- }
-
- switch ($normalizedLang = strtolower($lang)) {
- case 'uni':
- case 'neutral':
- self::$language = $normalizedLang;
-
- return true;
- }
-
- if (80000 > \PHP_VERSION_ID) {
- return false;
- }
-
- throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang));
- }
-
- public static function mb_list_encodings()
- {
- return ['UTF-8'];
- }
-
- public static function mb_encoding_aliases($encoding)
- {
- switch (strtoupper($encoding)) {
- case 'UTF8':
- case 'UTF-8':
- return ['utf8'];
- }
-
- return false;
- }
-
- public static function mb_check_encoding($var = null, $encoding = null)
- {
- if (null === $encoding) {
- if (null === $var) {
- return false;
- }
- $encoding = self::$internalEncoding;
- }
-
- return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var);
- }
-
- public static function mb_detect_encoding($str, $encodingList = null, $strict = false)
- {
- if (null === $encodingList) {
- $encodingList = self::$encodingList;
- } else {
- if (!\is_array($encodingList)) {
- $encodingList = array_map('trim', explode(',', $encodingList));
- }
- $encodingList = array_map('strtoupper', $encodingList);
- }
-
- foreach ($encodingList as $enc) {
- switch ($enc) {
- case 'ASCII':
- if (!preg_match('/[\x80-\xFF]/', $str)) {
- return $enc;
- }
- break;
-
- case 'UTF8':
- case 'UTF-8':
- if (preg_match('//u', $str)) {
- return 'UTF-8';
- }
- break;
-
- default:
- if (0 === strncmp($enc, 'ISO-8859-', 9)) {
- return $enc;
- }
- }
- }
-
- return false;
- }
-
- public static function mb_detect_order($encodingList = null)
- {
- if (null === $encodingList) {
- return self::$encodingList;
- }
-
- if (!\is_array($encodingList)) {
- $encodingList = array_map('trim', explode(',', $encodingList));
- }
- $encodingList = array_map('strtoupper', $encodingList);
-
- foreach ($encodingList as $enc) {
- switch ($enc) {
- default:
- if (strncmp($enc, 'ISO-8859-', 9)) {
- return false;
- }
- // no break
- case 'ASCII':
- case 'UTF8':
- case 'UTF-8':
- }
- }
-
- self::$encodingList = $encodingList;
-
- return true;
- }
-
- public static function mb_strlen($s, $encoding = null)
- {
- $encoding = self::getEncoding($encoding);
- if ('CP850' === $encoding || 'ASCII' === $encoding) {
- return \strlen($s);
- }
-
- return @iconv_strlen($s, $encoding);
- }
-
- public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null)
- {
- $encoding = self::getEncoding($encoding);
- if ('CP850' === $encoding || 'ASCII' === $encoding) {
- return strpos($haystack, $needle, $offset);
- }
-
- $needle = (string) $needle;
- if ('' === $needle) {
- if (80000 > \PHP_VERSION_ID) {
- trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING);
-
- return false;
- }
-
- return 0;
- }
-
- return iconv_strpos($haystack, $needle, $offset, $encoding);
- }
-
- public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null)
- {
- $encoding = self::getEncoding($encoding);
- if ('CP850' === $encoding || 'ASCII' === $encoding) {
- return strrpos($haystack, $needle, $offset);
- }
-
- if ($offset != (int) $offset) {
- $offset = 0;
- } elseif ($offset = (int) $offset) {
- if ($offset < 0) {
- if (0 > $offset += self::mb_strlen($needle)) {
- $haystack = self::mb_substr($haystack, 0, $offset, $encoding);
- }
- $offset = 0;
- } else {
- $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding);
- }
- }
-
- $pos = '' !== $needle || 80000 > \PHP_VERSION_ID
- ? iconv_strrpos($haystack, $needle, $encoding)
- : self::mb_strlen($haystack, $encoding);
-
- return false !== $pos ? $offset + $pos : false;
- }
-
- public static function mb_str_split($string, $split_length = 1, $encoding = null)
- {
- if (null !== $string && !\is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) {
- trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING);
-
- return null;
- }
-
- if (1 > $split_length = (int) $split_length) {
- if (80000 > \PHP_VERSION_ID) {
- trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING);
-
- return false;
- }
-
- throw new \ValueError('Argument #2 ($length) must be greater than 0');
- }
-
- if (null === $encoding) {
- $encoding = mb_internal_encoding();
- }
-
- if ('UTF-8' === $encoding = self::getEncoding($encoding)) {
- $rx = '/(';
- while (65535 < $split_length) {
- $rx .= '.{65535}';
- $split_length -= 65535;
- }
- $rx .= '.{'.$split_length.'})/us';
-
- return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY);
- }
-
- $result = [];
- $length = mb_strlen($string, $encoding);
-
- for ($i = 0; $i < $length; $i += $split_length) {
- $result[] = mb_substr($string, $i, $split_length, $encoding);
- }
-
- return $result;
- }
-
- public static function mb_strtolower($s, $encoding = null)
- {
- return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding);
- }
-
- public static function mb_strtoupper($s, $encoding = null)
- {
- return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding);
- }
-
- public static function mb_substitute_character($c = null)
- {
- if (null === $c) {
- return 'none';
- }
- if (0 === strcasecmp($c, 'none')) {
- return true;
- }
- if (80000 > \PHP_VERSION_ID) {
- return false;
- }
- if (\is_int($c) || 'long' === $c || 'entity' === $c) {
- return false;
- }
-
- throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint');
- }
-
- public static function mb_substr($s, $start, $length = null, $encoding = null)
- {
- $encoding = self::getEncoding($encoding);
- if ('CP850' === $encoding || 'ASCII' === $encoding) {
- return (string) substr($s, $start, null === $length ? 2147483647 : $length);
- }
-
- if ($start < 0) {
- $start = iconv_strlen($s, $encoding) + $start;
- if ($start < 0) {
- $start = 0;
- }
- }
-
- if (null === $length) {
- $length = 2147483647;
- } elseif ($length < 0) {
- $length = iconv_strlen($s, $encoding) + $length - $start;
- if ($length < 0) {
- return '';
- }
- }
-
- return (string) iconv_substr($s, $start, $length, $encoding);
- }
-
- public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null)
- {
- $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding);
- $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding);
-
- return self::mb_strpos($haystack, $needle, $offset, $encoding);
- }
-
- public static function mb_stristr($haystack, $needle, $part = false, $encoding = null)
- {
- $pos = self::mb_stripos($haystack, $needle, 0, $encoding);
-
- return self::getSubpart($pos, $part, $haystack, $encoding);
- }
-
- public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null)
- {
- $encoding = self::getEncoding($encoding);
- if ('CP850' === $encoding || 'ASCII' === $encoding) {
- $pos = strrpos($haystack, $needle);
- } else {
- $needle = self::mb_substr($needle, 0, 1, $encoding);
- $pos = iconv_strrpos($haystack, $needle, $encoding);
- }
-
- return self::getSubpart($pos, $part, $haystack, $encoding);
- }
-
- public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null)
- {
- $needle = self::mb_substr($needle, 0, 1, $encoding);
- $pos = self::mb_strripos($haystack, $needle, $encoding);
-
- return self::getSubpart($pos, $part, $haystack, $encoding);
- }
-
- public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null)
- {
- $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding);
- $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding);
-
- return self::mb_strrpos($haystack, $needle, $offset, $encoding);
- }
-
- public static function mb_strstr($haystack, $needle, $part = false, $encoding = null)
- {
- $pos = strpos($haystack, $needle);
- if (false === $pos) {
- return false;
- }
- if ($part) {
- return substr($haystack, 0, $pos);
- }
-
- return substr($haystack, $pos);
- }
-
- public static function mb_get_info($type = 'all')
- {
- $info = [
- 'internal_encoding' => self::$internalEncoding,
- 'http_output' => 'pass',
- 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)',
- 'func_overload' => 0,
- 'func_overload_list' => 'no overload',
- 'mail_charset' => 'UTF-8',
- 'mail_header_encoding' => 'BASE64',
- 'mail_body_encoding' => 'BASE64',
- 'illegal_chars' => 0,
- 'encoding_translation' => 'Off',
- 'language' => self::$language,
- 'detect_order' => self::$encodingList,
- 'substitute_character' => 'none',
- 'strict_detection' => 'Off',
- ];
-
- if ('all' === $type) {
- return $info;
- }
- if (isset($info[$type])) {
- return $info[$type];
- }
-
- return false;
- }
-
- public static function mb_http_input($type = '')
- {
- return false;
- }
-
- public static function mb_http_output($encoding = null)
- {
- return null !== $encoding ? 'pass' === $encoding : 'pass';
- }
-
- public static function mb_strwidth($s, $encoding = null)
- {
- $encoding = self::getEncoding($encoding);
-
- if ('UTF-8' !== $encoding) {
- $s = iconv($encoding, 'UTF-8//IGNORE', $s);
- }
-
- $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide);
-
- return ($wide << 1) + iconv_strlen($s, 'UTF-8');
- }
-
- public static function mb_substr_count($haystack, $needle, $encoding = null)
- {
- return substr_count($haystack, $needle);
- }
-
- public static function mb_output_handler($contents, $status)
- {
- return $contents;
- }
-
- public static function mb_chr($code, $encoding = null)
- {
- if (0x80 > $code %= 0x200000) {
- $s = \chr($code);
- } elseif (0x800 > $code) {
- $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F);
- } elseif (0x10000 > $code) {
- $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F);
- } else {
- $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F);
- }
-
- if ('UTF-8' !== $encoding = self::getEncoding($encoding)) {
- $s = mb_convert_encoding($s, $encoding, 'UTF-8');
- }
-
- return $s;
- }
-
- public static function mb_ord($s, $encoding = null)
- {
- if ('UTF-8' !== $encoding = self::getEncoding($encoding)) {
- $s = mb_convert_encoding($s, 'UTF-8', $encoding);
- }
-
- if (1 === \strlen($s)) {
- return \ord($s);
- }
-
- $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0;
- if (0xF0 <= $code) {
- return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80;
- }
- if (0xE0 <= $code) {
- return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80;
- }
- if (0xC0 <= $code) {
- return (($code - 0xC0) << 6) + $s[2] - 0x80;
- }
-
- return $code;
- }
-
- private static function getSubpart($pos, $part, $haystack, $encoding)
- {
- if (false === $pos) {
- return false;
- }
- if ($part) {
- return self::mb_substr($haystack, 0, $pos, $encoding);
- }
-
- return self::mb_substr($haystack, $pos, null, $encoding);
- }
-
- private static function html_encoding_callback(array $m)
- {
- $i = 1;
- $entities = '';
- $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8'));
-
- while (isset($m[$i])) {
- if (0x80 > $m[$i]) {
- $entities .= \chr($m[$i++]);
- continue;
- }
- if (0xF0 <= $m[$i]) {
- $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80;
- } elseif (0xE0 <= $m[$i]) {
- $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80;
- } else {
- $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80;
- }
-
- $entities .= ''.$c.';';
- }
-
- return $entities;
- }
-
- private static function title_case(array $s)
- {
- return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8');
- }
-
- private static function getData($file)
- {
- if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) {
- return require $file;
- }
-
- return false;
- }
-
- private static function getEncoding($encoding)
- {
- if (null === $encoding) {
- return self::$internalEncoding;
- }
-
- if ('UTF-8' === $encoding) {
- return 'UTF-8';
- }
-
- $encoding = strtoupper($encoding);
-
- if ('8BIT' === $encoding || 'BINARY' === $encoding) {
- return 'CP850';
- }
-
- if ('UTF8' === $encoding) {
- return 'UTF-8';
- }
-
- return $encoding;
- }
-}
diff --git a/vendor/symfony/polyfill-mbstring/README.md b/vendor/symfony/polyfill-mbstring/README.md
deleted file mode 100644
index 478b40d..0000000
--- a/vendor/symfony/polyfill-mbstring/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-Symfony Polyfill / Mbstring
-===========================
-
-This component provides a partial, native PHP implementation for the
-[Mbstring](https://php.net/mbstring) extension.
-
-More information can be found in the
-[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
-
-License
-=======
-
-This library is released under the [MIT license](LICENSE).
diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php
deleted file mode 100644
index fac60b0..0000000
--- a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php
+++ /dev/null
@@ -1,1397 +0,0 @@
- 'a',
- 'B' => 'b',
- 'C' => 'c',
- 'D' => 'd',
- 'E' => 'e',
- 'F' => 'f',
- 'G' => 'g',
- 'H' => 'h',
- 'I' => 'i',
- 'J' => 'j',
- 'K' => 'k',
- 'L' => 'l',
- 'M' => 'm',
- 'N' => 'n',
- 'O' => 'o',
- 'P' => 'p',
- 'Q' => 'q',
- 'R' => 'r',
- 'S' => 's',
- 'T' => 't',
- 'U' => 'u',
- 'V' => 'v',
- 'W' => 'w',
- 'X' => 'x',
- 'Y' => 'y',
- 'Z' => 'z',
- 'À' => 'à',
- 'Á' => 'á',
- 'Â' => 'â',
- 'Ã' => 'ã',
- 'Ä' => 'ä',
- 'Å' => 'å',
- 'Æ' => 'æ',
- 'Ç' => 'ç',
- 'È' => 'è',
- 'É' => 'é',
- 'Ê' => 'ê',
- 'Ë' => 'ë',
- 'Ì' => 'ì',
- 'Í' => 'í',
- 'Î' => 'î',
- 'Ï' => 'ï',
- 'Ð' => 'ð',
- 'Ñ' => 'ñ',
- 'Ò' => 'ò',
- 'Ó' => 'ó',
- 'Ô' => 'ô',
- 'Õ' => 'õ',
- 'Ö' => 'ö',
- 'Ø' => 'ø',
- 'Ù' => 'ù',
- 'Ú' => 'ú',
- 'Û' => 'û',
- 'Ü' => 'ü',
- 'Ý' => 'ý',
- 'Þ' => 'þ',
- 'Ā' => 'ā',
- 'Ă' => 'ă',
- 'Ą' => 'ą',
- 'Ć' => 'ć',
- 'Ĉ' => 'ĉ',
- 'Ċ' => 'ċ',
- 'Č' => 'č',
- 'Ď' => 'ď',
- 'Đ' => 'đ',
- 'Ē' => 'ē',
- 'Ĕ' => 'ĕ',
- 'Ė' => 'ė',
- 'Ę' => 'ę',
- 'Ě' => 'ě',
- 'Ĝ' => 'ĝ',
- 'Ğ' => 'ğ',
- 'Ġ' => 'ġ',
- 'Ģ' => 'ģ',
- 'Ĥ' => 'ĥ',
- 'Ħ' => 'ħ',
- 'Ĩ' => 'ĩ',
- 'Ī' => 'ī',
- 'Ĭ' => 'ĭ',
- 'Į' => 'į',
- 'İ' => 'i̇',
- 'IJ' => 'ij',
- 'Ĵ' => 'ĵ',
- 'Ķ' => 'ķ',
- 'Ĺ' => 'ĺ',
- 'Ļ' => 'ļ',
- 'Ľ' => 'ľ',
- 'Ŀ' => 'ŀ',
- 'Ł' => 'ł',
- 'Ń' => 'ń',
- 'Ņ' => 'ņ',
- 'Ň' => 'ň',
- 'Ŋ' => 'ŋ',
- 'Ō' => 'ō',
- 'Ŏ' => 'ŏ',
- 'Ő' => 'ő',
- 'Œ' => 'œ',
- 'Ŕ' => 'ŕ',
- 'Ŗ' => 'ŗ',
- 'Ř' => 'ř',
- 'Ś' => 'ś',
- 'Ŝ' => 'ŝ',
- 'Ş' => 'ş',
- 'Š' => 'š',
- 'Ţ' => 'ţ',
- 'Ť' => 'ť',
- 'Ŧ' => 'ŧ',
- 'Ũ' => 'ũ',
- 'Ū' => 'ū',
- 'Ŭ' => 'ŭ',
- 'Ů' => 'ů',
- 'Ű' => 'ű',
- 'Ų' => 'ų',
- 'Ŵ' => 'ŵ',
- 'Ŷ' => 'ŷ',
- 'Ÿ' => 'ÿ',
- 'Ź' => 'ź',
- 'Ż' => 'ż',
- 'Ž' => 'ž',
- 'Ɓ' => 'ɓ',
- 'Ƃ' => 'ƃ',
- 'Ƅ' => 'ƅ',
- 'Ɔ' => 'ɔ',
- 'Ƈ' => 'ƈ',
- 'Ɖ' => 'ɖ',
- 'Ɗ' => 'ɗ',
- 'Ƌ' => 'ƌ',
- 'Ǝ' => 'ǝ',
- 'Ə' => 'ə',
- 'Ɛ' => 'ɛ',
- 'Ƒ' => 'ƒ',
- 'Ɠ' => 'ɠ',
- 'Ɣ' => 'ɣ',
- 'Ɩ' => 'ɩ',
- 'Ɨ' => 'ɨ',
- 'Ƙ' => 'ƙ',
- 'Ɯ' => 'ɯ',
- 'Ɲ' => 'ɲ',
- 'Ɵ' => 'ɵ',
- 'Ơ' => 'ơ',
- 'Ƣ' => 'ƣ',
- 'Ƥ' => 'ƥ',
- 'Ʀ' => 'ʀ',
- 'Ƨ' => 'ƨ',
- 'Ʃ' => 'ʃ',
- 'Ƭ' => 'ƭ',
- 'Ʈ' => 'ʈ',
- 'Ư' => 'ư',
- 'Ʊ' => 'ʊ',
- 'Ʋ' => 'ʋ',
- 'Ƴ' => 'ƴ',
- 'Ƶ' => 'ƶ',
- 'Ʒ' => 'ʒ',
- 'Ƹ' => 'ƹ',
- 'Ƽ' => 'ƽ',
- 'DŽ' => 'dž',
- 'Dž' => 'dž',
- 'LJ' => 'lj',
- 'Lj' => 'lj',
- 'NJ' => 'nj',
- 'Nj' => 'nj',
- 'Ǎ' => 'ǎ',
- 'Ǐ' => 'ǐ',
- 'Ǒ' => 'ǒ',
- 'Ǔ' => 'ǔ',
- 'Ǖ' => 'ǖ',
- 'Ǘ' => 'ǘ',
- 'Ǚ' => 'ǚ',
- 'Ǜ' => 'ǜ',
- 'Ǟ' => 'ǟ',
- 'Ǡ' => 'ǡ',
- 'Ǣ' => 'ǣ',
- 'Ǥ' => 'ǥ',
- 'Ǧ' => 'ǧ',
- 'Ǩ' => 'ǩ',
- 'Ǫ' => 'ǫ',
- 'Ǭ' => 'ǭ',
- 'Ǯ' => 'ǯ',
- 'DZ' => 'dz',
- 'Dz' => 'dz',
- 'Ǵ' => 'ǵ',
- 'Ƕ' => 'ƕ',
- 'Ƿ' => 'ƿ',
- 'Ǹ' => 'ǹ',
- 'Ǻ' => 'ǻ',
- 'Ǽ' => 'ǽ',
- 'Ǿ' => 'ǿ',
- 'Ȁ' => 'ȁ',
- 'Ȃ' => 'ȃ',
- 'Ȅ' => 'ȅ',
- 'Ȇ' => 'ȇ',
- 'Ȉ' => 'ȉ',
- 'Ȋ' => 'ȋ',
- 'Ȍ' => 'ȍ',
- 'Ȏ' => 'ȏ',
- 'Ȑ' => 'ȑ',
- 'Ȓ' => 'ȓ',
- 'Ȕ' => 'ȕ',
- 'Ȗ' => 'ȗ',
- 'Ș' => 'ș',
- 'Ț' => 'ț',
- 'Ȝ' => 'ȝ',
- 'Ȟ' => 'ȟ',
- 'Ƞ' => 'ƞ',
- 'Ȣ' => 'ȣ',
- 'Ȥ' => 'ȥ',
- 'Ȧ' => 'ȧ',
- 'Ȩ' => 'ȩ',
- 'Ȫ' => 'ȫ',
- 'Ȭ' => 'ȭ',
- 'Ȯ' => 'ȯ',
- 'Ȱ' => 'ȱ',
- 'Ȳ' => 'ȳ',
- 'Ⱥ' => 'ⱥ',
- 'Ȼ' => 'ȼ',
- 'Ƚ' => 'ƚ',
- 'Ⱦ' => 'ⱦ',
- 'Ɂ' => 'ɂ',
- 'Ƀ' => 'ƀ',
- 'Ʉ' => 'ʉ',
- 'Ʌ' => 'ʌ',
- 'Ɇ' => 'ɇ',
- 'Ɉ' => 'ɉ',
- 'Ɋ' => 'ɋ',
- 'Ɍ' => 'ɍ',
- 'Ɏ' => 'ɏ',
- 'Ͱ' => 'ͱ',
- 'Ͳ' => 'ͳ',
- 'Ͷ' => 'ͷ',
- 'Ϳ' => 'ϳ',
- 'Ά' => 'ά',
- 'Έ' => 'έ',
- 'Ή' => 'ή',
- 'Ί' => 'ί',
- 'Ό' => 'ό',
- 'Ύ' => 'ύ',
- 'Ώ' => 'ώ',
- 'Α' => 'α',
- 'Β' => 'β',
- 'Γ' => 'γ',
- 'Δ' => 'δ',
- 'Ε' => 'ε',
- 'Ζ' => 'ζ',
- 'Η' => 'η',
- 'Θ' => 'θ',
- 'Ι' => 'ι',
- 'Κ' => 'κ',
- 'Λ' => 'λ',
- 'Μ' => 'μ',
- 'Ν' => 'ν',
- 'Ξ' => 'ξ',
- 'Ο' => 'ο',
- 'Π' => 'π',
- 'Ρ' => 'ρ',
- 'Σ' => 'σ',
- 'Τ' => 'τ',
- 'Υ' => 'υ',
- 'Φ' => 'φ',
- 'Χ' => 'χ',
- 'Ψ' => 'ψ',
- 'Ω' => 'ω',
- 'Ϊ' => 'ϊ',
- 'Ϋ' => 'ϋ',
- 'Ϗ' => 'ϗ',
- 'Ϙ' => 'ϙ',
- 'Ϛ' => 'ϛ',
- 'Ϝ' => 'ϝ',
- 'Ϟ' => 'ϟ',
- 'Ϡ' => 'ϡ',
- 'Ϣ' => 'ϣ',
- 'Ϥ' => 'ϥ',
- 'Ϧ' => 'ϧ',
- 'Ϩ' => 'ϩ',
- 'Ϫ' => 'ϫ',
- 'Ϭ' => 'ϭ',
- 'Ϯ' => 'ϯ',
- 'ϴ' => 'θ',
- 'Ϸ' => 'ϸ',
- 'Ϲ' => 'ϲ',
- 'Ϻ' => 'ϻ',
- 'Ͻ' => 'ͻ',
- 'Ͼ' => 'ͼ',
- 'Ͽ' => 'ͽ',
- 'Ѐ' => 'ѐ',
- 'Ё' => 'ё',
- 'Ђ' => 'ђ',
- 'Ѓ' => 'ѓ',
- 'Є' => 'є',
- 'Ѕ' => 'ѕ',
- 'І' => 'і',
- 'Ї' => 'ї',
- 'Ј' => 'ј',
- 'Љ' => 'љ',
- 'Њ' => 'њ',
- 'Ћ' => 'ћ',
- 'Ќ' => 'ќ',
- 'Ѝ' => 'ѝ',
- 'Ў' => 'ў',
- 'Џ' => 'џ',
- 'А' => 'а',
- 'Б' => 'б',
- 'В' => 'в',
- 'Г' => 'г',
- 'Д' => 'д',
- 'Е' => 'е',
- 'Ж' => 'ж',
- 'З' => 'з',
- 'И' => 'и',
- 'Й' => 'й',
- 'К' => 'к',
- 'Л' => 'л',
- 'М' => 'м',
- 'Н' => 'н',
- 'О' => 'о',
- 'П' => 'п',
- 'Р' => 'р',
- 'С' => 'с',
- 'Т' => 'т',
- 'У' => 'у',
- 'Ф' => 'ф',
- 'Х' => 'х',
- 'Ц' => 'ц',
- 'Ч' => 'ч',
- 'Ш' => 'ш',
- 'Щ' => 'щ',
- 'Ъ' => 'ъ',
- 'Ы' => 'ы',
- 'Ь' => 'ь',
- 'Э' => 'э',
- 'Ю' => 'ю',
- 'Я' => 'я',
- 'Ѡ' => 'ѡ',
- 'Ѣ' => 'ѣ',
- 'Ѥ' => 'ѥ',
- 'Ѧ' => 'ѧ',
- 'Ѩ' => 'ѩ',
- 'Ѫ' => 'ѫ',
- 'Ѭ' => 'ѭ',
- 'Ѯ' => 'ѯ',
- 'Ѱ' => 'ѱ',
- 'Ѳ' => 'ѳ',
- 'Ѵ' => 'ѵ',
- 'Ѷ' => 'ѷ',
- 'Ѹ' => 'ѹ',
- 'Ѻ' => 'ѻ',
- 'Ѽ' => 'ѽ',
- 'Ѿ' => 'ѿ',
- 'Ҁ' => 'ҁ',
- 'Ҋ' => 'ҋ',
- 'Ҍ' => 'ҍ',
- 'Ҏ' => 'ҏ',
- 'Ґ' => 'ґ',
- 'Ғ' => 'ғ',
- 'Ҕ' => 'ҕ',
- 'Җ' => 'җ',
- 'Ҙ' => 'ҙ',
- 'Қ' => 'қ',
- 'Ҝ' => 'ҝ',
- 'Ҟ' => 'ҟ',
- 'Ҡ' => 'ҡ',
- 'Ң' => 'ң',
- 'Ҥ' => 'ҥ',
- 'Ҧ' => 'ҧ',
- 'Ҩ' => 'ҩ',
- 'Ҫ' => 'ҫ',
- 'Ҭ' => 'ҭ',
- 'Ү' => 'ү',
- 'Ұ' => 'ұ',
- 'Ҳ' => 'ҳ',
- 'Ҵ' => 'ҵ',
- 'Ҷ' => 'ҷ',
- 'Ҹ' => 'ҹ',
- 'Һ' => 'һ',
- 'Ҽ' => 'ҽ',
- 'Ҿ' => 'ҿ',
- 'Ӏ' => 'ӏ',
- 'Ӂ' => 'ӂ',
- 'Ӄ' => 'ӄ',
- 'Ӆ' => 'ӆ',
- 'Ӈ' => 'ӈ',
- 'Ӊ' => 'ӊ',
- 'Ӌ' => 'ӌ',
- 'Ӎ' => 'ӎ',
- 'Ӑ' => 'ӑ',
- 'Ӓ' => 'ӓ',
- 'Ӕ' => 'ӕ',
- 'Ӗ' => 'ӗ',
- 'Ә' => 'ә',
- 'Ӛ' => 'ӛ',
- 'Ӝ' => 'ӝ',
- 'Ӟ' => 'ӟ',
- 'Ӡ' => 'ӡ',
- 'Ӣ' => 'ӣ',
- 'Ӥ' => 'ӥ',
- 'Ӧ' => 'ӧ',
- 'Ө' => 'ө',
- 'Ӫ' => 'ӫ',
- 'Ӭ' => 'ӭ',
- 'Ӯ' => 'ӯ',
- 'Ӱ' => 'ӱ',
- 'Ӳ' => 'ӳ',
- 'Ӵ' => 'ӵ',
- 'Ӷ' => 'ӷ',
- 'Ӹ' => 'ӹ',
- 'Ӻ' => 'ӻ',
- 'Ӽ' => 'ӽ',
- 'Ӿ' => 'ӿ',
- 'Ԁ' => 'ԁ',
- 'Ԃ' => 'ԃ',
- 'Ԅ' => 'ԅ',
- 'Ԇ' => 'ԇ',
- 'Ԉ' => 'ԉ',
- 'Ԋ' => 'ԋ',
- 'Ԍ' => 'ԍ',
- 'Ԏ' => 'ԏ',
- 'Ԑ' => 'ԑ',
- 'Ԓ' => 'ԓ',
- 'Ԕ' => 'ԕ',
- 'Ԗ' => 'ԗ',
- 'Ԙ' => 'ԙ',
- 'Ԛ' => 'ԛ',
- 'Ԝ' => 'ԝ',
- 'Ԟ' => 'ԟ',
- 'Ԡ' => 'ԡ',
- 'Ԣ' => 'ԣ',
- 'Ԥ' => 'ԥ',
- 'Ԧ' => 'ԧ',
- 'Ԩ' => 'ԩ',
- 'Ԫ' => 'ԫ',
- 'Ԭ' => 'ԭ',
- 'Ԯ' => 'ԯ',
- 'Ա' => 'ա',
- 'Բ' => 'բ',
- 'Գ' => 'գ',
- 'Դ' => 'դ',
- 'Ե' => 'ե',
- 'Զ' => 'զ',
- 'Է' => 'է',
- 'Ը' => 'ը',
- 'Թ' => 'թ',
- 'Ժ' => 'ժ',
- 'Ի' => 'ի',
- 'Լ' => 'լ',
- 'Խ' => 'խ',
- 'Ծ' => 'ծ',
- 'Կ' => 'կ',
- 'Հ' => 'հ',
- 'Ձ' => 'ձ',
- 'Ղ' => 'ղ',
- 'Ճ' => 'ճ',
- 'Մ' => 'մ',
- 'Յ' => 'յ',
- 'Ն' => 'ն',
- 'Շ' => 'շ',
- 'Ո' => 'ո',
- 'Չ' => 'չ',
- 'Պ' => 'պ',
- 'Ջ' => 'ջ',
- 'Ռ' => 'ռ',
- 'Ս' => 'ս',
- 'Վ' => 'վ',
- 'Տ' => 'տ',
- 'Ր' => 'ր',
- 'Ց' => 'ց',
- 'Ւ' => 'ւ',
- 'Փ' => 'փ',
- 'Ք' => 'ք',
- 'Օ' => 'օ',
- 'Ֆ' => 'ֆ',
- 'Ⴀ' => 'ⴀ',
- 'Ⴁ' => 'ⴁ',
- 'Ⴂ' => 'ⴂ',
- 'Ⴃ' => 'ⴃ',
- 'Ⴄ' => 'ⴄ',
- 'Ⴅ' => 'ⴅ',
- 'Ⴆ' => 'ⴆ',
- 'Ⴇ' => 'ⴇ',
- 'Ⴈ' => 'ⴈ',
- 'Ⴉ' => 'ⴉ',
- 'Ⴊ' => 'ⴊ',
- 'Ⴋ' => 'ⴋ',
- 'Ⴌ' => 'ⴌ',
- 'Ⴍ' => 'ⴍ',
- 'Ⴎ' => 'ⴎ',
- 'Ⴏ' => 'ⴏ',
- 'Ⴐ' => 'ⴐ',
- 'Ⴑ' => 'ⴑ',
- 'Ⴒ' => 'ⴒ',
- 'Ⴓ' => 'ⴓ',
- 'Ⴔ' => 'ⴔ',
- 'Ⴕ' => 'ⴕ',
- 'Ⴖ' => 'ⴖ',
- 'Ⴗ' => 'ⴗ',
- 'Ⴘ' => 'ⴘ',
- 'Ⴙ' => 'ⴙ',
- 'Ⴚ' => 'ⴚ',
- 'Ⴛ' => 'ⴛ',
- 'Ⴜ' => 'ⴜ',
- 'Ⴝ' => 'ⴝ',
- 'Ⴞ' => 'ⴞ',
- 'Ⴟ' => 'ⴟ',
- 'Ⴠ' => 'ⴠ',
- 'Ⴡ' => 'ⴡ',
- 'Ⴢ' => 'ⴢ',
- 'Ⴣ' => 'ⴣ',
- 'Ⴤ' => 'ⴤ',
- 'Ⴥ' => 'ⴥ',
- 'Ⴧ' => 'ⴧ',
- 'Ⴭ' => 'ⴭ',
- 'Ꭰ' => 'ꭰ',
- 'Ꭱ' => 'ꭱ',
- 'Ꭲ' => 'ꭲ',
- 'Ꭳ' => 'ꭳ',
- 'Ꭴ' => 'ꭴ',
- 'Ꭵ' => 'ꭵ',
- 'Ꭶ' => 'ꭶ',
- 'Ꭷ' => 'ꭷ',
- 'Ꭸ' => 'ꭸ',
- 'Ꭹ' => 'ꭹ',
- 'Ꭺ' => 'ꭺ',
- 'Ꭻ' => 'ꭻ',
- 'Ꭼ' => 'ꭼ',
- 'Ꭽ' => 'ꭽ',
- 'Ꭾ' => 'ꭾ',
- 'Ꭿ' => 'ꭿ',
- 'Ꮀ' => 'ꮀ',
- 'Ꮁ' => 'ꮁ',
- 'Ꮂ' => 'ꮂ',
- 'Ꮃ' => 'ꮃ',
- 'Ꮄ' => 'ꮄ',
- 'Ꮅ' => 'ꮅ',
- 'Ꮆ' => 'ꮆ',
- 'Ꮇ' => 'ꮇ',
- 'Ꮈ' => 'ꮈ',
- 'Ꮉ' => 'ꮉ',
- 'Ꮊ' => 'ꮊ',
- 'Ꮋ' => 'ꮋ',
- 'Ꮌ' => 'ꮌ',
- 'Ꮍ' => 'ꮍ',
- 'Ꮎ' => 'ꮎ',
- 'Ꮏ' => 'ꮏ',
- 'Ꮐ' => 'ꮐ',
- 'Ꮑ' => 'ꮑ',
- 'Ꮒ' => 'ꮒ',
- 'Ꮓ' => 'ꮓ',
- 'Ꮔ' => 'ꮔ',
- 'Ꮕ' => 'ꮕ',
- 'Ꮖ' => 'ꮖ',
- 'Ꮗ' => 'ꮗ',
- 'Ꮘ' => 'ꮘ',
- 'Ꮙ' => 'ꮙ',
- 'Ꮚ' => 'ꮚ',
- 'Ꮛ' => 'ꮛ',
- 'Ꮜ' => 'ꮜ',
- 'Ꮝ' => 'ꮝ',
- 'Ꮞ' => 'ꮞ',
- 'Ꮟ' => 'ꮟ',
- 'Ꮠ' => 'ꮠ',
- 'Ꮡ' => 'ꮡ',
- 'Ꮢ' => 'ꮢ',
- 'Ꮣ' => 'ꮣ',
- 'Ꮤ' => 'ꮤ',
- 'Ꮥ' => 'ꮥ',
- 'Ꮦ' => 'ꮦ',
- 'Ꮧ' => 'ꮧ',
- 'Ꮨ' => 'ꮨ',
- 'Ꮩ' => 'ꮩ',
- 'Ꮪ' => 'ꮪ',
- 'Ꮫ' => 'ꮫ',
- 'Ꮬ' => 'ꮬ',
- 'Ꮭ' => 'ꮭ',
- 'Ꮮ' => 'ꮮ',
- 'Ꮯ' => 'ꮯ',
- 'Ꮰ' => 'ꮰ',
- 'Ꮱ' => 'ꮱ',
- 'Ꮲ' => 'ꮲ',
- 'Ꮳ' => 'ꮳ',
- 'Ꮴ' => 'ꮴ',
- 'Ꮵ' => 'ꮵ',
- 'Ꮶ' => 'ꮶ',
- 'Ꮷ' => 'ꮷ',
- 'Ꮸ' => 'ꮸ',
- 'Ꮹ' => 'ꮹ',
- 'Ꮺ' => 'ꮺ',
- 'Ꮻ' => 'ꮻ',
- 'Ꮼ' => 'ꮼ',
- 'Ꮽ' => 'ꮽ',
- 'Ꮾ' => 'ꮾ',
- 'Ꮿ' => 'ꮿ',
- 'Ᏸ' => 'ᏸ',
- 'Ᏹ' => 'ᏹ',
- 'Ᏺ' => 'ᏺ',
- 'Ᏻ' => 'ᏻ',
- 'Ᏼ' => 'ᏼ',
- 'Ᏽ' => 'ᏽ',
- 'Ა' => 'ა',
- 'Ბ' => 'ბ',
- 'Გ' => 'გ',
- 'Დ' => 'დ',
- 'Ე' => 'ე',
- 'Ვ' => 'ვ',
- 'Ზ' => 'ზ',
- 'Თ' => 'თ',
- 'Ი' => 'ი',
- 'Კ' => 'კ',
- 'Ლ' => 'ლ',
- 'Მ' => 'მ',
- 'Ნ' => 'ნ',
- 'Ო' => 'ო',
- 'Პ' => 'პ',
- 'Ჟ' => 'ჟ',
- 'Რ' => 'რ',
- 'Ს' => 'ს',
- 'Ტ' => 'ტ',
- 'Უ' => 'უ',
- 'Ფ' => 'ფ',
- 'Ქ' => 'ქ',
- 'Ღ' => 'ღ',
- 'Ყ' => 'ყ',
- 'Შ' => 'შ',
- 'Ჩ' => 'ჩ',
- 'Ც' => 'ც',
- 'Ძ' => 'ძ',
- 'Წ' => 'წ',
- 'Ჭ' => 'ჭ',
- 'Ხ' => 'ხ',
- 'Ჯ' => 'ჯ',
- 'Ჰ' => 'ჰ',
- 'Ჱ' => 'ჱ',
- 'Ჲ' => 'ჲ',
- 'Ჳ' => 'ჳ',
- 'Ჴ' => 'ჴ',
- 'Ჵ' => 'ჵ',
- 'Ჶ' => 'ჶ',
- 'Ჷ' => 'ჷ',
- 'Ჸ' => 'ჸ',
- 'Ჹ' => 'ჹ',
- 'Ჺ' => 'ჺ',
- 'Ჽ' => 'ჽ',
- 'Ჾ' => 'ჾ',
- 'Ჿ' => 'ჿ',
- 'Ḁ' => 'ḁ',
- 'Ḃ' => 'ḃ',
- 'Ḅ' => 'ḅ',
- 'Ḇ' => 'ḇ',
- 'Ḉ' => 'ḉ',
- 'Ḋ' => 'ḋ',
- 'Ḍ' => 'ḍ',
- 'Ḏ' => 'ḏ',
- 'Ḑ' => 'ḑ',
- 'Ḓ' => 'ḓ',
- 'Ḕ' => 'ḕ',
- 'Ḗ' => 'ḗ',
- 'Ḙ' => 'ḙ',
- 'Ḛ' => 'ḛ',
- 'Ḝ' => 'ḝ',
- 'Ḟ' => 'ḟ',
- 'Ḡ' => 'ḡ',
- 'Ḣ' => 'ḣ',
- 'Ḥ' => 'ḥ',
- 'Ḧ' => 'ḧ',
- 'Ḩ' => 'ḩ',
- 'Ḫ' => 'ḫ',
- 'Ḭ' => 'ḭ',
- 'Ḯ' => 'ḯ',
- 'Ḱ' => 'ḱ',
- 'Ḳ' => 'ḳ',
- 'Ḵ' => 'ḵ',
- 'Ḷ' => 'ḷ',
- 'Ḹ' => 'ḹ',
- 'Ḻ' => 'ḻ',
- 'Ḽ' => 'ḽ',
- 'Ḿ' => 'ḿ',
- 'Ṁ' => 'ṁ',
- 'Ṃ' => 'ṃ',
- 'Ṅ' => 'ṅ',
- 'Ṇ' => 'ṇ',
- 'Ṉ' => 'ṉ',
- 'Ṋ' => 'ṋ',
- 'Ṍ' => 'ṍ',
- 'Ṏ' => 'ṏ',
- 'Ṑ' => 'ṑ',
- 'Ṓ' => 'ṓ',
- 'Ṕ' => 'ṕ',
- 'Ṗ' => 'ṗ',
- 'Ṙ' => 'ṙ',
- 'Ṛ' => 'ṛ',
- 'Ṝ' => 'ṝ',
- 'Ṟ' => 'ṟ',
- 'Ṡ' => 'ṡ',
- 'Ṣ' => 'ṣ',
- 'Ṥ' => 'ṥ',
- 'Ṧ' => 'ṧ',
- 'Ṩ' => 'ṩ',
- 'Ṫ' => 'ṫ',
- 'Ṭ' => 'ṭ',
- 'Ṯ' => 'ṯ',
- 'Ṱ' => 'ṱ',
- 'Ṳ' => 'ṳ',
- 'Ṵ' => 'ṵ',
- 'Ṷ' => 'ṷ',
- 'Ṹ' => 'ṹ',
- 'Ṻ' => 'ṻ',
- 'Ṽ' => 'ṽ',
- 'Ṿ' => 'ṿ',
- 'Ẁ' => 'ẁ',
- 'Ẃ' => 'ẃ',
- 'Ẅ' => 'ẅ',
- 'Ẇ' => 'ẇ',
- 'Ẉ' => 'ẉ',
- 'Ẋ' => 'ẋ',
- 'Ẍ' => 'ẍ',
- 'Ẏ' => 'ẏ',
- 'Ẑ' => 'ẑ',
- 'Ẓ' => 'ẓ',
- 'Ẕ' => 'ẕ',
- 'ẞ' => 'ß',
- 'Ạ' => 'ạ',
- 'Ả' => 'ả',
- 'Ấ' => 'ấ',
- 'Ầ' => 'ầ',
- 'Ẩ' => 'ẩ',
- 'Ẫ' => 'ẫ',
- 'Ậ' => 'ậ',
- 'Ắ' => 'ắ',
- 'Ằ' => 'ằ',
- 'Ẳ' => 'ẳ',
- 'Ẵ' => 'ẵ',
- 'Ặ' => 'ặ',
- 'Ẹ' => 'ẹ',
- 'Ẻ' => 'ẻ',
- 'Ẽ' => 'ẽ',
- 'Ế' => 'ế',
- 'Ề' => 'ề',
- 'Ể' => 'ể',
- 'Ễ' => 'ễ',
- 'Ệ' => 'ệ',
- 'Ỉ' => 'ỉ',
- 'Ị' => 'ị',
- 'Ọ' => 'ọ',
- 'Ỏ' => 'ỏ',
- 'Ố' => 'ố',
- 'Ồ' => 'ồ',
- 'Ổ' => 'ổ',
- 'Ỗ' => 'ỗ',
- 'Ộ' => 'ộ',
- 'Ớ' => 'ớ',
- 'Ờ' => 'ờ',
- 'Ở' => 'ở',
- 'Ỡ' => 'ỡ',
- 'Ợ' => 'ợ',
- 'Ụ' => 'ụ',
- 'Ủ' => 'ủ',
- 'Ứ' => 'ứ',
- 'Ừ' => 'ừ',
- 'Ử' => 'ử',
- 'Ữ' => 'ữ',
- 'Ự' => 'ự',
- 'Ỳ' => 'ỳ',
- 'Ỵ' => 'ỵ',
- 'Ỷ' => 'ỷ',
- 'Ỹ' => 'ỹ',
- 'Ỻ' => 'ỻ',
- 'Ỽ' => 'ỽ',
- 'Ỿ' => 'ỿ',
- 'Ἀ' => 'ἀ',
- 'Ἁ' => 'ἁ',
- 'Ἂ' => 'ἂ',
- 'Ἃ' => 'ἃ',
- 'Ἄ' => 'ἄ',
- 'Ἅ' => 'ἅ',
- 'Ἆ' => 'ἆ',
- 'Ἇ' => 'ἇ',
- 'Ἐ' => 'ἐ',
- 'Ἑ' => 'ἑ',
- 'Ἒ' => 'ἒ',
- 'Ἓ' => 'ἓ',
- 'Ἔ' => 'ἔ',
- 'Ἕ' => 'ἕ',
- 'Ἠ' => 'ἠ',
- 'Ἡ' => 'ἡ',
- 'Ἢ' => 'ἢ',
- 'Ἣ' => 'ἣ',
- 'Ἤ' => 'ἤ',
- 'Ἥ' => 'ἥ',
- 'Ἦ' => 'ἦ',
- 'Ἧ' => 'ἧ',
- 'Ἰ' => 'ἰ',
- 'Ἱ' => 'ἱ',
- 'Ἲ' => 'ἲ',
- 'Ἳ' => 'ἳ',
- 'Ἴ' => 'ἴ',
- 'Ἵ' => 'ἵ',
- 'Ἶ' => 'ἶ',
- 'Ἷ' => 'ἷ',
- 'Ὀ' => 'ὀ',
- 'Ὁ' => 'ὁ',
- 'Ὂ' => 'ὂ',
- 'Ὃ' => 'ὃ',
- 'Ὄ' => 'ὄ',
- 'Ὅ' => 'ὅ',
- 'Ὑ' => 'ὑ',
- 'Ὓ' => 'ὓ',
- 'Ὕ' => 'ὕ',
- 'Ὗ' => 'ὗ',
- 'Ὠ' => 'ὠ',
- 'Ὡ' => 'ὡ',
- 'Ὢ' => 'ὢ',
- 'Ὣ' => 'ὣ',
- 'Ὤ' => 'ὤ',
- 'Ὥ' => 'ὥ',
- 'Ὦ' => 'ὦ',
- 'Ὧ' => 'ὧ',
- 'ᾈ' => 'ᾀ',
- 'ᾉ' => 'ᾁ',
- 'ᾊ' => 'ᾂ',
- 'ᾋ' => 'ᾃ',
- 'ᾌ' => 'ᾄ',
- 'ᾍ' => 'ᾅ',
- 'ᾎ' => 'ᾆ',
- 'ᾏ' => 'ᾇ',
- 'ᾘ' => 'ᾐ',
- 'ᾙ' => 'ᾑ',
- 'ᾚ' => 'ᾒ',
- 'ᾛ' => 'ᾓ',
- 'ᾜ' => 'ᾔ',
- 'ᾝ' => 'ᾕ',
- 'ᾞ' => 'ᾖ',
- 'ᾟ' => 'ᾗ',
- 'ᾨ' => 'ᾠ',
- 'ᾩ' => 'ᾡ',
- 'ᾪ' => 'ᾢ',
- 'ᾫ' => 'ᾣ',
- 'ᾬ' => 'ᾤ',
- 'ᾭ' => 'ᾥ',
- 'ᾮ' => 'ᾦ',
- 'ᾯ' => 'ᾧ',
- 'Ᾰ' => 'ᾰ',
- 'Ᾱ' => 'ᾱ',
- 'Ὰ' => 'ὰ',
- 'Ά' => 'ά',
- 'ᾼ' => 'ᾳ',
- 'Ὲ' => 'ὲ',
- 'Έ' => 'έ',
- 'Ὴ' => 'ὴ',
- 'Ή' => 'ή',
- 'ῌ' => 'ῃ',
- 'Ῐ' => 'ῐ',
- 'Ῑ' => 'ῑ',
- 'Ὶ' => 'ὶ',
- 'Ί' => 'ί',
- 'Ῠ' => 'ῠ',
- 'Ῡ' => 'ῡ',
- 'Ὺ' => 'ὺ',
- 'Ύ' => 'ύ',
- 'Ῥ' => 'ῥ',
- 'Ὸ' => 'ὸ',
- 'Ό' => 'ό',
- 'Ὼ' => 'ὼ',
- 'Ώ' => 'ώ',
- 'ῼ' => 'ῳ',
- 'Ω' => 'ω',
- 'K' => 'k',
- 'Å' => 'å',
- 'Ⅎ' => 'ⅎ',
- 'Ⅰ' => 'ⅰ',
- 'Ⅱ' => 'ⅱ',
- 'Ⅲ' => 'ⅲ',
- 'Ⅳ' => 'ⅳ',
- 'Ⅴ' => 'ⅴ',
- 'Ⅵ' => 'ⅵ',
- 'Ⅶ' => 'ⅶ',
- 'Ⅷ' => 'ⅷ',
- 'Ⅸ' => 'ⅸ',
- 'Ⅹ' => 'ⅹ',
- 'Ⅺ' => 'ⅺ',
- 'Ⅻ' => 'ⅻ',
- 'Ⅼ' => 'ⅼ',
- 'Ⅽ' => 'ⅽ',
- 'Ⅾ' => 'ⅾ',
- 'Ⅿ' => 'ⅿ',
- 'Ↄ' => 'ↄ',
- 'Ⓐ' => 'ⓐ',
- 'Ⓑ' => 'ⓑ',
- 'Ⓒ' => 'ⓒ',
- 'Ⓓ' => 'ⓓ',
- 'Ⓔ' => 'ⓔ',
- 'Ⓕ' => 'ⓕ',
- 'Ⓖ' => 'ⓖ',
- 'Ⓗ' => 'ⓗ',
- 'Ⓘ' => 'ⓘ',
- 'Ⓙ' => 'ⓙ',
- 'Ⓚ' => 'ⓚ',
- 'Ⓛ' => 'ⓛ',
- 'Ⓜ' => 'ⓜ',
- 'Ⓝ' => 'ⓝ',
- 'Ⓞ' => 'ⓞ',
- 'Ⓟ' => 'ⓟ',
- 'Ⓠ' => 'ⓠ',
- 'Ⓡ' => 'ⓡ',
- 'Ⓢ' => 'ⓢ',
- 'Ⓣ' => 'ⓣ',
- 'Ⓤ' => 'ⓤ',
- 'Ⓥ' => 'ⓥ',
- 'Ⓦ' => 'ⓦ',
- 'Ⓧ' => 'ⓧ',
- 'Ⓨ' => 'ⓨ',
- 'Ⓩ' => 'ⓩ',
- 'Ⰰ' => 'ⰰ',
- 'Ⰱ' => 'ⰱ',
- 'Ⰲ' => 'ⰲ',
- 'Ⰳ' => 'ⰳ',
- 'Ⰴ' => 'ⰴ',
- 'Ⰵ' => 'ⰵ',
- 'Ⰶ' => 'ⰶ',
- 'Ⰷ' => 'ⰷ',
- 'Ⰸ' => 'ⰸ',
- 'Ⰹ' => 'ⰹ',
- 'Ⰺ' => 'ⰺ',
- 'Ⰻ' => 'ⰻ',
- 'Ⰼ' => 'ⰼ',
- 'Ⰽ' => 'ⰽ',
- 'Ⰾ' => 'ⰾ',
- 'Ⰿ' => 'ⰿ',
- 'Ⱀ' => 'ⱀ',
- 'Ⱁ' => 'ⱁ',
- 'Ⱂ' => 'ⱂ',
- 'Ⱃ' => 'ⱃ',
- 'Ⱄ' => 'ⱄ',
- 'Ⱅ' => 'ⱅ',
- 'Ⱆ' => 'ⱆ',
- 'Ⱇ' => 'ⱇ',
- 'Ⱈ' => 'ⱈ',
- 'Ⱉ' => 'ⱉ',
- 'Ⱊ' => 'ⱊ',
- 'Ⱋ' => 'ⱋ',
- 'Ⱌ' => 'ⱌ',
- 'Ⱍ' => 'ⱍ',
- 'Ⱎ' => 'ⱎ',
- 'Ⱏ' => 'ⱏ',
- 'Ⱐ' => 'ⱐ',
- 'Ⱑ' => 'ⱑ',
- 'Ⱒ' => 'ⱒ',
- 'Ⱓ' => 'ⱓ',
- 'Ⱔ' => 'ⱔ',
- 'Ⱕ' => 'ⱕ',
- 'Ⱖ' => 'ⱖ',
- 'Ⱗ' => 'ⱗ',
- 'Ⱘ' => 'ⱘ',
- 'Ⱙ' => 'ⱙ',
- 'Ⱚ' => 'ⱚ',
- 'Ⱛ' => 'ⱛ',
- 'Ⱜ' => 'ⱜ',
- 'Ⱝ' => 'ⱝ',
- 'Ⱞ' => 'ⱞ',
- 'Ⱡ' => 'ⱡ',
- 'Ɫ' => 'ɫ',
- 'Ᵽ' => 'ᵽ',
- 'Ɽ' => 'ɽ',
- 'Ⱨ' => 'ⱨ',
- 'Ⱪ' => 'ⱪ',
- 'Ⱬ' => 'ⱬ',
- 'Ɑ' => 'ɑ',
- 'Ɱ' => 'ɱ',
- 'Ɐ' => 'ɐ',
- 'Ɒ' => 'ɒ',
- 'Ⱳ' => 'ⱳ',
- 'Ⱶ' => 'ⱶ',
- 'Ȿ' => 'ȿ',
- 'Ɀ' => 'ɀ',
- 'Ⲁ' => 'ⲁ',
- 'Ⲃ' => 'ⲃ',
- 'Ⲅ' => 'ⲅ',
- 'Ⲇ' => 'ⲇ',
- 'Ⲉ' => 'ⲉ',
- 'Ⲋ' => 'ⲋ',
- 'Ⲍ' => 'ⲍ',
- 'Ⲏ' => 'ⲏ',
- 'Ⲑ' => 'ⲑ',
- 'Ⲓ' => 'ⲓ',
- 'Ⲕ' => 'ⲕ',
- 'Ⲗ' => 'ⲗ',
- 'Ⲙ' => 'ⲙ',
- 'Ⲛ' => 'ⲛ',
- 'Ⲝ' => 'ⲝ',
- 'Ⲟ' => 'ⲟ',
- 'Ⲡ' => 'ⲡ',
- 'Ⲣ' => 'ⲣ',
- 'Ⲥ' => 'ⲥ',
- 'Ⲧ' => 'ⲧ',
- 'Ⲩ' => 'ⲩ',
- 'Ⲫ' => 'ⲫ',
- 'Ⲭ' => 'ⲭ',
- 'Ⲯ' => 'ⲯ',
- 'Ⲱ' => 'ⲱ',
- 'Ⲳ' => 'ⲳ',
- 'Ⲵ' => 'ⲵ',
- 'Ⲷ' => 'ⲷ',
- 'Ⲹ' => 'ⲹ',
- 'Ⲻ' => 'ⲻ',
- 'Ⲽ' => 'ⲽ',
- 'Ⲿ' => 'ⲿ',
- 'Ⳁ' => 'ⳁ',
- 'Ⳃ' => 'ⳃ',
- 'Ⳅ' => 'ⳅ',
- 'Ⳇ' => 'ⳇ',
- 'Ⳉ' => 'ⳉ',
- 'Ⳋ' => 'ⳋ',
- 'Ⳍ' => 'ⳍ',
- 'Ⳏ' => 'ⳏ',
- 'Ⳑ' => 'ⳑ',
- 'Ⳓ' => 'ⳓ',
- 'Ⳕ' => 'ⳕ',
- 'Ⳗ' => 'ⳗ',
- 'Ⳙ' => 'ⳙ',
- 'Ⳛ' => 'ⳛ',
- 'Ⳝ' => 'ⳝ',
- 'Ⳟ' => 'ⳟ',
- 'Ⳡ' => 'ⳡ',
- 'Ⳣ' => 'ⳣ',
- 'Ⳬ' => 'ⳬ',
- 'Ⳮ' => 'ⳮ',
- 'Ⳳ' => 'ⳳ',
- 'Ꙁ' => 'ꙁ',
- 'Ꙃ' => 'ꙃ',
- 'Ꙅ' => 'ꙅ',
- 'Ꙇ' => 'ꙇ',
- 'Ꙉ' => 'ꙉ',
- 'Ꙋ' => 'ꙋ',
- 'Ꙍ' => 'ꙍ',
- 'Ꙏ' => 'ꙏ',
- 'Ꙑ' => 'ꙑ',
- 'Ꙓ' => 'ꙓ',
- 'Ꙕ' => 'ꙕ',
- 'Ꙗ' => 'ꙗ',
- 'Ꙙ' => 'ꙙ',
- 'Ꙛ' => 'ꙛ',
- 'Ꙝ' => 'ꙝ',
- 'Ꙟ' => 'ꙟ',
- 'Ꙡ' => 'ꙡ',
- 'Ꙣ' => 'ꙣ',
- 'Ꙥ' => 'ꙥ',
- 'Ꙧ' => 'ꙧ',
- 'Ꙩ' => 'ꙩ',
- 'Ꙫ' => 'ꙫ',
- 'Ꙭ' => 'ꙭ',
- 'Ꚁ' => 'ꚁ',
- 'Ꚃ' => 'ꚃ',
- 'Ꚅ' => 'ꚅ',
- 'Ꚇ' => 'ꚇ',
- 'Ꚉ' => 'ꚉ',
- 'Ꚋ' => 'ꚋ',
- 'Ꚍ' => 'ꚍ',
- 'Ꚏ' => 'ꚏ',
- 'Ꚑ' => 'ꚑ',
- 'Ꚓ' => 'ꚓ',
- 'Ꚕ' => 'ꚕ',
- 'Ꚗ' => 'ꚗ',
- 'Ꚙ' => 'ꚙ',
- 'Ꚛ' => 'ꚛ',
- 'Ꜣ' => 'ꜣ',
- 'Ꜥ' => 'ꜥ',
- 'Ꜧ' => 'ꜧ',
- 'Ꜩ' => 'ꜩ',
- 'Ꜫ' => 'ꜫ',
- 'Ꜭ' => 'ꜭ',
- 'Ꜯ' => 'ꜯ',
- 'Ꜳ' => 'ꜳ',
- 'Ꜵ' => 'ꜵ',
- 'Ꜷ' => 'ꜷ',
- 'Ꜹ' => 'ꜹ',
- 'Ꜻ' => 'ꜻ',
- 'Ꜽ' => 'ꜽ',
- 'Ꜿ' => 'ꜿ',
- 'Ꝁ' => 'ꝁ',
- 'Ꝃ' => 'ꝃ',
- 'Ꝅ' => 'ꝅ',
- 'Ꝇ' => 'ꝇ',
- 'Ꝉ' => 'ꝉ',
- 'Ꝋ' => 'ꝋ',
- 'Ꝍ' => 'ꝍ',
- 'Ꝏ' => 'ꝏ',
- 'Ꝑ' => 'ꝑ',
- 'Ꝓ' => 'ꝓ',
- 'Ꝕ' => 'ꝕ',
- 'Ꝗ' => 'ꝗ',
- 'Ꝙ' => 'ꝙ',
- 'Ꝛ' => 'ꝛ',
- 'Ꝝ' => 'ꝝ',
- 'Ꝟ' => 'ꝟ',
- 'Ꝡ' => 'ꝡ',
- 'Ꝣ' => 'ꝣ',
- 'Ꝥ' => 'ꝥ',
- 'Ꝧ' => 'ꝧ',
- 'Ꝩ' => 'ꝩ',
- 'Ꝫ' => 'ꝫ',
- 'Ꝭ' => 'ꝭ',
- 'Ꝯ' => 'ꝯ',
- 'Ꝺ' => 'ꝺ',
- 'Ꝼ' => 'ꝼ',
- 'Ᵹ' => 'ᵹ',
- 'Ꝿ' => 'ꝿ',
- 'Ꞁ' => 'ꞁ',
- 'Ꞃ' => 'ꞃ',
- 'Ꞅ' => 'ꞅ',
- 'Ꞇ' => 'ꞇ',
- 'Ꞌ' => 'ꞌ',
- 'Ɥ' => 'ɥ',
- 'Ꞑ' => 'ꞑ',
- 'Ꞓ' => 'ꞓ',
- 'Ꞗ' => 'ꞗ',
- 'Ꞙ' => 'ꞙ',
- 'Ꞛ' => 'ꞛ',
- 'Ꞝ' => 'ꞝ',
- 'Ꞟ' => 'ꞟ',
- 'Ꞡ' => 'ꞡ',
- 'Ꞣ' => 'ꞣ',
- 'Ꞥ' => 'ꞥ',
- 'Ꞧ' => 'ꞧ',
- 'Ꞩ' => 'ꞩ',
- 'Ɦ' => 'ɦ',
- 'Ɜ' => 'ɜ',
- 'Ɡ' => 'ɡ',
- 'Ɬ' => 'ɬ',
- 'Ɪ' => 'ɪ',
- 'Ʞ' => 'ʞ',
- 'Ʇ' => 'ʇ',
- 'Ʝ' => 'ʝ',
- 'Ꭓ' => 'ꭓ',
- 'Ꞵ' => 'ꞵ',
- 'Ꞷ' => 'ꞷ',
- 'Ꞹ' => 'ꞹ',
- 'Ꞻ' => 'ꞻ',
- 'Ꞽ' => 'ꞽ',
- 'Ꞿ' => 'ꞿ',
- 'Ꟃ' => 'ꟃ',
- 'Ꞔ' => 'ꞔ',
- 'Ʂ' => 'ʂ',
- 'Ᶎ' => 'ᶎ',
- 'Ꟈ' => 'ꟈ',
- 'Ꟊ' => 'ꟊ',
- 'Ꟶ' => 'ꟶ',
- 'A' => 'a',
- 'B' => 'b',
- 'C' => 'c',
- 'D' => 'd',
- 'E' => 'e',
- 'F' => 'f',
- 'G' => 'g',
- 'H' => 'h',
- 'I' => 'i',
- 'J' => 'j',
- 'K' => 'k',
- 'L' => 'l',
- 'M' => 'm',
- 'N' => 'n',
- 'O' => 'o',
- 'P' => 'p',
- 'Q' => 'q',
- 'R' => 'r',
- 'S' => 's',
- 'T' => 't',
- 'U' => 'u',
- 'V' => 'v',
- 'W' => 'w',
- 'X' => 'x',
- 'Y' => 'y',
- 'Z' => 'z',
- '𐐀' => '𐐨',
- '𐐁' => '𐐩',
- '𐐂' => '𐐪',
- '𐐃' => '𐐫',
- '𐐄' => '𐐬',
- '𐐅' => '𐐭',
- '𐐆' => '𐐮',
- '𐐇' => '𐐯',
- '𐐈' => '𐐰',
- '𐐉' => '𐐱',
- '𐐊' => '𐐲',
- '𐐋' => '𐐳',
- '𐐌' => '𐐴',
- '𐐍' => '𐐵',
- '𐐎' => '𐐶',
- '𐐏' => '𐐷',
- '𐐐' => '𐐸',
- '𐐑' => '𐐹',
- '𐐒' => '𐐺',
- '𐐓' => '𐐻',
- '𐐔' => '𐐼',
- '𐐕' => '𐐽',
- '𐐖' => '𐐾',
- '𐐗' => '𐐿',
- '𐐘' => '𐑀',
- '𐐙' => '𐑁',
- '𐐚' => '𐑂',
- '𐐛' => '𐑃',
- '𐐜' => '𐑄',
- '𐐝' => '𐑅',
- '𐐞' => '𐑆',
- '𐐟' => '𐑇',
- '𐐠' => '𐑈',
- '𐐡' => '𐑉',
- '𐐢' => '𐑊',
- '𐐣' => '𐑋',
- '𐐤' => '𐑌',
- '𐐥' => '𐑍',
- '𐐦' => '𐑎',
- '𐐧' => '𐑏',
- '𐒰' => '𐓘',
- '𐒱' => '𐓙',
- '𐒲' => '𐓚',
- '𐒳' => '𐓛',
- '𐒴' => '𐓜',
- '𐒵' => '𐓝',
- '𐒶' => '𐓞',
- '𐒷' => '𐓟',
- '𐒸' => '𐓠',
- '𐒹' => '𐓡',
- '𐒺' => '𐓢',
- '𐒻' => '𐓣',
- '𐒼' => '𐓤',
- '𐒽' => '𐓥',
- '𐒾' => '𐓦',
- '𐒿' => '𐓧',
- '𐓀' => '𐓨',
- '𐓁' => '𐓩',
- '𐓂' => '𐓪',
- '𐓃' => '𐓫',
- '𐓄' => '𐓬',
- '𐓅' => '𐓭',
- '𐓆' => '𐓮',
- '𐓇' => '𐓯',
- '𐓈' => '𐓰',
- '𐓉' => '𐓱',
- '𐓊' => '𐓲',
- '𐓋' => '𐓳',
- '𐓌' => '𐓴',
- '𐓍' => '𐓵',
- '𐓎' => '𐓶',
- '𐓏' => '𐓷',
- '𐓐' => '𐓸',
- '𐓑' => '𐓹',
- '𐓒' => '𐓺',
- '𐓓' => '𐓻',
- '𐲀' => '𐳀',
- '𐲁' => '𐳁',
- '𐲂' => '𐳂',
- '𐲃' => '𐳃',
- '𐲄' => '𐳄',
- '𐲅' => '𐳅',
- '𐲆' => '𐳆',
- '𐲇' => '𐳇',
- '𐲈' => '𐳈',
- '𐲉' => '𐳉',
- '𐲊' => '𐳊',
- '𐲋' => '𐳋',
- '𐲌' => '𐳌',
- '𐲍' => '𐳍',
- '𐲎' => '𐳎',
- '𐲏' => '𐳏',
- '𐲐' => '𐳐',
- '𐲑' => '𐳑',
- '𐲒' => '𐳒',
- '𐲓' => '𐳓',
- '𐲔' => '𐳔',
- '𐲕' => '𐳕',
- '𐲖' => '𐳖',
- '𐲗' => '𐳗',
- '𐲘' => '𐳘',
- '𐲙' => '𐳙',
- '𐲚' => '𐳚',
- '𐲛' => '𐳛',
- '𐲜' => '𐳜',
- '𐲝' => '𐳝',
- '𐲞' => '𐳞',
- '𐲟' => '𐳟',
- '𐲠' => '𐳠',
- '𐲡' => '𐳡',
- '𐲢' => '𐳢',
- '𐲣' => '𐳣',
- '𐲤' => '𐳤',
- '𐲥' => '𐳥',
- '𐲦' => '𐳦',
- '𐲧' => '𐳧',
- '𐲨' => '𐳨',
- '𐲩' => '𐳩',
- '𐲪' => '𐳪',
- '𐲫' => '𐳫',
- '𐲬' => '𐳬',
- '𐲭' => '𐳭',
- '𐲮' => '𐳮',
- '𐲯' => '𐳯',
- '𐲰' => '𐳰',
- '𐲱' => '𐳱',
- '𐲲' => '𐳲',
- '𑢠' => '𑣀',
- '𑢡' => '𑣁',
- '𑢢' => '𑣂',
- '𑢣' => '𑣃',
- '𑢤' => '𑣄',
- '𑢥' => '𑣅',
- '𑢦' => '𑣆',
- '𑢧' => '𑣇',
- '𑢨' => '𑣈',
- '𑢩' => '𑣉',
- '𑢪' => '𑣊',
- '𑢫' => '𑣋',
- '𑢬' => '𑣌',
- '𑢭' => '𑣍',
- '𑢮' => '𑣎',
- '𑢯' => '𑣏',
- '𑢰' => '𑣐',
- '𑢱' => '𑣑',
- '𑢲' => '𑣒',
- '𑢳' => '𑣓',
- '𑢴' => '𑣔',
- '𑢵' => '𑣕',
- '𑢶' => '𑣖',
- '𑢷' => '𑣗',
- '𑢸' => '𑣘',
- '𑢹' => '𑣙',
- '𑢺' => '𑣚',
- '𑢻' => '𑣛',
- '𑢼' => '𑣜',
- '𑢽' => '𑣝',
- '𑢾' => '𑣞',
- '𑢿' => '𑣟',
- '𖹀' => '𖹠',
- '𖹁' => '𖹡',
- '𖹂' => '𖹢',
- '𖹃' => '𖹣',
- '𖹄' => '𖹤',
- '𖹅' => '𖹥',
- '𖹆' => '𖹦',
- '𖹇' => '𖹧',
- '𖹈' => '𖹨',
- '𖹉' => '𖹩',
- '𖹊' => '𖹪',
- '𖹋' => '𖹫',
- '𖹌' => '𖹬',
- '𖹍' => '𖹭',
- '𖹎' => '𖹮',
- '𖹏' => '𖹯',
- '𖹐' => '𖹰',
- '𖹑' => '𖹱',
- '𖹒' => '𖹲',
- '𖹓' => '𖹳',
- '𖹔' => '𖹴',
- '𖹕' => '𖹵',
- '𖹖' => '𖹶',
- '𖹗' => '𖹷',
- '𖹘' => '𖹸',
- '𖹙' => '𖹹',
- '𖹚' => '𖹺',
- '𖹛' => '𖹻',
- '𖹜' => '𖹼',
- '𖹝' => '𖹽',
- '𖹞' => '𖹾',
- '𖹟' => '𖹿',
- '𞤀' => '𞤢',
- '𞤁' => '𞤣',
- '𞤂' => '𞤤',
- '𞤃' => '𞤥',
- '𞤄' => '𞤦',
- '𞤅' => '𞤧',
- '𞤆' => '𞤨',
- '𞤇' => '𞤩',
- '𞤈' => '𞤪',
- '𞤉' => '𞤫',
- '𞤊' => '𞤬',
- '𞤋' => '𞤭',
- '𞤌' => '𞤮',
- '𞤍' => '𞤯',
- '𞤎' => '𞤰',
- '𞤏' => '𞤱',
- '𞤐' => '𞤲',
- '𞤑' => '𞤳',
- '𞤒' => '𞤴',
- '𞤓' => '𞤵',
- '𞤔' => '𞤶',
- '𞤕' => '𞤷',
- '𞤖' => '𞤸',
- '𞤗' => '𞤹',
- '𞤘' => '𞤺',
- '𞤙' => '𞤻',
- '𞤚' => '𞤼',
- '𞤛' => '𞤽',
- '𞤜' => '𞤾',
- '𞤝' => '𞤿',
- '𞤞' => '𞥀',
- '𞤟' => '𞥁',
- '𞤠' => '𞥂',
- '𞤡' => '𞥃',
-);
diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php
deleted file mode 100644
index 2a8f6e7..0000000
--- a/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php
+++ /dev/null
@@ -1,5 +0,0 @@
- 'A',
- 'b' => 'B',
- 'c' => 'C',
- 'd' => 'D',
- 'e' => 'E',
- 'f' => 'F',
- 'g' => 'G',
- 'h' => 'H',
- 'i' => 'I',
- 'j' => 'J',
- 'k' => 'K',
- 'l' => 'L',
- 'm' => 'M',
- 'n' => 'N',
- 'o' => 'O',
- 'p' => 'P',
- 'q' => 'Q',
- 'r' => 'R',
- 's' => 'S',
- 't' => 'T',
- 'u' => 'U',
- 'v' => 'V',
- 'w' => 'W',
- 'x' => 'X',
- 'y' => 'Y',
- 'z' => 'Z',
- 'µ' => 'Μ',
- 'à' => 'À',
- 'á' => 'Á',
- 'â' => 'Â',
- 'ã' => 'Ã',
- 'ä' => 'Ä',
- 'å' => 'Å',
- 'æ' => 'Æ',
- 'ç' => 'Ç',
- 'è' => 'È',
- 'é' => 'É',
- 'ê' => 'Ê',
- 'ë' => 'Ë',
- 'ì' => 'Ì',
- 'í' => 'Í',
- 'î' => 'Î',
- 'ï' => 'Ï',
- 'ð' => 'Ð',
- 'ñ' => 'Ñ',
- 'ò' => 'Ò',
- 'ó' => 'Ó',
- 'ô' => 'Ô',
- 'õ' => 'Õ',
- 'ö' => 'Ö',
- 'ø' => 'Ø',
- 'ù' => 'Ù',
- 'ú' => 'Ú',
- 'û' => 'Û',
- 'ü' => 'Ü',
- 'ý' => 'Ý',
- 'þ' => 'Þ',
- 'ÿ' => 'Ÿ',
- 'ā' => 'Ā',
- 'ă' => 'Ă',
- 'ą' => 'Ą',
- 'ć' => 'Ć',
- 'ĉ' => 'Ĉ',
- 'ċ' => 'Ċ',
- 'č' => 'Č',
- 'ď' => 'Ď',
- 'đ' => 'Đ',
- 'ē' => 'Ē',
- 'ĕ' => 'Ĕ',
- 'ė' => 'Ė',
- 'ę' => 'Ę',
- 'ě' => 'Ě',
- 'ĝ' => 'Ĝ',
- 'ğ' => 'Ğ',
- 'ġ' => 'Ġ',
- 'ģ' => 'Ģ',
- 'ĥ' => 'Ĥ',
- 'ħ' => 'Ħ',
- 'ĩ' => 'Ĩ',
- 'ī' => 'Ī',
- 'ĭ' => 'Ĭ',
- 'į' => 'Į',
- 'ı' => 'I',
- 'ij' => 'IJ',
- 'ĵ' => 'Ĵ',
- 'ķ' => 'Ķ',
- 'ĺ' => 'Ĺ',
- 'ļ' => 'Ļ',
- 'ľ' => 'Ľ',
- 'ŀ' => 'Ŀ',
- 'ł' => 'Ł',
- 'ń' => 'Ń',
- 'ņ' => 'Ņ',
- 'ň' => 'Ň',
- 'ŋ' => 'Ŋ',
- 'ō' => 'Ō',
- 'ŏ' => 'Ŏ',
- 'ő' => 'Ő',
- 'œ' => 'Œ',
- 'ŕ' => 'Ŕ',
- 'ŗ' => 'Ŗ',
- 'ř' => 'Ř',
- 'ś' => 'Ś',
- 'ŝ' => 'Ŝ',
- 'ş' => 'Ş',
- 'š' => 'Š',
- 'ţ' => 'Ţ',
- 'ť' => 'Ť',
- 'ŧ' => 'Ŧ',
- 'ũ' => 'Ũ',
- 'ū' => 'Ū',
- 'ŭ' => 'Ŭ',
- 'ů' => 'Ů',
- 'ű' => 'Ű',
- 'ų' => 'Ų',
- 'ŵ' => 'Ŵ',
- 'ŷ' => 'Ŷ',
- 'ź' => 'Ź',
- 'ż' => 'Ż',
- 'ž' => 'Ž',
- 'ſ' => 'S',
- 'ƀ' => 'Ƀ',
- 'ƃ' => 'Ƃ',
- 'ƅ' => 'Ƅ',
- 'ƈ' => 'Ƈ',
- 'ƌ' => 'Ƌ',
- 'ƒ' => 'Ƒ',
- 'ƕ' => 'Ƕ',
- 'ƙ' => 'Ƙ',
- 'ƚ' => 'Ƚ',
- 'ƞ' => 'Ƞ',
- 'ơ' => 'Ơ',
- 'ƣ' => 'Ƣ',
- 'ƥ' => 'Ƥ',
- 'ƨ' => 'Ƨ',
- 'ƭ' => 'Ƭ',
- 'ư' => 'Ư',
- 'ƴ' => 'Ƴ',
- 'ƶ' => 'Ƶ',
- 'ƹ' => 'Ƹ',
- 'ƽ' => 'Ƽ',
- 'ƿ' => 'Ƿ',
- 'Dž' => 'DŽ',
- 'dž' => 'DŽ',
- 'Lj' => 'LJ',
- 'lj' => 'LJ',
- 'Nj' => 'NJ',
- 'nj' => 'NJ',
- 'ǎ' => 'Ǎ',
- 'ǐ' => 'Ǐ',
- 'ǒ' => 'Ǒ',
- 'ǔ' => 'Ǔ',
- 'ǖ' => 'Ǖ',
- 'ǘ' => 'Ǘ',
- 'ǚ' => 'Ǚ',
- 'ǜ' => 'Ǜ',
- 'ǝ' => 'Ǝ',
- 'ǟ' => 'Ǟ',
- 'ǡ' => 'Ǡ',
- 'ǣ' => 'Ǣ',
- 'ǥ' => 'Ǥ',
- 'ǧ' => 'Ǧ',
- 'ǩ' => 'Ǩ',
- 'ǫ' => 'Ǫ',
- 'ǭ' => 'Ǭ',
- 'ǯ' => 'Ǯ',
- 'Dz' => 'DZ',
- 'dz' => 'DZ',
- 'ǵ' => 'Ǵ',
- 'ǹ' => 'Ǹ',
- 'ǻ' => 'Ǻ',
- 'ǽ' => 'Ǽ',
- 'ǿ' => 'Ǿ',
- 'ȁ' => 'Ȁ',
- 'ȃ' => 'Ȃ',
- 'ȅ' => 'Ȅ',
- 'ȇ' => 'Ȇ',
- 'ȉ' => 'Ȉ',
- 'ȋ' => 'Ȋ',
- 'ȍ' => 'Ȍ',
- 'ȏ' => 'Ȏ',
- 'ȑ' => 'Ȑ',
- 'ȓ' => 'Ȓ',
- 'ȕ' => 'Ȕ',
- 'ȗ' => 'Ȗ',
- 'ș' => 'Ș',
- 'ț' => 'Ț',
- 'ȝ' => 'Ȝ',
- 'ȟ' => 'Ȟ',
- 'ȣ' => 'Ȣ',
- 'ȥ' => 'Ȥ',
- 'ȧ' => 'Ȧ',
- 'ȩ' => 'Ȩ',
- 'ȫ' => 'Ȫ',
- 'ȭ' => 'Ȭ',
- 'ȯ' => 'Ȯ',
- 'ȱ' => 'Ȱ',
- 'ȳ' => 'Ȳ',
- 'ȼ' => 'Ȼ',
- 'ȿ' => 'Ȿ',
- 'ɀ' => 'Ɀ',
- 'ɂ' => 'Ɂ',
- 'ɇ' => 'Ɇ',
- 'ɉ' => 'Ɉ',
- 'ɋ' => 'Ɋ',
- 'ɍ' => 'Ɍ',
- 'ɏ' => 'Ɏ',
- 'ɐ' => 'Ɐ',
- 'ɑ' => 'Ɑ',
- 'ɒ' => 'Ɒ',
- 'ɓ' => 'Ɓ',
- 'ɔ' => 'Ɔ',
- 'ɖ' => 'Ɖ',
- 'ɗ' => 'Ɗ',
- 'ə' => 'Ə',
- 'ɛ' => 'Ɛ',
- 'ɜ' => 'Ɜ',
- 'ɠ' => 'Ɠ',
- 'ɡ' => 'Ɡ',
- 'ɣ' => 'Ɣ',
- 'ɥ' => 'Ɥ',
- 'ɦ' => 'Ɦ',
- 'ɨ' => 'Ɨ',
- 'ɩ' => 'Ɩ',
- 'ɪ' => 'Ɪ',
- 'ɫ' => 'Ɫ',
- 'ɬ' => 'Ɬ',
- 'ɯ' => 'Ɯ',
- 'ɱ' => 'Ɱ',
- 'ɲ' => 'Ɲ',
- 'ɵ' => 'Ɵ',
- 'ɽ' => 'Ɽ',
- 'ʀ' => 'Ʀ',
- 'ʂ' => 'Ʂ',
- 'ʃ' => 'Ʃ',
- 'ʇ' => 'Ʇ',
- 'ʈ' => 'Ʈ',
- 'ʉ' => 'Ʉ',
- 'ʊ' => 'Ʊ',
- 'ʋ' => 'Ʋ',
- 'ʌ' => 'Ʌ',
- 'ʒ' => 'Ʒ',
- 'ʝ' => 'Ʝ',
- 'ʞ' => 'Ʞ',
- 'ͅ' => 'Ι',
- 'ͱ' => 'Ͱ',
- 'ͳ' => 'Ͳ',
- 'ͷ' => 'Ͷ',
- 'ͻ' => 'Ͻ',
- 'ͼ' => 'Ͼ',
- 'ͽ' => 'Ͽ',
- 'ά' => 'Ά',
- 'έ' => 'Έ',
- 'ή' => 'Ή',
- 'ί' => 'Ί',
- 'α' => 'Α',
- 'β' => 'Β',
- 'γ' => 'Γ',
- 'δ' => 'Δ',
- 'ε' => 'Ε',
- 'ζ' => 'Ζ',
- 'η' => 'Η',
- 'θ' => 'Θ',
- 'ι' => 'Ι',
- 'κ' => 'Κ',
- 'λ' => 'Λ',
- 'μ' => 'Μ',
- 'ν' => 'Ν',
- 'ξ' => 'Ξ',
- 'ο' => 'Ο',
- 'π' => 'Π',
- 'ρ' => 'Ρ',
- 'ς' => 'Σ',
- 'σ' => 'Σ',
- 'τ' => 'Τ',
- 'υ' => 'Υ',
- 'φ' => 'Φ',
- 'χ' => 'Χ',
- 'ψ' => 'Ψ',
- 'ω' => 'Ω',
- 'ϊ' => 'Ϊ',
- 'ϋ' => 'Ϋ',
- 'ό' => 'Ό',
- 'ύ' => 'Ύ',
- 'ώ' => 'Ώ',
- 'ϐ' => 'Β',
- 'ϑ' => 'Θ',
- 'ϕ' => 'Φ',
- 'ϖ' => 'Π',
- 'ϗ' => 'Ϗ',
- 'ϙ' => 'Ϙ',
- 'ϛ' => 'Ϛ',
- 'ϝ' => 'Ϝ',
- 'ϟ' => 'Ϟ',
- 'ϡ' => 'Ϡ',
- 'ϣ' => 'Ϣ',
- 'ϥ' => 'Ϥ',
- 'ϧ' => 'Ϧ',
- 'ϩ' => 'Ϩ',
- 'ϫ' => 'Ϫ',
- 'ϭ' => 'Ϭ',
- 'ϯ' => 'Ϯ',
- 'ϰ' => 'Κ',
- 'ϱ' => 'Ρ',
- 'ϲ' => 'Ϲ',
- 'ϳ' => 'Ϳ',
- 'ϵ' => 'Ε',
- 'ϸ' => 'Ϸ',
- 'ϻ' => 'Ϻ',
- 'а' => 'А',
- 'б' => 'Б',
- 'в' => 'В',
- 'г' => 'Г',
- 'д' => 'Д',
- 'е' => 'Е',
- 'ж' => 'Ж',
- 'з' => 'З',
- 'и' => 'И',
- 'й' => 'Й',
- 'к' => 'К',
- 'л' => 'Л',
- 'м' => 'М',
- 'н' => 'Н',
- 'о' => 'О',
- 'п' => 'П',
- 'р' => 'Р',
- 'с' => 'С',
- 'т' => 'Т',
- 'у' => 'У',
- 'ф' => 'Ф',
- 'х' => 'Х',
- 'ц' => 'Ц',
- 'ч' => 'Ч',
- 'ш' => 'Ш',
- 'щ' => 'Щ',
- 'ъ' => 'Ъ',
- 'ы' => 'Ы',
- 'ь' => 'Ь',
- 'э' => 'Э',
- 'ю' => 'Ю',
- 'я' => 'Я',
- 'ѐ' => 'Ѐ',
- 'ё' => 'Ё',
- 'ђ' => 'Ђ',
- 'ѓ' => 'Ѓ',
- 'є' => 'Є',
- 'ѕ' => 'Ѕ',
- 'і' => 'І',
- 'ї' => 'Ї',
- 'ј' => 'Ј',
- 'љ' => 'Љ',
- 'њ' => 'Њ',
- 'ћ' => 'Ћ',
- 'ќ' => 'Ќ',
- 'ѝ' => 'Ѝ',
- 'ў' => 'Ў',
- 'џ' => 'Џ',
- 'ѡ' => 'Ѡ',
- 'ѣ' => 'Ѣ',
- 'ѥ' => 'Ѥ',
- 'ѧ' => 'Ѧ',
- 'ѩ' => 'Ѩ',
- 'ѫ' => 'Ѫ',
- 'ѭ' => 'Ѭ',
- 'ѯ' => 'Ѯ',
- 'ѱ' => 'Ѱ',
- 'ѳ' => 'Ѳ',
- 'ѵ' => 'Ѵ',
- 'ѷ' => 'Ѷ',
- 'ѹ' => 'Ѹ',
- 'ѻ' => 'Ѻ',
- 'ѽ' => 'Ѽ',
- 'ѿ' => 'Ѿ',
- 'ҁ' => 'Ҁ',
- 'ҋ' => 'Ҋ',
- 'ҍ' => 'Ҍ',
- 'ҏ' => 'Ҏ',
- 'ґ' => 'Ґ',
- 'ғ' => 'Ғ',
- 'ҕ' => 'Ҕ',
- 'җ' => 'Җ',
- 'ҙ' => 'Ҙ',
- 'қ' => 'Қ',
- 'ҝ' => 'Ҝ',
- 'ҟ' => 'Ҟ',
- 'ҡ' => 'Ҡ',
- 'ң' => 'Ң',
- 'ҥ' => 'Ҥ',
- 'ҧ' => 'Ҧ',
- 'ҩ' => 'Ҩ',
- 'ҫ' => 'Ҫ',
- 'ҭ' => 'Ҭ',
- 'ү' => 'Ү',
- 'ұ' => 'Ұ',
- 'ҳ' => 'Ҳ',
- 'ҵ' => 'Ҵ',
- 'ҷ' => 'Ҷ',
- 'ҹ' => 'Ҹ',
- 'һ' => 'Һ',
- 'ҽ' => 'Ҽ',
- 'ҿ' => 'Ҿ',
- 'ӂ' => 'Ӂ',
- 'ӄ' => 'Ӄ',
- 'ӆ' => 'Ӆ',
- 'ӈ' => 'Ӈ',
- 'ӊ' => 'Ӊ',
- 'ӌ' => 'Ӌ',
- 'ӎ' => 'Ӎ',
- 'ӏ' => 'Ӏ',
- 'ӑ' => 'Ӑ',
- 'ӓ' => 'Ӓ',
- 'ӕ' => 'Ӕ',
- 'ӗ' => 'Ӗ',
- 'ә' => 'Ә',
- 'ӛ' => 'Ӛ',
- 'ӝ' => 'Ӝ',
- 'ӟ' => 'Ӟ',
- 'ӡ' => 'Ӡ',
- 'ӣ' => 'Ӣ',
- 'ӥ' => 'Ӥ',
- 'ӧ' => 'Ӧ',
- 'ө' => 'Ө',
- 'ӫ' => 'Ӫ',
- 'ӭ' => 'Ӭ',
- 'ӯ' => 'Ӯ',
- 'ӱ' => 'Ӱ',
- 'ӳ' => 'Ӳ',
- 'ӵ' => 'Ӵ',
- 'ӷ' => 'Ӷ',
- 'ӹ' => 'Ӹ',
- 'ӻ' => 'Ӻ',
- 'ӽ' => 'Ӽ',
- 'ӿ' => 'Ӿ',
- 'ԁ' => 'Ԁ',
- 'ԃ' => 'Ԃ',
- 'ԅ' => 'Ԅ',
- 'ԇ' => 'Ԇ',
- 'ԉ' => 'Ԉ',
- 'ԋ' => 'Ԋ',
- 'ԍ' => 'Ԍ',
- 'ԏ' => 'Ԏ',
- 'ԑ' => 'Ԑ',
- 'ԓ' => 'Ԓ',
- 'ԕ' => 'Ԕ',
- 'ԗ' => 'Ԗ',
- 'ԙ' => 'Ԙ',
- 'ԛ' => 'Ԛ',
- 'ԝ' => 'Ԝ',
- 'ԟ' => 'Ԟ',
- 'ԡ' => 'Ԡ',
- 'ԣ' => 'Ԣ',
- 'ԥ' => 'Ԥ',
- 'ԧ' => 'Ԧ',
- 'ԩ' => 'Ԩ',
- 'ԫ' => 'Ԫ',
- 'ԭ' => 'Ԭ',
- 'ԯ' => 'Ԯ',
- 'ա' => 'Ա',
- 'բ' => 'Բ',
- 'գ' => 'Գ',
- 'դ' => 'Դ',
- 'ե' => 'Ե',
- 'զ' => 'Զ',
- 'է' => 'Է',
- 'ը' => 'Ը',
- 'թ' => 'Թ',
- 'ժ' => 'Ժ',
- 'ի' => 'Ի',
- 'լ' => 'Լ',
- 'խ' => 'Խ',
- 'ծ' => 'Ծ',
- 'կ' => 'Կ',
- 'հ' => 'Հ',
- 'ձ' => 'Ձ',
- 'ղ' => 'Ղ',
- 'ճ' => 'Ճ',
- 'մ' => 'Մ',
- 'յ' => 'Յ',
- 'ն' => 'Ն',
- 'շ' => 'Շ',
- 'ո' => 'Ո',
- 'չ' => 'Չ',
- 'պ' => 'Պ',
- 'ջ' => 'Ջ',
- 'ռ' => 'Ռ',
- 'ս' => 'Ս',
- 'վ' => 'Վ',
- 'տ' => 'Տ',
- 'ր' => 'Ր',
- 'ց' => 'Ց',
- 'ւ' => 'Ւ',
- 'փ' => 'Փ',
- 'ք' => 'Ք',
- 'օ' => 'Օ',
- 'ֆ' => 'Ֆ',
- 'ა' => 'Ა',
- 'ბ' => 'Ბ',
- 'გ' => 'Გ',
- 'დ' => 'Დ',
- 'ე' => 'Ე',
- 'ვ' => 'Ვ',
- 'ზ' => 'Ზ',
- 'თ' => 'Თ',
- 'ი' => 'Ი',
- 'კ' => 'Კ',
- 'ლ' => 'Ლ',
- 'მ' => 'Მ',
- 'ნ' => 'Ნ',
- 'ო' => 'Ო',
- 'პ' => 'Პ',
- 'ჟ' => 'Ჟ',
- 'რ' => 'Რ',
- 'ს' => 'Ს',
- 'ტ' => 'Ტ',
- 'უ' => 'Უ',
- 'ფ' => 'Ფ',
- 'ქ' => 'Ქ',
- 'ღ' => 'Ღ',
- 'ყ' => 'Ყ',
- 'შ' => 'Შ',
- 'ჩ' => 'Ჩ',
- 'ც' => 'Ც',
- 'ძ' => 'Ძ',
- 'წ' => 'Წ',
- 'ჭ' => 'Ჭ',
- 'ხ' => 'Ხ',
- 'ჯ' => 'Ჯ',
- 'ჰ' => 'Ჰ',
- 'ჱ' => 'Ჱ',
- 'ჲ' => 'Ჲ',
- 'ჳ' => 'Ჳ',
- 'ჴ' => 'Ჴ',
- 'ჵ' => 'Ჵ',
- 'ჶ' => 'Ჶ',
- 'ჷ' => 'Ჷ',
- 'ჸ' => 'Ჸ',
- 'ჹ' => 'Ჹ',
- 'ჺ' => 'Ჺ',
- 'ჽ' => 'Ჽ',
- 'ჾ' => 'Ჾ',
- 'ჿ' => 'Ჿ',
- 'ᏸ' => 'Ᏸ',
- 'ᏹ' => 'Ᏹ',
- 'ᏺ' => 'Ᏺ',
- 'ᏻ' => 'Ᏻ',
- 'ᏼ' => 'Ᏼ',
- 'ᏽ' => 'Ᏽ',
- 'ᲀ' => 'В',
- 'ᲁ' => 'Д',
- 'ᲂ' => 'О',
- 'ᲃ' => 'С',
- 'ᲄ' => 'Т',
- 'ᲅ' => 'Т',
- 'ᲆ' => 'Ъ',
- 'ᲇ' => 'Ѣ',
- 'ᲈ' => 'Ꙋ',
- 'ᵹ' => 'Ᵹ',
- 'ᵽ' => 'Ᵽ',
- 'ᶎ' => 'Ᶎ',
- 'ḁ' => 'Ḁ',
- 'ḃ' => 'Ḃ',
- 'ḅ' => 'Ḅ',
- 'ḇ' => 'Ḇ',
- 'ḉ' => 'Ḉ',
- 'ḋ' => 'Ḋ',
- 'ḍ' => 'Ḍ',
- 'ḏ' => 'Ḏ',
- 'ḑ' => 'Ḑ',
- 'ḓ' => 'Ḓ',
- 'ḕ' => 'Ḕ',
- 'ḗ' => 'Ḗ',
- 'ḙ' => 'Ḙ',
- 'ḛ' => 'Ḛ',
- 'ḝ' => 'Ḝ',
- 'ḟ' => 'Ḟ',
- 'ḡ' => 'Ḡ',
- 'ḣ' => 'Ḣ',
- 'ḥ' => 'Ḥ',
- 'ḧ' => 'Ḧ',
- 'ḩ' => 'Ḩ',
- 'ḫ' => 'Ḫ',
- 'ḭ' => 'Ḭ',
- 'ḯ' => 'Ḯ',
- 'ḱ' => 'Ḱ',
- 'ḳ' => 'Ḳ',
- 'ḵ' => 'Ḵ',
- 'ḷ' => 'Ḷ',
- 'ḹ' => 'Ḹ',
- 'ḻ' => 'Ḻ',
- 'ḽ' => 'Ḽ',
- 'ḿ' => 'Ḿ',
- 'ṁ' => 'Ṁ',
- 'ṃ' => 'Ṃ',
- 'ṅ' => 'Ṅ',
- 'ṇ' => 'Ṇ',
- 'ṉ' => 'Ṉ',
- 'ṋ' => 'Ṋ',
- 'ṍ' => 'Ṍ',
- 'ṏ' => 'Ṏ',
- 'ṑ' => 'Ṑ',
- 'ṓ' => 'Ṓ',
- 'ṕ' => 'Ṕ',
- 'ṗ' => 'Ṗ',
- 'ṙ' => 'Ṙ',
- 'ṛ' => 'Ṛ',
- 'ṝ' => 'Ṝ',
- 'ṟ' => 'Ṟ',
- 'ṡ' => 'Ṡ',
- 'ṣ' => 'Ṣ',
- 'ṥ' => 'Ṥ',
- 'ṧ' => 'Ṧ',
- 'ṩ' => 'Ṩ',
- 'ṫ' => 'Ṫ',
- 'ṭ' => 'Ṭ',
- 'ṯ' => 'Ṯ',
- 'ṱ' => 'Ṱ',
- 'ṳ' => 'Ṳ',
- 'ṵ' => 'Ṵ',
- 'ṷ' => 'Ṷ',
- 'ṹ' => 'Ṹ',
- 'ṻ' => 'Ṻ',
- 'ṽ' => 'Ṽ',
- 'ṿ' => 'Ṿ',
- 'ẁ' => 'Ẁ',
- 'ẃ' => 'Ẃ',
- 'ẅ' => 'Ẅ',
- 'ẇ' => 'Ẇ',
- 'ẉ' => 'Ẉ',
- 'ẋ' => 'Ẋ',
- 'ẍ' => 'Ẍ',
- 'ẏ' => 'Ẏ',
- 'ẑ' => 'Ẑ',
- 'ẓ' => 'Ẓ',
- 'ẕ' => 'Ẕ',
- 'ẛ' => 'Ṡ',
- 'ạ' => 'Ạ',
- 'ả' => 'Ả',
- 'ấ' => 'Ấ',
- 'ầ' => 'Ầ',
- 'ẩ' => 'Ẩ',
- 'ẫ' => 'Ẫ',
- 'ậ' => 'Ậ',
- 'ắ' => 'Ắ',
- 'ằ' => 'Ằ',
- 'ẳ' => 'Ẳ',
- 'ẵ' => 'Ẵ',
- 'ặ' => 'Ặ',
- 'ẹ' => 'Ẹ',
- 'ẻ' => 'Ẻ',
- 'ẽ' => 'Ẽ',
- 'ế' => 'Ế',
- 'ề' => 'Ề',
- 'ể' => 'Ể',
- 'ễ' => 'Ễ',
- 'ệ' => 'Ệ',
- 'ỉ' => 'Ỉ',
- 'ị' => 'Ị',
- 'ọ' => 'Ọ',
- 'ỏ' => 'Ỏ',
- 'ố' => 'Ố',
- 'ồ' => 'Ồ',
- 'ổ' => 'Ổ',
- 'ỗ' => 'Ỗ',
- 'ộ' => 'Ộ',
- 'ớ' => 'Ớ',
- 'ờ' => 'Ờ',
- 'ở' => 'Ở',
- 'ỡ' => 'Ỡ',
- 'ợ' => 'Ợ',
- 'ụ' => 'Ụ',
- 'ủ' => 'Ủ',
- 'ứ' => 'Ứ',
- 'ừ' => 'Ừ',
- 'ử' => 'Ử',
- 'ữ' => 'Ữ',
- 'ự' => 'Ự',
- 'ỳ' => 'Ỳ',
- 'ỵ' => 'Ỵ',
- 'ỷ' => 'Ỷ',
- 'ỹ' => 'Ỹ',
- 'ỻ' => 'Ỻ',
- 'ỽ' => 'Ỽ',
- 'ỿ' => 'Ỿ',
- 'ἀ' => 'Ἀ',
- 'ἁ' => 'Ἁ',
- 'ἂ' => 'Ἂ',
- 'ἃ' => 'Ἃ',
- 'ἄ' => 'Ἄ',
- 'ἅ' => 'Ἅ',
- 'ἆ' => 'Ἆ',
- 'ἇ' => 'Ἇ',
- 'ἐ' => 'Ἐ',
- 'ἑ' => 'Ἑ',
- 'ἒ' => 'Ἒ',
- 'ἓ' => 'Ἓ',
- 'ἔ' => 'Ἔ',
- 'ἕ' => 'Ἕ',
- 'ἠ' => 'Ἠ',
- 'ἡ' => 'Ἡ',
- 'ἢ' => 'Ἢ',
- 'ἣ' => 'Ἣ',
- 'ἤ' => 'Ἤ',
- 'ἥ' => 'Ἥ',
- 'ἦ' => 'Ἦ',
- 'ἧ' => 'Ἧ',
- 'ἰ' => 'Ἰ',
- 'ἱ' => 'Ἱ',
- 'ἲ' => 'Ἲ',
- 'ἳ' => 'Ἳ',
- 'ἴ' => 'Ἴ',
- 'ἵ' => 'Ἵ',
- 'ἶ' => 'Ἶ',
- 'ἷ' => 'Ἷ',
- 'ὀ' => 'Ὀ',
- 'ὁ' => 'Ὁ',
- 'ὂ' => 'Ὂ',
- 'ὃ' => 'Ὃ',
- 'ὄ' => 'Ὄ',
- 'ὅ' => 'Ὅ',
- 'ὑ' => 'Ὑ',
- 'ὓ' => 'Ὓ',
- 'ὕ' => 'Ὕ',
- 'ὗ' => 'Ὗ',
- 'ὠ' => 'Ὠ',
- 'ὡ' => 'Ὡ',
- 'ὢ' => 'Ὢ',
- 'ὣ' => 'Ὣ',
- 'ὤ' => 'Ὤ',
- 'ὥ' => 'Ὥ',
- 'ὦ' => 'Ὦ',
- 'ὧ' => 'Ὧ',
- 'ὰ' => 'Ὰ',
- 'ά' => 'Ά',
- 'ὲ' => 'Ὲ',
- 'έ' => 'Έ',
- 'ὴ' => 'Ὴ',
- 'ή' => 'Ή',
- 'ὶ' => 'Ὶ',
- 'ί' => 'Ί',
- 'ὸ' => 'Ὸ',
- 'ό' => 'Ό',
- 'ὺ' => 'Ὺ',
- 'ύ' => 'Ύ',
- 'ὼ' => 'Ὼ',
- 'ώ' => 'Ώ',
- 'ᾀ' => 'ἈΙ',
- 'ᾁ' => 'ἉΙ',
- 'ᾂ' => 'ἊΙ',
- 'ᾃ' => 'ἋΙ',
- 'ᾄ' => 'ἌΙ',
- 'ᾅ' => 'ἍΙ',
- 'ᾆ' => 'ἎΙ',
- 'ᾇ' => 'ἏΙ',
- 'ᾐ' => 'ἨΙ',
- 'ᾑ' => 'ἩΙ',
- 'ᾒ' => 'ἪΙ',
- 'ᾓ' => 'ἫΙ',
- 'ᾔ' => 'ἬΙ',
- 'ᾕ' => 'ἭΙ',
- 'ᾖ' => 'ἮΙ',
- 'ᾗ' => 'ἯΙ',
- 'ᾠ' => 'ὨΙ',
- 'ᾡ' => 'ὩΙ',
- 'ᾢ' => 'ὪΙ',
- 'ᾣ' => 'ὫΙ',
- 'ᾤ' => 'ὬΙ',
- 'ᾥ' => 'ὭΙ',
- 'ᾦ' => 'ὮΙ',
- 'ᾧ' => 'ὯΙ',
- 'ᾰ' => 'Ᾰ',
- 'ᾱ' => 'Ᾱ',
- 'ᾳ' => 'ΑΙ',
- 'ι' => 'Ι',
- 'ῃ' => 'ΗΙ',
- 'ῐ' => 'Ῐ',
- 'ῑ' => 'Ῑ',
- 'ῠ' => 'Ῠ',
- 'ῡ' => 'Ῡ',
- 'ῥ' => 'Ῥ',
- 'ῳ' => 'ΩΙ',
- 'ⅎ' => 'Ⅎ',
- 'ⅰ' => 'Ⅰ',
- 'ⅱ' => 'Ⅱ',
- 'ⅲ' => 'Ⅲ',
- 'ⅳ' => 'Ⅳ',
- 'ⅴ' => 'Ⅴ',
- 'ⅵ' => 'Ⅵ',
- 'ⅶ' => 'Ⅶ',
- 'ⅷ' => 'Ⅷ',
- 'ⅸ' => 'Ⅸ',
- 'ⅹ' => 'Ⅹ',
- 'ⅺ' => 'Ⅺ',
- 'ⅻ' => 'Ⅻ',
- 'ⅼ' => 'Ⅼ',
- 'ⅽ' => 'Ⅽ',
- 'ⅾ' => 'Ⅾ',
- 'ⅿ' => 'Ⅿ',
- 'ↄ' => 'Ↄ',
- 'ⓐ' => 'Ⓐ',
- 'ⓑ' => 'Ⓑ',
- 'ⓒ' => 'Ⓒ',
- 'ⓓ' => 'Ⓓ',
- 'ⓔ' => 'Ⓔ',
- 'ⓕ' => 'Ⓕ',
- 'ⓖ' => 'Ⓖ',
- 'ⓗ' => 'Ⓗ',
- 'ⓘ' => 'Ⓘ',
- 'ⓙ' => 'Ⓙ',
- 'ⓚ' => 'Ⓚ',
- 'ⓛ' => 'Ⓛ',
- 'ⓜ' => 'Ⓜ',
- 'ⓝ' => 'Ⓝ',
- 'ⓞ' => 'Ⓞ',
- 'ⓟ' => 'Ⓟ',
- 'ⓠ' => 'Ⓠ',
- 'ⓡ' => 'Ⓡ',
- 'ⓢ' => 'Ⓢ',
- 'ⓣ' => 'Ⓣ',
- 'ⓤ' => 'Ⓤ',
- 'ⓥ' => 'Ⓥ',
- 'ⓦ' => 'Ⓦ',
- 'ⓧ' => 'Ⓧ',
- 'ⓨ' => 'Ⓨ',
- 'ⓩ' => 'Ⓩ',
- 'ⰰ' => 'Ⰰ',
- 'ⰱ' => 'Ⰱ',
- 'ⰲ' => 'Ⰲ',
- 'ⰳ' => 'Ⰳ',
- 'ⰴ' => 'Ⰴ',
- 'ⰵ' => 'Ⰵ',
- 'ⰶ' => 'Ⰶ',
- 'ⰷ' => 'Ⰷ',
- 'ⰸ' => 'Ⰸ',
- 'ⰹ' => 'Ⰹ',
- 'ⰺ' => 'Ⰺ',
- 'ⰻ' => 'Ⰻ',
- 'ⰼ' => 'Ⰼ',
- 'ⰽ' => 'Ⰽ',
- 'ⰾ' => 'Ⰾ',
- 'ⰿ' => 'Ⰿ',
- 'ⱀ' => 'Ⱀ',
- 'ⱁ' => 'Ⱁ',
- 'ⱂ' => 'Ⱂ',
- 'ⱃ' => 'Ⱃ',
- 'ⱄ' => 'Ⱄ',
- 'ⱅ' => 'Ⱅ',
- 'ⱆ' => 'Ⱆ',
- 'ⱇ' => 'Ⱇ',
- 'ⱈ' => 'Ⱈ',
- 'ⱉ' => 'Ⱉ',
- 'ⱊ' => 'Ⱊ',
- 'ⱋ' => 'Ⱋ',
- 'ⱌ' => 'Ⱌ',
- 'ⱍ' => 'Ⱍ',
- 'ⱎ' => 'Ⱎ',
- 'ⱏ' => 'Ⱏ',
- 'ⱐ' => 'Ⱐ',
- 'ⱑ' => 'Ⱑ',
- 'ⱒ' => 'Ⱒ',
- 'ⱓ' => 'Ⱓ',
- 'ⱔ' => 'Ⱔ',
- 'ⱕ' => 'Ⱕ',
- 'ⱖ' => 'Ⱖ',
- 'ⱗ' => 'Ⱗ',
- 'ⱘ' => 'Ⱘ',
- 'ⱙ' => 'Ⱙ',
- 'ⱚ' => 'Ⱚ',
- 'ⱛ' => 'Ⱛ',
- 'ⱜ' => 'Ⱜ',
- 'ⱝ' => 'Ⱝ',
- 'ⱞ' => 'Ⱞ',
- 'ⱡ' => 'Ⱡ',
- 'ⱥ' => 'Ⱥ',
- 'ⱦ' => 'Ⱦ',
- 'ⱨ' => 'Ⱨ',
- 'ⱪ' => 'Ⱪ',
- 'ⱬ' => 'Ⱬ',
- 'ⱳ' => 'Ⱳ',
- 'ⱶ' => 'Ⱶ',
- 'ⲁ' => 'Ⲁ',
- 'ⲃ' => 'Ⲃ',
- 'ⲅ' => 'Ⲅ',
- 'ⲇ' => 'Ⲇ',
- 'ⲉ' => 'Ⲉ',
- 'ⲋ' => 'Ⲋ',
- 'ⲍ' => 'Ⲍ',
- 'ⲏ' => 'Ⲏ',
- 'ⲑ' => 'Ⲑ',
- 'ⲓ' => 'Ⲓ',
- 'ⲕ' => 'Ⲕ',
- 'ⲗ' => 'Ⲗ',
- 'ⲙ' => 'Ⲙ',
- 'ⲛ' => 'Ⲛ',
- 'ⲝ' => 'Ⲝ',
- 'ⲟ' => 'Ⲟ',
- 'ⲡ' => 'Ⲡ',
- 'ⲣ' => 'Ⲣ',
- 'ⲥ' => 'Ⲥ',
- 'ⲧ' => 'Ⲧ',
- 'ⲩ' => 'Ⲩ',
- 'ⲫ' => 'Ⲫ',
- 'ⲭ' => 'Ⲭ',
- 'ⲯ' => 'Ⲯ',
- 'ⲱ' => 'Ⲱ',
- 'ⲳ' => 'Ⲳ',
- 'ⲵ' => 'Ⲵ',
- 'ⲷ' => 'Ⲷ',
- 'ⲹ' => 'Ⲹ',
- 'ⲻ' => 'Ⲻ',
- 'ⲽ' => 'Ⲽ',
- 'ⲿ' => 'Ⲿ',
- 'ⳁ' => 'Ⳁ',
- 'ⳃ' => 'Ⳃ',
- 'ⳅ' => 'Ⳅ',
- 'ⳇ' => 'Ⳇ',
- 'ⳉ' => 'Ⳉ',
- 'ⳋ' => 'Ⳋ',
- 'ⳍ' => 'Ⳍ',
- 'ⳏ' => 'Ⳏ',
- 'ⳑ' => 'Ⳑ',
- 'ⳓ' => 'Ⳓ',
- 'ⳕ' => 'Ⳕ',
- 'ⳗ' => 'Ⳗ',
- 'ⳙ' => 'Ⳙ',
- 'ⳛ' => 'Ⳛ',
- 'ⳝ' => 'Ⳝ',
- 'ⳟ' => 'Ⳟ',
- 'ⳡ' => 'Ⳡ',
- 'ⳣ' => 'Ⳣ',
- 'ⳬ' => 'Ⳬ',
- 'ⳮ' => 'Ⳮ',
- 'ⳳ' => 'Ⳳ',
- 'ⴀ' => 'Ⴀ',
- 'ⴁ' => 'Ⴁ',
- 'ⴂ' => 'Ⴂ',
- 'ⴃ' => 'Ⴃ',
- 'ⴄ' => 'Ⴄ',
- 'ⴅ' => 'Ⴅ',
- 'ⴆ' => 'Ⴆ',
- 'ⴇ' => 'Ⴇ',
- 'ⴈ' => 'Ⴈ',
- 'ⴉ' => 'Ⴉ',
- 'ⴊ' => 'Ⴊ',
- 'ⴋ' => 'Ⴋ',
- 'ⴌ' => 'Ⴌ',
- 'ⴍ' => 'Ⴍ',
- 'ⴎ' => 'Ⴎ',
- 'ⴏ' => 'Ⴏ',
- 'ⴐ' => 'Ⴐ',
- 'ⴑ' => 'Ⴑ',
- 'ⴒ' => 'Ⴒ',
- 'ⴓ' => 'Ⴓ',
- 'ⴔ' => 'Ⴔ',
- 'ⴕ' => 'Ⴕ',
- 'ⴖ' => 'Ⴖ',
- 'ⴗ' => 'Ⴗ',
- 'ⴘ' => 'Ⴘ',
- 'ⴙ' => 'Ⴙ',
- 'ⴚ' => 'Ⴚ',
- 'ⴛ' => 'Ⴛ',
- 'ⴜ' => 'Ⴜ',
- 'ⴝ' => 'Ⴝ',
- 'ⴞ' => 'Ⴞ',
- 'ⴟ' => 'Ⴟ',
- 'ⴠ' => 'Ⴠ',
- 'ⴡ' => 'Ⴡ',
- 'ⴢ' => 'Ⴢ',
- 'ⴣ' => 'Ⴣ',
- 'ⴤ' => 'Ⴤ',
- 'ⴥ' => 'Ⴥ',
- 'ⴧ' => 'Ⴧ',
- 'ⴭ' => 'Ⴭ',
- 'ꙁ' => 'Ꙁ',
- 'ꙃ' => 'Ꙃ',
- 'ꙅ' => 'Ꙅ',
- 'ꙇ' => 'Ꙇ',
- 'ꙉ' => 'Ꙉ',
- 'ꙋ' => 'Ꙋ',
- 'ꙍ' => 'Ꙍ',
- 'ꙏ' => 'Ꙏ',
- 'ꙑ' => 'Ꙑ',
- 'ꙓ' => 'Ꙓ',
- 'ꙕ' => 'Ꙕ',
- 'ꙗ' => 'Ꙗ',
- 'ꙙ' => 'Ꙙ',
- 'ꙛ' => 'Ꙛ',
- 'ꙝ' => 'Ꙝ',
- 'ꙟ' => 'Ꙟ',
- 'ꙡ' => 'Ꙡ',
- 'ꙣ' => 'Ꙣ',
- 'ꙥ' => 'Ꙥ',
- 'ꙧ' => 'Ꙧ',
- 'ꙩ' => 'Ꙩ',
- 'ꙫ' => 'Ꙫ',
- 'ꙭ' => 'Ꙭ',
- 'ꚁ' => 'Ꚁ',
- 'ꚃ' => 'Ꚃ',
- 'ꚅ' => 'Ꚅ',
- 'ꚇ' => 'Ꚇ',
- 'ꚉ' => 'Ꚉ',
- 'ꚋ' => 'Ꚋ',
- 'ꚍ' => 'Ꚍ',
- 'ꚏ' => 'Ꚏ',
- 'ꚑ' => 'Ꚑ',
- 'ꚓ' => 'Ꚓ',
- 'ꚕ' => 'Ꚕ',
- 'ꚗ' => 'Ꚗ',
- 'ꚙ' => 'Ꚙ',
- 'ꚛ' => 'Ꚛ',
- 'ꜣ' => 'Ꜣ',
- 'ꜥ' => 'Ꜥ',
- 'ꜧ' => 'Ꜧ',
- 'ꜩ' => 'Ꜩ',
- 'ꜫ' => 'Ꜫ',
- 'ꜭ' => 'Ꜭ',
- 'ꜯ' => 'Ꜯ',
- 'ꜳ' => 'Ꜳ',
- 'ꜵ' => 'Ꜵ',
- 'ꜷ' => 'Ꜷ',
- 'ꜹ' => 'Ꜹ',
- 'ꜻ' => 'Ꜻ',
- 'ꜽ' => 'Ꜽ',
- 'ꜿ' => 'Ꜿ',
- 'ꝁ' => 'Ꝁ',
- 'ꝃ' => 'Ꝃ',
- 'ꝅ' => 'Ꝅ',
- 'ꝇ' => 'Ꝇ',
- 'ꝉ' => 'Ꝉ',
- 'ꝋ' => 'Ꝋ',
- 'ꝍ' => 'Ꝍ',
- 'ꝏ' => 'Ꝏ',
- 'ꝑ' => 'Ꝑ',
- 'ꝓ' => 'Ꝓ',
- 'ꝕ' => 'Ꝕ',
- 'ꝗ' => 'Ꝗ',
- 'ꝙ' => 'Ꝙ',
- 'ꝛ' => 'Ꝛ',
- 'ꝝ' => 'Ꝝ',
- 'ꝟ' => 'Ꝟ',
- 'ꝡ' => 'Ꝡ',
- 'ꝣ' => 'Ꝣ',
- 'ꝥ' => 'Ꝥ',
- 'ꝧ' => 'Ꝧ',
- 'ꝩ' => 'Ꝩ',
- 'ꝫ' => 'Ꝫ',
- 'ꝭ' => 'Ꝭ',
- 'ꝯ' => 'Ꝯ',
- 'ꝺ' => 'Ꝺ',
- 'ꝼ' => 'Ꝼ',
- 'ꝿ' => 'Ꝿ',
- 'ꞁ' => 'Ꞁ',
- 'ꞃ' => 'Ꞃ',
- 'ꞅ' => 'Ꞅ',
- 'ꞇ' => 'Ꞇ',
- 'ꞌ' => 'Ꞌ',
- 'ꞑ' => 'Ꞑ',
- 'ꞓ' => 'Ꞓ',
- 'ꞔ' => 'Ꞔ',
- 'ꞗ' => 'Ꞗ',
- 'ꞙ' => 'Ꞙ',
- 'ꞛ' => 'Ꞛ',
- 'ꞝ' => 'Ꞝ',
- 'ꞟ' => 'Ꞟ',
- 'ꞡ' => 'Ꞡ',
- 'ꞣ' => 'Ꞣ',
- 'ꞥ' => 'Ꞥ',
- 'ꞧ' => 'Ꞧ',
- 'ꞩ' => 'Ꞩ',
- 'ꞵ' => 'Ꞵ',
- 'ꞷ' => 'Ꞷ',
- 'ꞹ' => 'Ꞹ',
- 'ꞻ' => 'Ꞻ',
- 'ꞽ' => 'Ꞽ',
- 'ꞿ' => 'Ꞿ',
- 'ꟃ' => 'Ꟃ',
- 'ꟈ' => 'Ꟈ',
- 'ꟊ' => 'Ꟊ',
- 'ꟶ' => 'Ꟶ',
- 'ꭓ' => 'Ꭓ',
- 'ꭰ' => 'Ꭰ',
- 'ꭱ' => 'Ꭱ',
- 'ꭲ' => 'Ꭲ',
- 'ꭳ' => 'Ꭳ',
- 'ꭴ' => 'Ꭴ',
- 'ꭵ' => 'Ꭵ',
- 'ꭶ' => 'Ꭶ',
- 'ꭷ' => 'Ꭷ',
- 'ꭸ' => 'Ꭸ',
- 'ꭹ' => 'Ꭹ',
- 'ꭺ' => 'Ꭺ',
- 'ꭻ' => 'Ꭻ',
- 'ꭼ' => 'Ꭼ',
- 'ꭽ' => 'Ꭽ',
- 'ꭾ' => 'Ꭾ',
- 'ꭿ' => 'Ꭿ',
- 'ꮀ' => 'Ꮀ',
- 'ꮁ' => 'Ꮁ',
- 'ꮂ' => 'Ꮂ',
- 'ꮃ' => 'Ꮃ',
- 'ꮄ' => 'Ꮄ',
- 'ꮅ' => 'Ꮅ',
- 'ꮆ' => 'Ꮆ',
- 'ꮇ' => 'Ꮇ',
- 'ꮈ' => 'Ꮈ',
- 'ꮉ' => 'Ꮉ',
- 'ꮊ' => 'Ꮊ',
- 'ꮋ' => 'Ꮋ',
- 'ꮌ' => 'Ꮌ',
- 'ꮍ' => 'Ꮍ',
- 'ꮎ' => 'Ꮎ',
- 'ꮏ' => 'Ꮏ',
- 'ꮐ' => 'Ꮐ',
- 'ꮑ' => 'Ꮑ',
- 'ꮒ' => 'Ꮒ',
- 'ꮓ' => 'Ꮓ',
- 'ꮔ' => 'Ꮔ',
- 'ꮕ' => 'Ꮕ',
- 'ꮖ' => 'Ꮖ',
- 'ꮗ' => 'Ꮗ',
- 'ꮘ' => 'Ꮘ',
- 'ꮙ' => 'Ꮙ',
- 'ꮚ' => 'Ꮚ',
- 'ꮛ' => 'Ꮛ',
- 'ꮜ' => 'Ꮜ',
- 'ꮝ' => 'Ꮝ',
- 'ꮞ' => 'Ꮞ',
- 'ꮟ' => 'Ꮟ',
- 'ꮠ' => 'Ꮠ',
- 'ꮡ' => 'Ꮡ',
- 'ꮢ' => 'Ꮢ',
- 'ꮣ' => 'Ꮣ',
- 'ꮤ' => 'Ꮤ',
- 'ꮥ' => 'Ꮥ',
- 'ꮦ' => 'Ꮦ',
- 'ꮧ' => 'Ꮧ',
- 'ꮨ' => 'Ꮨ',
- 'ꮩ' => 'Ꮩ',
- 'ꮪ' => 'Ꮪ',
- 'ꮫ' => 'Ꮫ',
- 'ꮬ' => 'Ꮬ',
- 'ꮭ' => 'Ꮭ',
- 'ꮮ' => 'Ꮮ',
- 'ꮯ' => 'Ꮯ',
- 'ꮰ' => 'Ꮰ',
- 'ꮱ' => 'Ꮱ',
- 'ꮲ' => 'Ꮲ',
- 'ꮳ' => 'Ꮳ',
- 'ꮴ' => 'Ꮴ',
- 'ꮵ' => 'Ꮵ',
- 'ꮶ' => 'Ꮶ',
- 'ꮷ' => 'Ꮷ',
- 'ꮸ' => 'Ꮸ',
- 'ꮹ' => 'Ꮹ',
- 'ꮺ' => 'Ꮺ',
- 'ꮻ' => 'Ꮻ',
- 'ꮼ' => 'Ꮼ',
- 'ꮽ' => 'Ꮽ',
- 'ꮾ' => 'Ꮾ',
- 'ꮿ' => 'Ꮿ',
- 'a' => 'A',
- 'b' => 'B',
- 'c' => 'C',
- 'd' => 'D',
- 'e' => 'E',
- 'f' => 'F',
- 'g' => 'G',
- 'h' => 'H',
- 'i' => 'I',
- 'j' => 'J',
- 'k' => 'K',
- 'l' => 'L',
- 'm' => 'M',
- 'n' => 'N',
- 'o' => 'O',
- 'p' => 'P',
- 'q' => 'Q',
- 'r' => 'R',
- 's' => 'S',
- 't' => 'T',
- 'u' => 'U',
- 'v' => 'V',
- 'w' => 'W',
- 'x' => 'X',
- 'y' => 'Y',
- 'z' => 'Z',
- '𐐨' => '𐐀',
- '𐐩' => '𐐁',
- '𐐪' => '𐐂',
- '𐐫' => '𐐃',
- '𐐬' => '𐐄',
- '𐐭' => '𐐅',
- '𐐮' => '𐐆',
- '𐐯' => '𐐇',
- '𐐰' => '𐐈',
- '𐐱' => '𐐉',
- '𐐲' => '𐐊',
- '𐐳' => '𐐋',
- '𐐴' => '𐐌',
- '𐐵' => '𐐍',
- '𐐶' => '𐐎',
- '𐐷' => '𐐏',
- '𐐸' => '𐐐',
- '𐐹' => '𐐑',
- '𐐺' => '𐐒',
- '𐐻' => '𐐓',
- '𐐼' => '𐐔',
- '𐐽' => '𐐕',
- '𐐾' => '𐐖',
- '𐐿' => '𐐗',
- '𐑀' => '𐐘',
- '𐑁' => '𐐙',
- '𐑂' => '𐐚',
- '𐑃' => '𐐛',
- '𐑄' => '𐐜',
- '𐑅' => '𐐝',
- '𐑆' => '𐐞',
- '𐑇' => '𐐟',
- '𐑈' => '𐐠',
- '𐑉' => '𐐡',
- '𐑊' => '𐐢',
- '𐑋' => '𐐣',
- '𐑌' => '𐐤',
- '𐑍' => '𐐥',
- '𐑎' => '𐐦',
- '𐑏' => '𐐧',
- '𐓘' => '𐒰',
- '𐓙' => '𐒱',
- '𐓚' => '𐒲',
- '𐓛' => '𐒳',
- '𐓜' => '𐒴',
- '𐓝' => '𐒵',
- '𐓞' => '𐒶',
- '𐓟' => '𐒷',
- '𐓠' => '𐒸',
- '𐓡' => '𐒹',
- '𐓢' => '𐒺',
- '𐓣' => '𐒻',
- '𐓤' => '𐒼',
- '𐓥' => '𐒽',
- '𐓦' => '𐒾',
- '𐓧' => '𐒿',
- '𐓨' => '𐓀',
- '𐓩' => '𐓁',
- '𐓪' => '𐓂',
- '𐓫' => '𐓃',
- '𐓬' => '𐓄',
- '𐓭' => '𐓅',
- '𐓮' => '𐓆',
- '𐓯' => '𐓇',
- '𐓰' => '𐓈',
- '𐓱' => '𐓉',
- '𐓲' => '𐓊',
- '𐓳' => '𐓋',
- '𐓴' => '𐓌',
- '𐓵' => '𐓍',
- '𐓶' => '𐓎',
- '𐓷' => '𐓏',
- '𐓸' => '𐓐',
- '𐓹' => '𐓑',
- '𐓺' => '𐓒',
- '𐓻' => '𐓓',
- '𐳀' => '𐲀',
- '𐳁' => '𐲁',
- '𐳂' => '𐲂',
- '𐳃' => '𐲃',
- '𐳄' => '𐲄',
- '𐳅' => '𐲅',
- '𐳆' => '𐲆',
- '𐳇' => '𐲇',
- '𐳈' => '𐲈',
- '𐳉' => '𐲉',
- '𐳊' => '𐲊',
- '𐳋' => '𐲋',
- '𐳌' => '𐲌',
- '𐳍' => '𐲍',
- '𐳎' => '𐲎',
- '𐳏' => '𐲏',
- '𐳐' => '𐲐',
- '𐳑' => '𐲑',
- '𐳒' => '𐲒',
- '𐳓' => '𐲓',
- '𐳔' => '𐲔',
- '𐳕' => '𐲕',
- '𐳖' => '𐲖',
- '𐳗' => '𐲗',
- '𐳘' => '𐲘',
- '𐳙' => '𐲙',
- '𐳚' => '𐲚',
- '𐳛' => '𐲛',
- '𐳜' => '𐲜',
- '𐳝' => '𐲝',
- '𐳞' => '𐲞',
- '𐳟' => '𐲟',
- '𐳠' => '𐲠',
- '𐳡' => '𐲡',
- '𐳢' => '𐲢',
- '𐳣' => '𐲣',
- '𐳤' => '𐲤',
- '𐳥' => '𐲥',
- '𐳦' => '𐲦',
- '𐳧' => '𐲧',
- '𐳨' => '𐲨',
- '𐳩' => '𐲩',
- '𐳪' => '𐲪',
- '𐳫' => '𐲫',
- '𐳬' => '𐲬',
- '𐳭' => '𐲭',
- '𐳮' => '𐲮',
- '𐳯' => '𐲯',
- '𐳰' => '𐲰',
- '𐳱' => '𐲱',
- '𐳲' => '𐲲',
- '𑣀' => '𑢠',
- '𑣁' => '𑢡',
- '𑣂' => '𑢢',
- '𑣃' => '𑢣',
- '𑣄' => '𑢤',
- '𑣅' => '𑢥',
- '𑣆' => '𑢦',
- '𑣇' => '𑢧',
- '𑣈' => '𑢨',
- '𑣉' => '𑢩',
- '𑣊' => '𑢪',
- '𑣋' => '𑢫',
- '𑣌' => '𑢬',
- '𑣍' => '𑢭',
- '𑣎' => '𑢮',
- '𑣏' => '𑢯',
- '𑣐' => '𑢰',
- '𑣑' => '𑢱',
- '𑣒' => '𑢲',
- '𑣓' => '𑢳',
- '𑣔' => '𑢴',
- '𑣕' => '𑢵',
- '𑣖' => '𑢶',
- '𑣗' => '𑢷',
- '𑣘' => '𑢸',
- '𑣙' => '𑢹',
- '𑣚' => '𑢺',
- '𑣛' => '𑢻',
- '𑣜' => '𑢼',
- '𑣝' => '𑢽',
- '𑣞' => '𑢾',
- '𑣟' => '𑢿',
- '𖹠' => '𖹀',
- '𖹡' => '𖹁',
- '𖹢' => '𖹂',
- '𖹣' => '𖹃',
- '𖹤' => '𖹄',
- '𖹥' => '𖹅',
- '𖹦' => '𖹆',
- '𖹧' => '𖹇',
- '𖹨' => '𖹈',
- '𖹩' => '𖹉',
- '𖹪' => '𖹊',
- '𖹫' => '𖹋',
- '𖹬' => '𖹌',
- '𖹭' => '𖹍',
- '𖹮' => '𖹎',
- '𖹯' => '𖹏',
- '𖹰' => '𖹐',
- '𖹱' => '𖹑',
- '𖹲' => '𖹒',
- '𖹳' => '𖹓',
- '𖹴' => '𖹔',
- '𖹵' => '𖹕',
- '𖹶' => '𖹖',
- '𖹷' => '𖹗',
- '𖹸' => '𖹘',
- '𖹹' => '𖹙',
- '𖹺' => '𖹚',
- '𖹻' => '𖹛',
- '𖹼' => '𖹜',
- '𖹽' => '𖹝',
- '𖹾' => '𖹞',
- '𖹿' => '𖹟',
- '𞤢' => '𞤀',
- '𞤣' => '𞤁',
- '𞤤' => '𞤂',
- '𞤥' => '𞤃',
- '𞤦' => '𞤄',
- '𞤧' => '𞤅',
- '𞤨' => '𞤆',
- '𞤩' => '𞤇',
- '𞤪' => '𞤈',
- '𞤫' => '𞤉',
- '𞤬' => '𞤊',
- '𞤭' => '𞤋',
- '𞤮' => '𞤌',
- '𞤯' => '𞤍',
- '𞤰' => '𞤎',
- '𞤱' => '𞤏',
- '𞤲' => '𞤐',
- '𞤳' => '𞤑',
- '𞤴' => '𞤒',
- '𞤵' => '𞤓',
- '𞤶' => '𞤔',
- '𞤷' => '𞤕',
- '𞤸' => '𞤖',
- '𞤹' => '𞤗',
- '𞤺' => '𞤘',
- '𞤻' => '𞤙',
- '𞤼' => '𞤚',
- '𞤽' => '𞤛',
- '𞤾' => '𞤜',
- '𞤿' => '𞤝',
- '𞥀' => '𞤞',
- '𞥁' => '𞤟',
- '𞥂' => '𞤠',
- '𞥃' => '𞤡',
- 'ß' => 'SS',
- 'ff' => 'FF',
- 'fi' => 'FI',
- 'fl' => 'FL',
- 'ffi' => 'FFI',
- 'ffl' => 'FFL',
- 'ſt' => 'ST',
- 'st' => 'ST',
- 'և' => 'ԵՒ',
- 'ﬓ' => 'ՄՆ',
- 'ﬔ' => 'ՄԵ',
- 'ﬕ' => 'ՄԻ',
- 'ﬖ' => 'ՎՆ',
- 'ﬗ' => 'ՄԽ',
- 'ʼn' => 'ʼN',
- 'ΐ' => 'Ϊ́',
- 'ΰ' => 'Ϋ́',
- 'ǰ' => 'J̌',
- 'ẖ' => 'H̱',
- 'ẗ' => 'T̈',
- 'ẘ' => 'W̊',
- 'ẙ' => 'Y̊',
- 'ẚ' => 'Aʾ',
- 'ὐ' => 'Υ̓',
- 'ὒ' => 'Υ̓̀',
- 'ὔ' => 'Υ̓́',
- 'ὖ' => 'Υ̓͂',
- 'ᾶ' => 'Α͂',
- 'ῆ' => 'Η͂',
- 'ῒ' => 'Ϊ̀',
- 'ΐ' => 'Ϊ́',
- 'ῖ' => 'Ι͂',
- 'ῗ' => 'Ϊ͂',
- 'ῢ' => 'Ϋ̀',
- 'ΰ' => 'Ϋ́',
- 'ῤ' => 'Ρ̓',
- 'ῦ' => 'Υ͂',
- 'ῧ' => 'Ϋ͂',
- 'ῶ' => 'Ω͂',
- 'ᾈ' => 'ἈΙ',
- 'ᾉ' => 'ἉΙ',
- 'ᾊ' => 'ἊΙ',
- 'ᾋ' => 'ἋΙ',
- 'ᾌ' => 'ἌΙ',
- 'ᾍ' => 'ἍΙ',
- 'ᾎ' => 'ἎΙ',
- 'ᾏ' => 'ἏΙ',
- 'ᾘ' => 'ἨΙ',
- 'ᾙ' => 'ἩΙ',
- 'ᾚ' => 'ἪΙ',
- 'ᾛ' => 'ἫΙ',
- 'ᾜ' => 'ἬΙ',
- 'ᾝ' => 'ἭΙ',
- 'ᾞ' => 'ἮΙ',
- 'ᾟ' => 'ἯΙ',
- 'ᾨ' => 'ὨΙ',
- 'ᾩ' => 'ὩΙ',
- 'ᾪ' => 'ὪΙ',
- 'ᾫ' => 'ὫΙ',
- 'ᾬ' => 'ὬΙ',
- 'ᾭ' => 'ὭΙ',
- 'ᾮ' => 'ὮΙ',
- 'ᾯ' => 'ὯΙ',
- 'ᾼ' => 'ΑΙ',
- 'ῌ' => 'ΗΙ',
- 'ῼ' => 'ΩΙ',
- 'ᾲ' => 'ᾺΙ',
- 'ᾴ' => 'ΆΙ',
- 'ῂ' => 'ῊΙ',
- 'ῄ' => 'ΉΙ',
- 'ῲ' => 'ῺΙ',
- 'ῴ' => 'ΏΙ',
- 'ᾷ' => 'Α͂Ι',
- 'ῇ' => 'Η͂Ι',
- 'ῷ' => 'Ω͂Ι',
-);
diff --git a/vendor/symfony/polyfill-mbstring/bootstrap.php b/vendor/symfony/polyfill-mbstring/bootstrap.php
deleted file mode 100644
index 1fedd1f..0000000
--- a/vendor/symfony/polyfill-mbstring/bootstrap.php
+++ /dev/null
@@ -1,147 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-use Symfony\Polyfill\Mbstring as p;
-
-if (\PHP_VERSION_ID >= 80000) {
- return require __DIR__.'/bootstrap80.php';
-}
-
-if (!function_exists('mb_convert_encoding')) {
- function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); }
-}
-if (!function_exists('mb_decode_mimeheader')) {
- function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); }
-}
-if (!function_exists('mb_encode_mimeheader')) {
- function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); }
-}
-if (!function_exists('mb_decode_numericentity')) {
- function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); }
-}
-if (!function_exists('mb_encode_numericentity')) {
- function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); }
-}
-if (!function_exists('mb_convert_case')) {
- function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); }
-}
-if (!function_exists('mb_internal_encoding')) {
- function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); }
-}
-if (!function_exists('mb_language')) {
- function mb_language($language = null) { return p\Mbstring::mb_language($language); }
-}
-if (!function_exists('mb_list_encodings')) {
- function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); }
-}
-if (!function_exists('mb_encoding_aliases')) {
- function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); }
-}
-if (!function_exists('mb_check_encoding')) {
- function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); }
-}
-if (!function_exists('mb_detect_encoding')) {
- function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); }
-}
-if (!function_exists('mb_detect_order')) {
- function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); }
-}
-if (!function_exists('mb_parse_str')) {
- function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; }
-}
-if (!function_exists('mb_strlen')) {
- function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); }
-}
-if (!function_exists('mb_strpos')) {
- function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); }
-}
-if (!function_exists('mb_strtolower')) {
- function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); }
-}
-if (!function_exists('mb_strtoupper')) {
- function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); }
-}
-if (!function_exists('mb_substitute_character')) {
- function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); }
-}
-if (!function_exists('mb_substr')) {
- function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); }
-}
-if (!function_exists('mb_stripos')) {
- function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); }
-}
-if (!function_exists('mb_stristr')) {
- function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); }
-}
-if (!function_exists('mb_strrchr')) {
- function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); }
-}
-if (!function_exists('mb_strrichr')) {
- function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); }
-}
-if (!function_exists('mb_strripos')) {
- function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); }
-}
-if (!function_exists('mb_strrpos')) {
- function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); }
-}
-if (!function_exists('mb_strstr')) {
- function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); }
-}
-if (!function_exists('mb_get_info')) {
- function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); }
-}
-if (!function_exists('mb_http_output')) {
- function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); }
-}
-if (!function_exists('mb_strwidth')) {
- function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); }
-}
-if (!function_exists('mb_substr_count')) {
- function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); }
-}
-if (!function_exists('mb_output_handler')) {
- function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); }
-}
-if (!function_exists('mb_http_input')) {
- function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); }
-}
-
-if (!function_exists('mb_convert_variables')) {
- function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); }
-}
-
-if (!function_exists('mb_ord')) {
- function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); }
-}
-if (!function_exists('mb_chr')) {
- function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); }
-}
-if (!function_exists('mb_scrub')) {
- function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); }
-}
-if (!function_exists('mb_str_split')) {
- function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); }
-}
-
-if (extension_loaded('mbstring')) {
- return;
-}
-
-if (!defined('MB_CASE_UPPER')) {
- define('MB_CASE_UPPER', 0);
-}
-if (!defined('MB_CASE_LOWER')) {
- define('MB_CASE_LOWER', 1);
-}
-if (!defined('MB_CASE_TITLE')) {
- define('MB_CASE_TITLE', 2);
-}
diff --git a/vendor/symfony/polyfill-mbstring/bootstrap80.php b/vendor/symfony/polyfill-mbstring/bootstrap80.php
deleted file mode 100644
index 82f5ac4..0000000
--- a/vendor/symfony/polyfill-mbstring/bootstrap80.php
+++ /dev/null
@@ -1,143 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-use Symfony\Polyfill\Mbstring as p;
-
-if (!function_exists('mb_convert_encoding')) {
- function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); }
-}
-if (!function_exists('mb_decode_mimeheader')) {
- function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); }
-}
-if (!function_exists('mb_encode_mimeheader')) {
- function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); }
-}
-if (!function_exists('mb_decode_numericentity')) {
- function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); }
-}
-if (!function_exists('mb_encode_numericentity')) {
- function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); }
-}
-if (!function_exists('mb_convert_case')) {
- function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); }
-}
-if (!function_exists('mb_internal_encoding')) {
- function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); }
-}
-if (!function_exists('mb_language')) {
- function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); }
-}
-if (!function_exists('mb_list_encodings')) {
- function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); }
-}
-if (!function_exists('mb_encoding_aliases')) {
- function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); }
-}
-if (!function_exists('mb_check_encoding')) {
- function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); }
-}
-if (!function_exists('mb_detect_encoding')) {
- function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); }
-}
-if (!function_exists('mb_detect_order')) {
- function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); }
-}
-if (!function_exists('mb_parse_str')) {
- function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; }
-}
-if (!function_exists('mb_strlen')) {
- function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); }
-}
-if (!function_exists('mb_strpos')) {
- function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
-}
-if (!function_exists('mb_strtolower')) {
- function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); }
-}
-if (!function_exists('mb_strtoupper')) {
- function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); }
-}
-if (!function_exists('mb_substitute_character')) {
- function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); }
-}
-if (!function_exists('mb_substr')) {
- function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); }
-}
-if (!function_exists('mb_stripos')) {
- function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
-}
-if (!function_exists('mb_stristr')) {
- function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
-}
-if (!function_exists('mb_strrchr')) {
- function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
-}
-if (!function_exists('mb_strrichr')) {
- function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
-}
-if (!function_exists('mb_strripos')) {
- function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
-}
-if (!function_exists('mb_strrpos')) {
- function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
-}
-if (!function_exists('mb_strstr')) {
- function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
-}
-if (!function_exists('mb_get_info')) {
- function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); }
-}
-if (!function_exists('mb_http_output')) {
- function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); }
-}
-if (!function_exists('mb_strwidth')) {
- function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); }
-}
-if (!function_exists('mb_substr_count')) {
- function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); }
-}
-if (!function_exists('mb_output_handler')) {
- function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); }
-}
-if (!function_exists('mb_http_input')) {
- function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); }
-}
-
-if (!function_exists('mb_convert_variables')) {
- function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); }
-}
-
-if (!function_exists('mb_ord')) {
- function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); }
-}
-if (!function_exists('mb_chr')) {
- function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); }
-}
-if (!function_exists('mb_scrub')) {
- function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); }
-}
-if (!function_exists('mb_str_split')) {
- function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); }
-}
-
-if (extension_loaded('mbstring')) {
- return;
-}
-
-if (!defined('MB_CASE_UPPER')) {
- define('MB_CASE_UPPER', 0);
-}
-if (!defined('MB_CASE_LOWER')) {
- define('MB_CASE_LOWER', 1);
-}
-if (!defined('MB_CASE_TITLE')) {
- define('MB_CASE_TITLE', 2);
-}
diff --git a/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json
deleted file mode 100644
index 4489553..0000000
--- a/vendor/symfony/polyfill-mbstring/composer.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "name": "symfony/polyfill-mbstring",
- "type": "library",
- "description": "Symfony polyfill for the Mbstring extension",
- "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"],
- "homepage": "https://symfony.com",
- "license": "MIT",
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "require": {
- "php": ">=7.1"
- },
- "provide": {
- "ext-mbstring": "*"
- },
- "autoload": {
- "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" },
- "files": [ "bootstrap.php" ]
- },
- "suggest": {
- "ext-mbstring": "For best performance"
- },
- "minimum-stability": "dev",
- "extra": {
- "branch-alias": {
- "dev-main": "1.27-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- }
-}
diff --git a/vendor/symfony/polyfill-php72/LICENSE b/vendor/symfony/polyfill-php72/LICENSE
deleted file mode 100644
index 4cd8bdd..0000000
--- a/vendor/symfony/polyfill-php72/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2015-2019 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.
diff --git a/vendor/symfony/polyfill-php72/Php72.php b/vendor/symfony/polyfill-php72/Php72.php
deleted file mode 100644
index 7bf96c9..0000000
--- a/vendor/symfony/polyfill-php72/Php72.php
+++ /dev/null
@@ -1,217 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Polyfill\Php72;
-
-/**
- * @author Nicolas Grekas
- * @author Dariusz Rumiński
- *
- * @internal
- */
-final class Php72
-{
- private static $hashMask;
-
- public static function utf8_encode($s)
- {
- $s .= $s;
- $len = \strlen($s);
-
- for ($i = $len >> 1, $j = 0; $i < $len; ++$i, ++$j) {
- switch (true) {
- case $s[$i] < "\x80": $s[$j] = $s[$i]; break;
- case $s[$i] < "\xC0": $s[$j] = "\xC2"; $s[++$j] = $s[$i]; break;
- default: $s[$j] = "\xC3"; $s[++$j] = \chr(\ord($s[$i]) - 64); break;
- }
- }
-
- return substr($s, 0, $j);
- }
-
- public static function utf8_decode($s)
- {
- $s = (string) $s;
- $len = \strlen($s);
-
- for ($i = 0, $j = 0; $i < $len; ++$i, ++$j) {
- switch ($s[$i] & "\xF0") {
- case "\xC0":
- case "\xD0":
- $c = (\ord($s[$i] & "\x1F") << 6) | \ord($s[++$i] & "\x3F");
- $s[$j] = $c < 256 ? \chr($c) : '?';
- break;
-
- case "\xF0":
- ++$i;
- // no break
-
- case "\xE0":
- $s[$j] = '?';
- $i += 2;
- break;
-
- default:
- $s[$j] = $s[$i];
- }
- }
-
- return substr($s, 0, $j);
- }
-
- public static function php_os_family()
- {
- if ('\\' === \DIRECTORY_SEPARATOR) {
- return 'Windows';
- }
-
- $map = [
- 'Darwin' => 'Darwin',
- 'DragonFly' => 'BSD',
- 'FreeBSD' => 'BSD',
- 'NetBSD' => 'BSD',
- 'OpenBSD' => 'BSD',
- 'Linux' => 'Linux',
- 'SunOS' => 'Solaris',
- ];
-
- return $map[\PHP_OS] ?? 'Unknown';
- }
-
- public static function spl_object_id($object)
- {
- if (null === self::$hashMask) {
- self::initHashMask();
- }
- if (null === $hash = spl_object_hash($object)) {
- return;
- }
-
- // On 32-bit systems, PHP_INT_SIZE is 4,
- return self::$hashMask ^ hexdec(substr($hash, 16 - (\PHP_INT_SIZE * 2 - 1), \PHP_INT_SIZE * 2 - 1));
- }
-
- public static function sapi_windows_vt100_support($stream, $enable = null)
- {
- if (!\is_resource($stream)) {
- trigger_error('sapi_windows_vt100_support() expects parameter 1 to be resource, '.\gettype($stream).' given', \E_USER_WARNING);
-
- return false;
- }
-
- $meta = stream_get_meta_data($stream);
-
- if ('STDIO' !== $meta['stream_type']) {
- trigger_error('sapi_windows_vt100_support() was not able to analyze the specified stream', \E_USER_WARNING);
-
- return false;
- }
-
- // We cannot actually disable vt100 support if it is set
- if (false === $enable || !self::stream_isatty($stream)) {
- return false;
- }
-
- // The native function does not apply to stdin
- $meta = array_map('strtolower', $meta);
- $stdin = 'php://stdin' === $meta['uri'] || 'php://fd/0' === $meta['uri'];
-
- return !$stdin
- && (false !== getenv('ANSICON')
- || 'ON' === getenv('ConEmuANSI')
- || 'xterm' === getenv('TERM')
- || 'Hyper' === getenv('TERM_PROGRAM'));
- }
-
- public static function stream_isatty($stream)
- {
- if (!\is_resource($stream)) {
- trigger_error('stream_isatty() expects parameter 1 to be resource, '.\gettype($stream).' given', \E_USER_WARNING);
-
- return false;
- }
-
- if ('\\' === \DIRECTORY_SEPARATOR) {
- $stat = @fstat($stream);
- // Check if formatted mode is S_IFCHR
- return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
- }
-
- return \function_exists('posix_isatty') && @posix_isatty($stream);
- }
-
- private static function initHashMask()
- {
- $obj = (object) [];
- self::$hashMask = -1;
-
- // check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below
- $obFuncs = ['ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush'];
- foreach (debug_backtrace(\PHP_VERSION_ID >= 50400 ? \DEBUG_BACKTRACE_IGNORE_ARGS : false) as $frame) {
- if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && \in_array($frame['function'], $obFuncs)) {
- $frame['line'] = 0;
- break;
- }
- }
- if (!empty($frame['line'])) {
- ob_start();
- debug_zval_dump($obj);
- self::$hashMask = (int) substr(ob_get_clean(), 17);
- }
-
- self::$hashMask ^= hexdec(substr(spl_object_hash($obj), 16 - (\PHP_INT_SIZE * 2 - 1), \PHP_INT_SIZE * 2 - 1));
- }
-
- public static function mb_chr($code, $encoding = null)
- {
- if (0x80 > $code %= 0x200000) {
- $s = \chr($code);
- } elseif (0x800 > $code) {
- $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F);
- } elseif (0x10000 > $code) {
- $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F);
- } else {
- $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F);
- }
-
- if ('UTF-8' !== $encoding = $encoding ?? mb_internal_encoding()) {
- $s = mb_convert_encoding($s, $encoding, 'UTF-8');
- }
-
- return $s;
- }
-
- public static function mb_ord($s, $encoding = null)
- {
- if (null === $encoding) {
- $s = mb_convert_encoding($s, 'UTF-8');
- } elseif ('UTF-8' !== $encoding) {
- $s = mb_convert_encoding($s, 'UTF-8', $encoding);
- }
-
- if (1 === \strlen($s)) {
- return \ord($s);
- }
-
- $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0;
- if (0xF0 <= $code) {
- return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80;
- }
- if (0xE0 <= $code) {
- return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80;
- }
- if (0xC0 <= $code) {
- return (($code - 0xC0) << 6) + $s[2] - 0x80;
- }
-
- return $code;
- }
-}
diff --git a/vendor/symfony/polyfill-php72/README.md b/vendor/symfony/polyfill-php72/README.md
deleted file mode 100644
index ed19050..0000000
--- a/vendor/symfony/polyfill-php72/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-Symfony Polyfill / Php72
-========================
-
-This component provides functions added to PHP 7.2 core:
-
-- [`spl_object_id`](https://php.net/spl_object_id)
-- [`stream_isatty`](https://php.net/stream_isatty)
-
-And also functions added to PHP 7.2 mbstring:
-
-- [`mb_ord`](https://php.net/mb_ord)
-- [`mb_chr`](https://php.net/mb_chr)
-- [`mb_scrub`](https://php.net/mb_scrub)
-
-On Windows only:
-
-- [`sapi_windows_vt100_support`](https://php.net/sapi_windows_vt100_support)
-
-Moved to core since 7.2 (was in the optional XML extension earlier):
-
-- [`utf8_encode`](https://php.net/utf8_encode)
-- [`utf8_decode`](https://php.net/utf8_decode)
-
-Also, it provides constants added to PHP 7.2:
-
-- [`PHP_FLOAT_*`](https://php.net/reserved.constants#constant.php-float-dig)
-- [`PHP_OS_FAMILY`](https://php.net/reserved.constants#constant.php-os-family)
-
-More information can be found in the
-[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
-
-License
-=======
-
-This library is released under the [MIT license](LICENSE).
diff --git a/vendor/symfony/polyfill-php72/bootstrap.php b/vendor/symfony/polyfill-php72/bootstrap.php
deleted file mode 100644
index b5c92d4..0000000
--- a/vendor/symfony/polyfill-php72/bootstrap.php
+++ /dev/null
@@ -1,57 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-use Symfony\Polyfill\Php72 as p;
-
-if (\PHP_VERSION_ID >= 70200) {
- return;
-}
-
-if (!defined('PHP_FLOAT_DIG')) {
- define('PHP_FLOAT_DIG', 15);
-}
-if (!defined('PHP_FLOAT_EPSILON')) {
- define('PHP_FLOAT_EPSILON', 2.2204460492503E-16);
-}
-if (!defined('PHP_FLOAT_MIN')) {
- define('PHP_FLOAT_MIN', 2.2250738585072E-308);
-}
-if (!defined('PHP_FLOAT_MAX')) {
- define('PHP_FLOAT_MAX', 1.7976931348623157E+308);
-}
-if (!defined('PHP_OS_FAMILY')) {
- define('PHP_OS_FAMILY', p\Php72::php_os_family());
-}
-
-if ('\\' === \DIRECTORY_SEPARATOR && !function_exists('sapi_windows_vt100_support')) {
- function sapi_windows_vt100_support($stream, $enable = null) { return p\Php72::sapi_windows_vt100_support($stream, $enable); }
-}
-if (!function_exists('stream_isatty')) {
- function stream_isatty($stream) { return p\Php72::stream_isatty($stream); }
-}
-if (!function_exists('utf8_encode')) {
- function utf8_encode($string) { return p\Php72::utf8_encode($string); }
-}
-if (!function_exists('utf8_decode')) {
- function utf8_decode($string) { return p\Php72::utf8_decode($string); }
-}
-if (!function_exists('spl_object_id')) {
- function spl_object_id($object) { return p\Php72::spl_object_id($object); }
-}
-if (!function_exists('mb_ord')) {
- function mb_ord($string, $encoding = null) { return p\Php72::mb_ord($string, $encoding); }
-}
-if (!function_exists('mb_chr')) {
- function mb_chr($codepoint, $encoding = null) { return p\Php72::mb_chr($codepoint, $encoding); }
-}
-if (!function_exists('mb_scrub')) {
- function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); }
-}
diff --git a/vendor/symfony/polyfill-php80/LICENSE b/vendor/symfony/polyfill-php80/LICENSE
deleted file mode 100644
index 5593b1d..0000000
--- a/vendor/symfony/polyfill-php80/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2020 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.
diff --git a/vendor/symfony/polyfill-php80/Php80.php b/vendor/symfony/polyfill-php80/Php80.php
deleted file mode 100644
index 362dd1a..0000000
--- a/vendor/symfony/polyfill-php80/Php80.php
+++ /dev/null
@@ -1,115 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Polyfill\Php80;
-
-/**
- * @author Ion Bazan
- * @author Nico Oelgart
- * @author Nicolas Grekas
- *
- * @internal
- */
-final class Php80
-{
- public static function fdiv(float $dividend, float $divisor): float
- {
- return @($dividend / $divisor);
- }
-
- public static function get_debug_type($value): string
- {
- switch (true) {
- case null === $value: return 'null';
- case \is_bool($value): return 'bool';
- case \is_string($value): return 'string';
- case \is_array($value): return 'array';
- case \is_int($value): return 'int';
- case \is_float($value): return 'float';
- case \is_object($value): break;
- case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class';
- default:
- if (null === $type = @get_resource_type($value)) {
- return 'unknown';
- }
-
- if ('Unknown' === $type) {
- $type = 'closed';
- }
-
- return "resource ($type)";
- }
-
- $class = \get_class($value);
-
- if (false === strpos($class, '@')) {
- return $class;
- }
-
- return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous';
- }
-
- public static function get_resource_id($res): int
- {
- if (!\is_resource($res) && null === @get_resource_type($res)) {
- throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res)));
- }
-
- return (int) $res;
- }
-
- public static function preg_last_error_msg(): string
- {
- switch (preg_last_error()) {
- case \PREG_INTERNAL_ERROR:
- return 'Internal error';
- case \PREG_BAD_UTF8_ERROR:
- return 'Malformed UTF-8 characters, possibly incorrectly encoded';
- case \PREG_BAD_UTF8_OFFSET_ERROR:
- return 'The offset did not correspond to the beginning of a valid UTF-8 code point';
- case \PREG_BACKTRACK_LIMIT_ERROR:
- return 'Backtrack limit exhausted';
- case \PREG_RECURSION_LIMIT_ERROR:
- return 'Recursion limit exhausted';
- case \PREG_JIT_STACKLIMIT_ERROR:
- return 'JIT stack limit exhausted';
- case \PREG_NO_ERROR:
- return 'No error';
- default:
- return 'Unknown error';
- }
- }
-
- public static function str_contains(string $haystack, string $needle): bool
- {
- return '' === $needle || false !== strpos($haystack, $needle);
- }
-
- public static function str_starts_with(string $haystack, string $needle): bool
- {
- return 0 === strncmp($haystack, $needle, \strlen($needle));
- }
-
- public static function str_ends_with(string $haystack, string $needle): bool
- {
- if ('' === $needle || $needle === $haystack) {
- return true;
- }
-
- if ('' === $haystack) {
- return false;
- }
-
- $needleLength = \strlen($needle);
-
- return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength);
- }
-}
diff --git a/vendor/symfony/polyfill-php80/PhpToken.php b/vendor/symfony/polyfill-php80/PhpToken.php
deleted file mode 100644
index fe6e691..0000000
--- a/vendor/symfony/polyfill-php80/PhpToken.php
+++ /dev/null
@@ -1,103 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Polyfill\Php80;
-
-/**
- * @author Fedonyuk Anton
- *
- * @internal
- */
-class PhpToken implements \Stringable
-{
- /**
- * @var int
- */
- public $id;
-
- /**
- * @var string
- */
- public $text;
-
- /**
- * @var int
- */
- public $line;
-
- /**
- * @var int
- */
- public $pos;
-
- public function __construct(int $id, string $text, int $line = -1, int $position = -1)
- {
- $this->id = $id;
- $this->text = $text;
- $this->line = $line;
- $this->pos = $position;
- }
-
- public function getTokenName(): ?string
- {
- if ('UNKNOWN' === $name = token_name($this->id)) {
- $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text;
- }
-
- return $name;
- }
-
- /**
- * @param int|string|array $kind
- */
- public function is($kind): bool
- {
- foreach ((array) $kind as $value) {
- if (\in_array($value, [$this->id, $this->text], true)) {
- return true;
- }
- }
-
- return false;
- }
-
- public function isIgnorable(): bool
- {
- return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true);
- }
-
- public function __toString(): string
- {
- return (string) $this->text;
- }
-
- /**
- * @return static[]
- */
- public static function tokenize(string $code, int $flags = 0): array
- {
- $line = 1;
- $position = 0;
- $tokens = token_get_all($code, $flags);
- foreach ($tokens as $index => $token) {
- if (\is_string($token)) {
- $id = \ord($token);
- $text = $token;
- } else {
- [$id, $text, $line] = $token;
- }
- $tokens[$index] = new static($id, $text, $line, $position);
- $position += \strlen($text);
- }
-
- return $tokens;
- }
-}
diff --git a/vendor/symfony/polyfill-php80/README.md b/vendor/symfony/polyfill-php80/README.md
deleted file mode 100644
index 3816c55..0000000
--- a/vendor/symfony/polyfill-php80/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-Symfony Polyfill / Php80
-========================
-
-This component provides features added to PHP 8.0 core:
-
-- [`Stringable`](https://php.net/stringable) interface
-- [`fdiv`](https://php.net/fdiv)
-- [`ValueError`](https://php.net/valueerror) class
-- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class
-- `FILTER_VALIDATE_BOOL` constant
-- [`get_debug_type`](https://php.net/get_debug_type)
-- [`PhpToken`](https://php.net/phptoken) class
-- [`preg_last_error_msg`](https://php.net/preg_last_error_msg)
-- [`str_contains`](https://php.net/str_contains)
-- [`str_starts_with`](https://php.net/str_starts_with)
-- [`str_ends_with`](https://php.net/str_ends_with)
-- [`get_resource_id`](https://php.net/get_resource_id)
-
-More information can be found in the
-[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
-
-License
-=======
-
-This library is released under the [MIT license](LICENSE).
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php
deleted file mode 100644
index 2b95542..0000000
--- a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php
+++ /dev/null
@@ -1,31 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-#[Attribute(Attribute::TARGET_CLASS)]
-final class Attribute
-{
- public const TARGET_CLASS = 1;
- public const TARGET_FUNCTION = 2;
- public const TARGET_METHOD = 4;
- public const TARGET_PROPERTY = 8;
- public const TARGET_CLASS_CONSTANT = 16;
- public const TARGET_PARAMETER = 32;
- public const TARGET_ALL = 63;
- public const IS_REPEATABLE = 64;
-
- /** @var int */
- public $flags;
-
- public function __construct(int $flags = self::TARGET_ALL)
- {
- $this->flags = $flags;
- }
-}
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php
deleted file mode 100644
index bd1212f..0000000
--- a/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) {
- class PhpToken extends Symfony\Polyfill\Php80\PhpToken
- {
- }
-}
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php
deleted file mode 100644
index 7c62d75..0000000
--- a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-if (\PHP_VERSION_ID < 80000) {
- interface Stringable
- {
- /**
- * @return string
- */
- public function __toString();
- }
-}
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php
deleted file mode 100644
index 783dbc2..0000000
--- a/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-if (\PHP_VERSION_ID < 80000) {
- class ValueError extends Error
- {
- }
-}
diff --git a/vendor/symfony/polyfill-php80/bootstrap.php b/vendor/symfony/polyfill-php80/bootstrap.php
deleted file mode 100644
index e5f7dbc..0000000
--- a/vendor/symfony/polyfill-php80/bootstrap.php
+++ /dev/null
@@ -1,42 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-use Symfony\Polyfill\Php80 as p;
-
-if (\PHP_VERSION_ID >= 80000) {
- return;
-}
-
-if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) {
- define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN);
-}
-
-if (!function_exists('fdiv')) {
- function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); }
-}
-if (!function_exists('preg_last_error_msg')) {
- function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); }
-}
-if (!function_exists('str_contains')) {
- function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); }
-}
-if (!function_exists('str_starts_with')) {
- function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); }
-}
-if (!function_exists('str_ends_with')) {
- function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); }
-}
-if (!function_exists('get_debug_type')) {
- function get_debug_type($value): string { return p\Php80::get_debug_type($value); }
-}
-if (!function_exists('get_resource_id')) {
- function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); }
-}
diff --git a/vendor/symfony/polyfill-php80/composer.json b/vendor/symfony/polyfill-php80/composer.json
deleted file mode 100644
index bd9a326..0000000
--- a/vendor/symfony/polyfill-php80/composer.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "symfony/polyfill-php80",
- "type": "library",
- "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
- "keywords": ["polyfill", "shim", "compatibility", "portable"],
- "homepage": "https://symfony.com",
- "license": "MIT",
- "authors": [
- {
- "name": "Ion Bazan",
- "email": "ion.bazan@gmail.com"
- },
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "require": {
- "php": ">=7.1"
- },
- "autoload": {
- "psr-4": { "Symfony\\Polyfill\\Php80\\": "" },
- "files": [ "bootstrap.php" ],
- "classmap": [ "Resources/stubs" ]
- },
- "minimum-stability": "dev",
- "extra": {
- "branch-alias": {
- "dev-main": "1.27-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- }
-}
diff --git a/vendor/symfony/var-dumper/CHANGELOG.md b/vendor/symfony/var-dumper/CHANGELOG.md
deleted file mode 100644
index 94b1c17..0000000
--- a/vendor/symfony/var-dumper/CHANGELOG.md
+++ /dev/null
@@ -1,53 +0,0 @@
-CHANGELOG
-=========
-
-4.4.0
------
-
- * added `VarDumperTestTrait::setUpVarDumper()` and `VarDumperTestTrait::tearDownVarDumper()`
- to configure casters & flags to use in tests
- * added `ImagineCaster` and infrastructure to dump images
- * added the stamps of a message after it is dispatched in `TraceableMessageBus` and `MessengerDataCollector` collected data
- * added `UuidCaster`
- * made all casters final
- * added support for the `NO_COLOR` env var (https://no-color.org/)
-
-4.3.0
------
-
- * added `DsCaster` to support dumping the contents of data structures from the Ds extension
-
-4.2.0
------
-
- * support selecting the format to use by setting the environment variable `VAR_DUMPER_FORMAT` to `html` or `cli`
-
-4.1.0
------
-
- * added a `ServerDumper` to send serialized Data clones to a server
- * added a `ServerDumpCommand` and `DumpServer` to run a server collecting
- and displaying dumps on a single place with multiple formats support
- * added `CliDescriptor` and `HtmlDescriptor` descriptors for `server:dump` CLI and HTML formats support
-
-4.0.0
------
-
- * support for passing `\ReflectionClass` instances to the `Caster::castObject()`
- method has been dropped, pass class names as strings instead
- * the `Data::getRawData()` method has been removed
- * the `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$filter = 0`
- argument and moves `$message = ''` argument at 4th position.
- * the `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$filter = 0`
- argument and moves `$message = ''` argument at 4th position.
-
-3.4.0
------
-
- * added `AbstractCloner::setMinDepth()` function to ensure minimum tree depth
- * deprecated `MongoCaster`
-
-2.7.0
------
-
- * deprecated `Cloner\Data::getLimitedClone()`. Use `withMaxDepth`, `withMaxItemsPerDepth` or `withRefHandles` instead.
diff --git a/vendor/symfony/var-dumper/Caster/AmqpCaster.php b/vendor/symfony/var-dumper/Caster/AmqpCaster.php
deleted file mode 100644
index 60045ff..0000000
--- a/vendor/symfony/var-dumper/Caster/AmqpCaster.php
+++ /dev/null
@@ -1,212 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts Amqp related classes to array representation.
- *
- * @author Grégoire Pineau
- *
- * @final since Symfony 4.4
- */
-class AmqpCaster
-{
- private const FLAGS = [
- \AMQP_DURABLE => 'AMQP_DURABLE',
- \AMQP_PASSIVE => 'AMQP_PASSIVE',
- \AMQP_EXCLUSIVE => 'AMQP_EXCLUSIVE',
- \AMQP_AUTODELETE => 'AMQP_AUTODELETE',
- \AMQP_INTERNAL => 'AMQP_INTERNAL',
- \AMQP_NOLOCAL => 'AMQP_NOLOCAL',
- \AMQP_AUTOACK => 'AMQP_AUTOACK',
- \AMQP_IFEMPTY => 'AMQP_IFEMPTY',
- \AMQP_IFUNUSED => 'AMQP_IFUNUSED',
- \AMQP_MANDATORY => 'AMQP_MANDATORY',
- \AMQP_IMMEDIATE => 'AMQP_IMMEDIATE',
- \AMQP_MULTIPLE => 'AMQP_MULTIPLE',
- \AMQP_NOWAIT => 'AMQP_NOWAIT',
- \AMQP_REQUEUE => 'AMQP_REQUEUE',
- ];
-
- private const EXCHANGE_TYPES = [
- \AMQP_EX_TYPE_DIRECT => 'AMQP_EX_TYPE_DIRECT',
- \AMQP_EX_TYPE_FANOUT => 'AMQP_EX_TYPE_FANOUT',
- \AMQP_EX_TYPE_TOPIC => 'AMQP_EX_TYPE_TOPIC',
- \AMQP_EX_TYPE_HEADERS => 'AMQP_EX_TYPE_HEADERS',
- ];
-
- public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, $isNested)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
-
- $a += [
- $prefix.'is_connected' => $c->isConnected(),
- ];
-
- // Recent version of the extension already expose private properties
- if (isset($a["\x00AMQPConnection\x00login"])) {
- return $a;
- }
-
- // BC layer in the amqp lib
- if (method_exists($c, 'getReadTimeout')) {
- $timeout = $c->getReadTimeout();
- } else {
- $timeout = $c->getTimeout();
- }
-
- $a += [
- $prefix.'is_connected' => $c->isConnected(),
- $prefix.'login' => $c->getLogin(),
- $prefix.'password' => $c->getPassword(),
- $prefix.'host' => $c->getHost(),
- $prefix.'vhost' => $c->getVhost(),
- $prefix.'port' => $c->getPort(),
- $prefix.'read_timeout' => $timeout,
- ];
-
- return $a;
- }
-
- public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, $isNested)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
-
- $a += [
- $prefix.'is_connected' => $c->isConnected(),
- $prefix.'channel_id' => $c->getChannelId(),
- ];
-
- // Recent version of the extension already expose private properties
- if (isset($a["\x00AMQPChannel\x00connection"])) {
- return $a;
- }
-
- $a += [
- $prefix.'connection' => $c->getConnection(),
- $prefix.'prefetch_size' => $c->getPrefetchSize(),
- $prefix.'prefetch_count' => $c->getPrefetchCount(),
- ];
-
- return $a;
- }
-
- public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, $isNested)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
-
- $a += [
- $prefix.'flags' => self::extractFlags($c->getFlags()),
- ];
-
- // Recent version of the extension already expose private properties
- if (isset($a["\x00AMQPQueue\x00name"])) {
- return $a;
- }
-
- $a += [
- $prefix.'connection' => $c->getConnection(),
- $prefix.'channel' => $c->getChannel(),
- $prefix.'name' => $c->getName(),
- $prefix.'arguments' => $c->getArguments(),
- ];
-
- return $a;
- }
-
- public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, $isNested)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
-
- $a += [
- $prefix.'flags' => self::extractFlags($c->getFlags()),
- ];
-
- $type = isset(self::EXCHANGE_TYPES[$c->getType()]) ? new ConstStub(self::EXCHANGE_TYPES[$c->getType()], $c->getType()) : $c->getType();
-
- // Recent version of the extension already expose private properties
- if (isset($a["\x00AMQPExchange\x00name"])) {
- $a["\x00AMQPExchange\x00type"] = $type;
-
- return $a;
- }
-
- $a += [
- $prefix.'connection' => $c->getConnection(),
- $prefix.'channel' => $c->getChannel(),
- $prefix.'name' => $c->getName(),
- $prefix.'type' => $type,
- $prefix.'arguments' => $c->getArguments(),
- ];
-
- return $a;
- }
-
- public static function castEnvelope(\AMQPEnvelope $c, array $a, Stub $stub, $isNested, $filter = 0)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
-
- $deliveryMode = new ConstStub($c->getDeliveryMode().(2 === $c->getDeliveryMode() ? ' (persistent)' : ' (non-persistent)'), $c->getDeliveryMode());
-
- // Recent version of the extension already expose private properties
- if (isset($a["\x00AMQPEnvelope\x00body"])) {
- $a["\0AMQPEnvelope\0delivery_mode"] = $deliveryMode;
-
- return $a;
- }
-
- if (!($filter & Caster::EXCLUDE_VERBOSE)) {
- $a += [$prefix.'body' => $c->getBody()];
- }
-
- $a += [
- $prefix.'delivery_tag' => $c->getDeliveryTag(),
- $prefix.'is_redelivery' => $c->isRedelivery(),
- $prefix.'exchange_name' => $c->getExchangeName(),
- $prefix.'routing_key' => $c->getRoutingKey(),
- $prefix.'content_type' => $c->getContentType(),
- $prefix.'content_encoding' => $c->getContentEncoding(),
- $prefix.'headers' => $c->getHeaders(),
- $prefix.'delivery_mode' => $deliveryMode,
- $prefix.'priority' => $c->getPriority(),
- $prefix.'correlation_id' => $c->getCorrelationId(),
- $prefix.'reply_to' => $c->getReplyTo(),
- $prefix.'expiration' => $c->getExpiration(),
- $prefix.'message_id' => $c->getMessageId(),
- $prefix.'timestamp' => $c->getTimeStamp(),
- $prefix.'type' => $c->getType(),
- $prefix.'user_id' => $c->getUserId(),
- $prefix.'app_id' => $c->getAppId(),
- ];
-
- return $a;
- }
-
- private static function extractFlags(int $flags): ConstStub
- {
- $flagsArray = [];
-
- foreach (self::FLAGS as $value => $name) {
- if ($flags & $value) {
- $flagsArray[] = $name;
- }
- }
-
- if (!$flagsArray) {
- $flagsArray = ['AMQP_NOPARAM'];
- }
-
- return new ConstStub(implode('|', $flagsArray), $flags);
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/ArgsStub.php b/vendor/symfony/var-dumper/Caster/ArgsStub.php
deleted file mode 100644
index b3f7bbe..0000000
--- a/vendor/symfony/var-dumper/Caster/ArgsStub.php
+++ /dev/null
@@ -1,80 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Represents a list of function arguments.
- *
- * @author Nicolas Grekas
- */
-class ArgsStub extends EnumStub
-{
- private static $parameters = [];
-
- public function __construct(array $args, string $function, ?string $class)
- {
- [$variadic, $params] = self::getParameters($function, $class);
-
- $values = [];
- foreach ($args as $k => $v) {
- $values[$k] = !\is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v;
- }
- if (null === $params) {
- parent::__construct($values, false);
-
- return;
- }
- if (\count($values) < \count($params)) {
- $params = \array_slice($params, 0, \count($values));
- } elseif (\count($values) > \count($params)) {
- $values[] = new EnumStub(array_splice($values, \count($params)), false);
- $params[] = $variadic;
- }
- if (['...'] === $params) {
- $this->dumpKeys = false;
- $this->value = $values[0]->value;
- } else {
- $this->value = array_combine($params, $values);
- }
- }
-
- private static function getParameters(string $function, ?string $class): array
- {
- if (isset(self::$parameters[$k = $class.'::'.$function])) {
- return self::$parameters[$k];
- }
-
- try {
- $r = null !== $class ? new \ReflectionMethod($class, $function) : new \ReflectionFunction($function);
- } catch (\ReflectionException $e) {
- return [null, null];
- }
-
- $variadic = '...';
- $params = [];
- foreach ($r->getParameters() as $v) {
- $k = '$'.$v->name;
- if ($v->isPassedByReference()) {
- $k = '&'.$k;
- }
- if ($v->isVariadic()) {
- $variadic .= $k;
- } else {
- $params[] = $k;
- }
- }
-
- return self::$parameters[$k] = [$variadic, $params];
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/Caster.php b/vendor/symfony/var-dumper/Caster/Caster.php
deleted file mode 100644
index d35f323..0000000
--- a/vendor/symfony/var-dumper/Caster/Caster.php
+++ /dev/null
@@ -1,175 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Helper for filtering out properties in casters.
- *
- * @author Nicolas Grekas
- *
- * @final
- */
-class Caster
-{
- public const EXCLUDE_VERBOSE = 1;
- public const EXCLUDE_VIRTUAL = 2;
- public const EXCLUDE_DYNAMIC = 4;
- public const EXCLUDE_PUBLIC = 8;
- public const EXCLUDE_PROTECTED = 16;
- public const EXCLUDE_PRIVATE = 32;
- public const EXCLUDE_NULL = 64;
- public const EXCLUDE_EMPTY = 128;
- public const EXCLUDE_NOT_IMPORTANT = 256;
- public const EXCLUDE_STRICT = 512;
-
- public const PREFIX_VIRTUAL = "\0~\0";
- public const PREFIX_DYNAMIC = "\0+\0";
- public const PREFIX_PROTECTED = "\0*\0";
-
- /**
- * Casts objects to arrays and adds the dynamic property prefix.
- *
- * @param object $obj The object to cast
- * @param bool $hasDebugInfo Whether the __debugInfo method exists on $obj or not
- *
- * @return array The array-cast of the object, with prefixed dynamic properties
- */
- public static function castObject($obj, string $class, bool $hasDebugInfo = false, string $debugClass = null): array
- {
- if ($hasDebugInfo) {
- try {
- $debugInfo = $obj->__debugInfo();
- } catch (\Exception $e) {
- // ignore failing __debugInfo()
- $hasDebugInfo = false;
- }
- }
-
- $a = $obj instanceof \Closure ? [] : (array) $obj;
-
- if ($obj instanceof \__PHP_Incomplete_Class) {
- return $a;
- }
-
- if ($a) {
- static $publicProperties = [];
- $debugClass = $debugClass ?? get_debug_type($obj);
-
- $i = 0;
- $prefixedKeys = [];
- foreach ($a as $k => $v) {
- if (isset($k[0]) ? "\0" !== $k[0] : \PHP_VERSION_ID >= 70200) {
- if (!isset($publicProperties[$class])) {
- foreach ((new \ReflectionClass($class))->getProperties(\ReflectionProperty::IS_PUBLIC) as $prop) {
- $publicProperties[$class][$prop->name] = true;
- }
- }
- if (!isset($publicProperties[$class][$k])) {
- $prefixedKeys[$i] = self::PREFIX_DYNAMIC.$k;
- }
- } elseif ($debugClass !== $class && 1 === strpos($k, $class)) {
- $prefixedKeys[$i] = "\0".$debugClass.strrchr($k, "\0");
- }
- ++$i;
- }
- if ($prefixedKeys) {
- $keys = array_keys($a);
- foreach ($prefixedKeys as $i => $k) {
- $keys[$i] = $k;
- }
- $a = array_combine($keys, $a);
- }
- }
-
- if ($hasDebugInfo && \is_array($debugInfo)) {
- foreach ($debugInfo as $k => $v) {
- if (!isset($k[0]) || "\0" !== $k[0]) {
- if (\array_key_exists(self::PREFIX_DYNAMIC.$k, $a)) {
- continue;
- }
- $k = self::PREFIX_VIRTUAL.$k;
- }
-
- unset($a[$k]);
- $a[$k] = $v;
- }
- }
-
- return $a;
- }
-
- /**
- * Filters out the specified properties.
- *
- * By default, a single match in the $filter bit field filters properties out, following an "or" logic.
- * When EXCLUDE_STRICT is set, an "and" logic is applied: all bits must match for a property to be removed.
- *
- * @param array $a The array containing the properties to filter
- * @param int $filter A bit field of Caster::EXCLUDE_* constants specifying which properties to filter out
- * @param string[] $listedProperties List of properties to exclude when Caster::EXCLUDE_VERBOSE is set, and to preserve when Caster::EXCLUDE_NOT_IMPORTANT is set
- * @param int &$count Set to the number of removed properties
- *
- * @return array The filtered array
- */
- public static function filter(array $a, int $filter, array $listedProperties = [], ?int &$count = 0): array
- {
- $count = 0;
-
- foreach ($a as $k => $v) {
- $type = self::EXCLUDE_STRICT & $filter;
-
- if (null === $v) {
- $type |= self::EXCLUDE_NULL & $filter;
- $type |= self::EXCLUDE_EMPTY & $filter;
- } elseif (false === $v || '' === $v || '0' === $v || 0 === $v || 0.0 === $v || [] === $v) {
- $type |= self::EXCLUDE_EMPTY & $filter;
- }
- if ((self::EXCLUDE_NOT_IMPORTANT & $filter) && !\in_array($k, $listedProperties, true)) {
- $type |= self::EXCLUDE_NOT_IMPORTANT;
- }
- if ((self::EXCLUDE_VERBOSE & $filter) && \in_array($k, $listedProperties, true)) {
- $type |= self::EXCLUDE_VERBOSE;
- }
-
- if (!isset($k[1]) || "\0" !== $k[0]) {
- $type |= self::EXCLUDE_PUBLIC & $filter;
- } elseif ('~' === $k[1]) {
- $type |= self::EXCLUDE_VIRTUAL & $filter;
- } elseif ('+' === $k[1]) {
- $type |= self::EXCLUDE_DYNAMIC & $filter;
- } elseif ('*' === $k[1]) {
- $type |= self::EXCLUDE_PROTECTED & $filter;
- } else {
- $type |= self::EXCLUDE_PRIVATE & $filter;
- }
-
- if ((self::EXCLUDE_STRICT & $filter) ? $type === $filter : $type) {
- unset($a[$k]);
- ++$count;
- }
- }
-
- return $a;
- }
-
- public static function castPhpIncompleteClass(\__PHP_Incomplete_Class $c, array $a, Stub $stub, bool $isNested): array
- {
- if (isset($a['__PHP_Incomplete_Class_Name'])) {
- $stub->class .= '('.$a['__PHP_Incomplete_Class_Name'].')';
- unset($a['__PHP_Incomplete_Class_Name']);
- }
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/ClassStub.php b/vendor/symfony/var-dumper/Caster/ClassStub.php
deleted file mode 100644
index 48f8483..0000000
--- a/vendor/symfony/var-dumper/Caster/ClassStub.php
+++ /dev/null
@@ -1,106 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Represents a PHP class identifier.
- *
- * @author Nicolas Grekas
- */
-class ClassStub extends ConstStub
-{
- /**
- * @param string $identifier A PHP identifier, e.g. a class, method, interface, etc. name
- * @param callable $callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier
- */
- public function __construct(string $identifier, $callable = null)
- {
- $this->value = $identifier;
-
- try {
- if (null !== $callable) {
- if ($callable instanceof \Closure) {
- $r = new \ReflectionFunction($callable);
- } elseif (\is_object($callable)) {
- $r = [$callable, '__invoke'];
- } elseif (\is_array($callable)) {
- $r = $callable;
- } elseif (false !== $i = strpos($callable, '::')) {
- $r = [substr($callable, 0, $i), substr($callable, 2 + $i)];
- } else {
- $r = new \ReflectionFunction($callable);
- }
- } elseif (0 < $i = strpos($identifier, '::') ?: strpos($identifier, '->')) {
- $r = [substr($identifier, 0, $i), substr($identifier, 2 + $i)];
- } else {
- $r = new \ReflectionClass($identifier);
- }
-
- if (\is_array($r)) {
- try {
- $r = new \ReflectionMethod($r[0], $r[1]);
- } catch (\ReflectionException $e) {
- $r = new \ReflectionClass($r[0]);
- }
- }
-
- if (str_contains($identifier, "@anonymous\0")) {
- $this->value = $identifier = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
- return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0];
- }, $identifier);
- }
-
- if (null !== $callable && $r instanceof \ReflectionFunctionAbstract) {
- $s = ReflectionCaster::castFunctionAbstract($r, [], new Stub(), true, Caster::EXCLUDE_VERBOSE);
- $s = ReflectionCaster::getSignature($s);
-
- if (str_ends_with($identifier, '()')) {
- $this->value = substr_replace($identifier, $s, -2);
- } else {
- $this->value .= $s;
- }
- }
- } catch (\ReflectionException $e) {
- return;
- } finally {
- if (0 < $i = strrpos($this->value, '\\')) {
- $this->attr['ellipsis'] = \strlen($this->value) - $i;
- $this->attr['ellipsis-type'] = 'class';
- $this->attr['ellipsis-tail'] = 1;
- }
- }
-
- if ($f = $r->getFileName()) {
- $this->attr['file'] = $f;
- $this->attr['line'] = $r->getStartLine();
- }
- }
-
- public static function wrapCallable($callable)
- {
- if (\is_object($callable) || !\is_callable($callable)) {
- return $callable;
- }
-
- if (!\is_array($callable)) {
- $callable = new static($callable, $callable);
- } elseif (\is_string($callable[0])) {
- $callable[0] = new static($callable[0], $callable);
- } else {
- $callable[1] = new static($callable[1], $callable);
- }
-
- return $callable;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/ConstStub.php b/vendor/symfony/var-dumper/Caster/ConstStub.php
deleted file mode 100644
index 8b01797..0000000
--- a/vendor/symfony/var-dumper/Caster/ConstStub.php
+++ /dev/null
@@ -1,36 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Represents a PHP constant and its value.
- *
- * @author Nicolas Grekas
- */
-class ConstStub extends Stub
-{
- public function __construct(string $name, $value = null)
- {
- $this->class = $name;
- $this->value = 1 < \func_num_args() ? $value : $name;
- }
-
- /**
- * @return string
- */
- public function __toString()
- {
- return (string) $this->value;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/CutArrayStub.php b/vendor/symfony/var-dumper/Caster/CutArrayStub.php
deleted file mode 100644
index 0e4fb36..0000000
--- a/vendor/symfony/var-dumper/Caster/CutArrayStub.php
+++ /dev/null
@@ -1,30 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-/**
- * Represents a cut array.
- *
- * @author Nicolas Grekas
- */
-class CutArrayStub extends CutStub
-{
- public $preservedSubset;
-
- public function __construct(array $value, array $preservedKeys)
- {
- parent::__construct($value);
-
- $this->preservedSubset = array_intersect_key($value, array_flip($preservedKeys));
- $this->cut -= \count($this->preservedSubset);
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/CutStub.php b/vendor/symfony/var-dumper/Caster/CutStub.php
deleted file mode 100644
index 464c6db..0000000
--- a/vendor/symfony/var-dumper/Caster/CutStub.php
+++ /dev/null
@@ -1,64 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Represents the main properties of a PHP variable, pre-casted by a caster.
- *
- * @author Nicolas Grekas
- */
-class CutStub extends Stub
-{
- public function __construct($value)
- {
- $this->value = $value;
-
- switch (\gettype($value)) {
- case 'object':
- $this->type = self::TYPE_OBJECT;
- $this->class = \get_class($value);
-
- if ($value instanceof \Closure) {
- ReflectionCaster::castClosure($value, [], $this, true, Caster::EXCLUDE_VERBOSE);
- }
-
- $this->cut = -1;
- break;
-
- case 'array':
- $this->type = self::TYPE_ARRAY;
- $this->class = self::ARRAY_ASSOC;
- $this->cut = $this->value = \count($value);
- break;
-
- case 'resource':
- case 'unknown type':
- case 'resource (closed)':
- $this->type = self::TYPE_RESOURCE;
- $this->handle = (int) $value;
- if ('Unknown' === $this->class = @get_resource_type($value)) {
- $this->class = 'Closed';
- }
- $this->cut = -1;
- break;
-
- case 'string':
- $this->type = self::TYPE_STRING;
- $this->class = preg_match('//u', $value) ? self::STRING_UTF8 : self::STRING_BINARY;
- $this->cut = self::STRING_BINARY === $this->class ? \strlen($value) : mb_strlen($value, 'UTF-8');
- $this->value = '';
- break;
- }
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/DOMCaster.php b/vendor/symfony/var-dumper/Caster/DOMCaster.php
deleted file mode 100644
index 5f2b9cd..0000000
--- a/vendor/symfony/var-dumper/Caster/DOMCaster.php
+++ /dev/null
@@ -1,304 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts DOM related classes to array representation.
- *
- * @author Nicolas Grekas
- *
- * @final since Symfony 4.4
- */
-class DOMCaster
-{
- private const ERROR_CODES = [
- \DOM_PHP_ERR => 'DOM_PHP_ERR',
- \DOM_INDEX_SIZE_ERR => 'DOM_INDEX_SIZE_ERR',
- \DOMSTRING_SIZE_ERR => 'DOMSTRING_SIZE_ERR',
- \DOM_HIERARCHY_REQUEST_ERR => 'DOM_HIERARCHY_REQUEST_ERR',
- \DOM_WRONG_DOCUMENT_ERR => 'DOM_WRONG_DOCUMENT_ERR',
- \DOM_INVALID_CHARACTER_ERR => 'DOM_INVALID_CHARACTER_ERR',
- \DOM_NO_DATA_ALLOWED_ERR => 'DOM_NO_DATA_ALLOWED_ERR',
- \DOM_NO_MODIFICATION_ALLOWED_ERR => 'DOM_NO_MODIFICATION_ALLOWED_ERR',
- \DOM_NOT_FOUND_ERR => 'DOM_NOT_FOUND_ERR',
- \DOM_NOT_SUPPORTED_ERR => 'DOM_NOT_SUPPORTED_ERR',
- \DOM_INUSE_ATTRIBUTE_ERR => 'DOM_INUSE_ATTRIBUTE_ERR',
- \DOM_INVALID_STATE_ERR => 'DOM_INVALID_STATE_ERR',
- \DOM_SYNTAX_ERR => 'DOM_SYNTAX_ERR',
- \DOM_INVALID_MODIFICATION_ERR => 'DOM_INVALID_MODIFICATION_ERR',
- \DOM_NAMESPACE_ERR => 'DOM_NAMESPACE_ERR',
- \DOM_INVALID_ACCESS_ERR => 'DOM_INVALID_ACCESS_ERR',
- \DOM_VALIDATION_ERR => 'DOM_VALIDATION_ERR',
- ];
-
- private const NODE_TYPES = [
- \XML_ELEMENT_NODE => 'XML_ELEMENT_NODE',
- \XML_ATTRIBUTE_NODE => 'XML_ATTRIBUTE_NODE',
- \XML_TEXT_NODE => 'XML_TEXT_NODE',
- \XML_CDATA_SECTION_NODE => 'XML_CDATA_SECTION_NODE',
- \XML_ENTITY_REF_NODE => 'XML_ENTITY_REF_NODE',
- \XML_ENTITY_NODE => 'XML_ENTITY_NODE',
- \XML_PI_NODE => 'XML_PI_NODE',
- \XML_COMMENT_NODE => 'XML_COMMENT_NODE',
- \XML_DOCUMENT_NODE => 'XML_DOCUMENT_NODE',
- \XML_DOCUMENT_TYPE_NODE => 'XML_DOCUMENT_TYPE_NODE',
- \XML_DOCUMENT_FRAG_NODE => 'XML_DOCUMENT_FRAG_NODE',
- \XML_NOTATION_NODE => 'XML_NOTATION_NODE',
- \XML_HTML_DOCUMENT_NODE => 'XML_HTML_DOCUMENT_NODE',
- \XML_DTD_NODE => 'XML_DTD_NODE',
- \XML_ELEMENT_DECL_NODE => 'XML_ELEMENT_DECL_NODE',
- \XML_ATTRIBUTE_DECL_NODE => 'XML_ATTRIBUTE_DECL_NODE',
- \XML_ENTITY_DECL_NODE => 'XML_ENTITY_DECL_NODE',
- \XML_NAMESPACE_DECL_NODE => 'XML_NAMESPACE_DECL_NODE',
- ];
-
- public static function castException(\DOMException $e, array $a, Stub $stub, $isNested)
- {
- $k = Caster::PREFIX_PROTECTED.'code';
- if (isset($a[$k], self::ERROR_CODES[$a[$k]])) {
- $a[$k] = new ConstStub(self::ERROR_CODES[$a[$k]], $a[$k]);
- }
-
- return $a;
- }
-
- public static function castLength($dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'length' => $dom->length,
- ];
-
- return $a;
- }
-
- public static function castImplementation($dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- Caster::PREFIX_VIRTUAL.'Core' => '1.0',
- Caster::PREFIX_VIRTUAL.'XML' => '2.0',
- ];
-
- return $a;
- }
-
- public static function castNode(\DOMNode $dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'nodeName' => $dom->nodeName,
- 'nodeValue' => new CutStub($dom->nodeValue),
- 'nodeType' => new ConstStub(self::NODE_TYPES[$dom->nodeType], $dom->nodeType),
- 'parentNode' => new CutStub($dom->parentNode),
- 'childNodes' => $dom->childNodes,
- 'firstChild' => new CutStub($dom->firstChild),
- 'lastChild' => new CutStub($dom->lastChild),
- 'previousSibling' => new CutStub($dom->previousSibling),
- 'nextSibling' => new CutStub($dom->nextSibling),
- 'attributes' => $dom->attributes,
- 'ownerDocument' => new CutStub($dom->ownerDocument),
- 'namespaceURI' => $dom->namespaceURI,
- 'prefix' => $dom->prefix,
- 'localName' => $dom->localName,
- 'baseURI' => $dom->baseURI ? new LinkStub($dom->baseURI) : $dom->baseURI,
- 'textContent' => new CutStub($dom->textContent),
- ];
-
- return $a;
- }
-
- public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'nodeName' => $dom->nodeName,
- 'nodeValue' => new CutStub($dom->nodeValue),
- 'nodeType' => new ConstStub(self::NODE_TYPES[$dom->nodeType], $dom->nodeType),
- 'prefix' => $dom->prefix,
- 'localName' => $dom->localName,
- 'namespaceURI' => $dom->namespaceURI,
- 'ownerDocument' => new CutStub($dom->ownerDocument),
- 'parentNode' => new CutStub($dom->parentNode),
- ];
-
- return $a;
- }
-
- public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, $isNested, $filter = 0)
- {
- $a += [
- 'doctype' => $dom->doctype,
- 'implementation' => $dom->implementation,
- 'documentElement' => new CutStub($dom->documentElement),
- 'actualEncoding' => $dom->actualEncoding,
- 'encoding' => $dom->encoding,
- 'xmlEncoding' => $dom->xmlEncoding,
- 'standalone' => $dom->standalone,
- 'xmlStandalone' => $dom->xmlStandalone,
- 'version' => $dom->version,
- 'xmlVersion' => $dom->xmlVersion,
- 'strictErrorChecking' => $dom->strictErrorChecking,
- 'documentURI' => $dom->documentURI ? new LinkStub($dom->documentURI) : $dom->documentURI,
- 'config' => $dom->config,
- 'formatOutput' => $dom->formatOutput,
- 'validateOnParse' => $dom->validateOnParse,
- 'resolveExternals' => $dom->resolveExternals,
- 'preserveWhiteSpace' => $dom->preserveWhiteSpace,
- 'recover' => $dom->recover,
- 'substituteEntities' => $dom->substituteEntities,
- ];
-
- if (!($filter & Caster::EXCLUDE_VERBOSE)) {
- $formatOutput = $dom->formatOutput;
- $dom->formatOutput = true;
- $a += [Caster::PREFIX_VIRTUAL.'xml' => $dom->saveXML()];
- $dom->formatOutput = $formatOutput;
- }
-
- return $a;
- }
-
- public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'data' => $dom->data,
- 'length' => $dom->length,
- ];
-
- return $a;
- }
-
- public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'name' => $dom->name,
- 'specified' => $dom->specified,
- 'value' => $dom->value,
- 'ownerElement' => $dom->ownerElement,
- 'schemaTypeInfo' => $dom->schemaTypeInfo,
- ];
-
- return $a;
- }
-
- public static function castElement(\DOMElement $dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'tagName' => $dom->tagName,
- 'schemaTypeInfo' => $dom->schemaTypeInfo,
- ];
-
- return $a;
- }
-
- public static function castText(\DOMText $dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'wholeText' => $dom->wholeText,
- ];
-
- return $a;
- }
-
- public static function castTypeinfo(\DOMTypeinfo $dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'typeName' => $dom->typeName,
- 'typeNamespace' => $dom->typeNamespace,
- ];
-
- return $a;
- }
-
- public static function castDomError(\DOMDomError $dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'severity' => $dom->severity,
- 'message' => $dom->message,
- 'type' => $dom->type,
- 'relatedException' => $dom->relatedException,
- 'related_data' => $dom->related_data,
- 'location' => $dom->location,
- ];
-
- return $a;
- }
-
- public static function castLocator(\DOMLocator $dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'lineNumber' => $dom->lineNumber,
- 'columnNumber' => $dom->columnNumber,
- 'offset' => $dom->offset,
- 'relatedNode' => $dom->relatedNode,
- 'uri' => $dom->uri ? new LinkStub($dom->uri, $dom->lineNumber) : $dom->uri,
- ];
-
- return $a;
- }
-
- public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'name' => $dom->name,
- 'entities' => $dom->entities,
- 'notations' => $dom->notations,
- 'publicId' => $dom->publicId,
- 'systemId' => $dom->systemId,
- 'internalSubset' => $dom->internalSubset,
- ];
-
- return $a;
- }
-
- public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'publicId' => $dom->publicId,
- 'systemId' => $dom->systemId,
- ];
-
- return $a;
- }
-
- public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'publicId' => $dom->publicId,
- 'systemId' => $dom->systemId,
- 'notationName' => $dom->notationName,
- 'actualEncoding' => $dom->actualEncoding,
- 'encoding' => $dom->encoding,
- 'version' => $dom->version,
- ];
-
- return $a;
- }
-
- public static function castProcessingInstruction(\DOMProcessingInstruction $dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'target' => $dom->target,
- 'data' => $dom->data,
- ];
-
- return $a;
- }
-
- public static function castXPath(\DOMXPath $dom, array $a, Stub $stub, $isNested)
- {
- $a += [
- 'document' => $dom->document,
- ];
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/DateCaster.php b/vendor/symfony/var-dumper/Caster/DateCaster.php
deleted file mode 100644
index e0309bc..0000000
--- a/vendor/symfony/var-dumper/Caster/DateCaster.php
+++ /dev/null
@@ -1,129 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts DateTimeInterface related classes to array representation.
- *
- * @author Dany Maillard
- *
- * @final since Symfony 4.4
- */
-class DateCaster
-{
- private const PERIOD_LIMIT = 3;
-
- public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, $isNested, $filter)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
- $location = $d->getTimezone()->getLocation();
- $fromNow = (new \DateTime())->diff($d);
-
- $title = $d->format('l, F j, Y')
- ."\n".self::formatInterval($fromNow).' from now'
- .($location ? ($d->format('I') ? "\nDST On" : "\nDST Off") : '')
- ;
-
- unset(
- $a[Caster::PREFIX_DYNAMIC.'date'],
- $a[Caster::PREFIX_DYNAMIC.'timezone'],
- $a[Caster::PREFIX_DYNAMIC.'timezone_type']
- );
- $a[$prefix.'date'] = new ConstStub(self::formatDateTime($d, $location ? ' e (P)' : ' P'), $title);
-
- $stub->class .= $d->format(' @U');
-
- return $a;
- }
-
- public static function castInterval(\DateInterval $interval, array $a, Stub $stub, $isNested, $filter)
- {
- $now = new \DateTimeImmutable('@0', new \DateTimeZone('UTC'));
- $numberOfSeconds = $now->add($interval)->getTimestamp() - $now->getTimestamp();
- $title = number_format($numberOfSeconds, 0, '.', ' ').'s';
-
- $i = [Caster::PREFIX_VIRTUAL.'interval' => new ConstStub(self::formatInterval($interval), $title)];
-
- return $filter & Caster::EXCLUDE_VERBOSE ? $i : $i + $a;
- }
-
- private static function formatInterval(\DateInterval $i): string
- {
- $format = '%R ';
-
- if (0 === $i->y && 0 === $i->m && ($i->h >= 24 || $i->i >= 60 || $i->s >= 60)) {
- $d = new \DateTimeImmutable('@0', new \DateTimeZone('UTC'));
- $i = $d->diff($d->add($i)); // recalculate carry over points
- $format .= 0 < $i->days ? '%ad ' : '';
- } else {
- $format .= ($i->y ? '%yy ' : '').($i->m ? '%mm ' : '').($i->d ? '%dd ' : '');
- }
-
- $format .= $i->h || $i->i || $i->s || $i->f ? '%H:%I:'.self::formatSeconds($i->s, substr($i->f, 2)) : '';
- $format = '%R ' === $format ? '0s' : $format;
-
- return $i->format(rtrim($format));
- }
-
- public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stub, $isNested, $filter)
- {
- $location = $timeZone->getLocation();
- $formatted = (new \DateTime('now', $timeZone))->format($location ? 'e (P)' : 'P');
- $title = $location && \extension_loaded('intl') ? \Locale::getDisplayRegion('-'.$location['country_code']) : '';
-
- $z = [Caster::PREFIX_VIRTUAL.'timezone' => new ConstStub($formatted, $title)];
-
- return $filter & Caster::EXCLUDE_VERBOSE ? $z : $z + $a;
- }
-
- public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, $isNested, $filter)
- {
- $dates = [];
- if (\PHP_VERSION_ID >= 70107) { // see https://bugs.php.net/74639
- foreach (clone $p as $i => $d) {
- if (self::PERIOD_LIMIT === $i) {
- $now = new \DateTimeImmutable('now', new \DateTimeZone('UTC'));
- $dates[] = sprintf('%s more', ($end = $p->getEndDate())
- ? ceil(($end->format('U.u') - $d->format('U.u')) / ((int) $now->add($p->getDateInterval())->format('U.u') - (int) $now->format('U.u')))
- : $p->recurrences - $i
- );
- break;
- }
- $dates[] = sprintf('%s) %s', $i + 1, self::formatDateTime($d));
- }
- }
-
- $period = sprintf(
- 'every %s, from %s%s %s',
- self::formatInterval($p->getDateInterval()),
- $p->include_start_date ? '[' : ']',
- self::formatDateTime($p->getStartDate()),
- ($end = $p->getEndDate()) ? 'to '.self::formatDateTime($end).(\PHP_VERSION_ID >= 80200 && $p->include_end_date ? ']' : '[') : 'recurring '.$p->recurrences.' time/s'
- );
-
- $p = [Caster::PREFIX_VIRTUAL.'period' => new ConstStub($period, implode("\n", $dates))];
-
- return $filter & Caster::EXCLUDE_VERBOSE ? $p : $p + $a;
- }
-
- private static function formatDateTime(\DateTimeInterface $d, string $extra = ''): string
- {
- return $d->format('Y-m-d H:i:'.self::formatSeconds($d->format('s'), $d->format('u')).$extra);
- }
-
- private static function formatSeconds(string $s, string $us): string
- {
- return sprintf('%02d.%s', $s, 0 === ($len = \strlen($t = rtrim($us, '0'))) ? '0' : ($len <= 3 ? str_pad($t, 3, '0') : $us));
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/DoctrineCaster.php b/vendor/symfony/var-dumper/Caster/DoctrineCaster.php
deleted file mode 100644
index 7409508..0000000
--- a/vendor/symfony/var-dumper/Caster/DoctrineCaster.php
+++ /dev/null
@@ -1,62 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Doctrine\Common\Proxy\Proxy as CommonProxy;
-use Doctrine\ORM\PersistentCollection;
-use Doctrine\ORM\Proxy\Proxy as OrmProxy;
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts Doctrine related classes to array representation.
- *
- * @author Nicolas Grekas
- *
- * @final since Symfony 4.4
- */
-class DoctrineCaster
-{
- public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, $isNested)
- {
- foreach (['__cloner__', '__initializer__'] as $k) {
- if (\array_key_exists($k, $a)) {
- unset($a[$k]);
- ++$stub->cut;
- }
- }
-
- return $a;
- }
-
- public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, $isNested)
- {
- foreach (['_entityPersister', '_identifier'] as $k) {
- if (\array_key_exists($k = "\0Doctrine\\ORM\\Proxy\\Proxy\0".$k, $a)) {
- unset($a[$k]);
- ++$stub->cut;
- }
- }
-
- return $a;
- }
-
- public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, $isNested)
- {
- foreach (['snapshot', 'association', 'typeClass'] as $k) {
- if (\array_key_exists($k = "\0Doctrine\\ORM\\PersistentCollection\0".$k, $a)) {
- $a[$k] = new CutStub($a[$k]);
- }
- }
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/DsCaster.php b/vendor/symfony/var-dumper/Caster/DsCaster.php
deleted file mode 100644
index 11423c9..0000000
--- a/vendor/symfony/var-dumper/Caster/DsCaster.php
+++ /dev/null
@@ -1,70 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Ds\Collection;
-use Ds\Map;
-use Ds\Pair;
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts Ds extension classes to array representation.
- *
- * @author Jáchym Toušek
- *
- * @final since Symfony 4.4
- */
-class DsCaster
-{
- public static function castCollection(Collection $c, array $a, Stub $stub, bool $isNested): array
- {
- $a[Caster::PREFIX_VIRTUAL.'count'] = $c->count();
- $a[Caster::PREFIX_VIRTUAL.'capacity'] = $c->capacity();
-
- if (!$c instanceof Map) {
- $a += $c->toArray();
- }
-
- return $a;
- }
-
- public static function castMap(Map $c, array $a, Stub $stub, bool $isNested): array
- {
- foreach ($c as $k => $v) {
- $a[] = new DsPairStub($k, $v);
- }
-
- return $a;
- }
-
- public static function castPair(Pair $c, array $a, Stub $stub, bool $isNested): array
- {
- foreach ($c->toArray() as $k => $v) {
- $a[Caster::PREFIX_VIRTUAL.$k] = $v;
- }
-
- return $a;
- }
-
- public static function castPairStub(DsPairStub $c, array $a, Stub $stub, bool $isNested): array
- {
- if ($isNested) {
- $stub->class = Pair::class;
- $stub->value = null;
- $stub->handle = 0;
-
- $a = $c->value;
- }
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/DsPairStub.php b/vendor/symfony/var-dumper/Caster/DsPairStub.php
deleted file mode 100644
index a1dcc15..0000000
--- a/vendor/symfony/var-dumper/Caster/DsPairStub.php
+++ /dev/null
@@ -1,28 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * @author Nicolas Grekas
- */
-class DsPairStub extends Stub
-{
- public function __construct($key, $value)
- {
- $this->value = [
- Caster::PREFIX_VIRTUAL.'key' => $key,
- Caster::PREFIX_VIRTUAL.'value' => $value,
- ];
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/EnumStub.php b/vendor/symfony/var-dumper/Caster/EnumStub.php
deleted file mode 100644
index 7a4e98a..0000000
--- a/vendor/symfony/var-dumper/Caster/EnumStub.php
+++ /dev/null
@@ -1,30 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Represents an enumeration of values.
- *
- * @author Nicolas Grekas
- */
-class EnumStub extends Stub
-{
- public $dumpKeys = true;
-
- public function __construct(array $values, bool $dumpKeys = true)
- {
- $this->value = $values;
- $this->dumpKeys = $dumpKeys;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/ExceptionCaster.php b/vendor/symfony/var-dumper/Caster/ExceptionCaster.php
deleted file mode 100644
index f2c0f96..0000000
--- a/vendor/symfony/var-dumper/Caster/ExceptionCaster.php
+++ /dev/null
@@ -1,388 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext;
-use Symfony\Component\VarDumper\Cloner\Stub;
-use Symfony\Component\VarDumper\Exception\ThrowingCasterException;
-
-/**
- * Casts common Exception classes to array representation.
- *
- * @author Nicolas Grekas
- *
- * @final since Symfony 4.4
- */
-class ExceptionCaster
-{
- public static $srcContext = 1;
- public static $traceArgs = true;
- public static $errorTypes = [
- \E_DEPRECATED => 'E_DEPRECATED',
- \E_USER_DEPRECATED => 'E_USER_DEPRECATED',
- \E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR',
- \E_ERROR => 'E_ERROR',
- \E_WARNING => 'E_WARNING',
- \E_PARSE => 'E_PARSE',
- \E_NOTICE => 'E_NOTICE',
- \E_CORE_ERROR => 'E_CORE_ERROR',
- \E_CORE_WARNING => 'E_CORE_WARNING',
- \E_COMPILE_ERROR => 'E_COMPILE_ERROR',
- \E_COMPILE_WARNING => 'E_COMPILE_WARNING',
- \E_USER_ERROR => 'E_USER_ERROR',
- \E_USER_WARNING => 'E_USER_WARNING',
- \E_USER_NOTICE => 'E_USER_NOTICE',
- \E_STRICT => 'E_STRICT',
- ];
-
- private static $framesCache = [];
-
- public static function castError(\Error $e, array $a, Stub $stub, $isNested, $filter = 0)
- {
- return self::filterExceptionArray($stub->class, $a, "\0Error\0", $filter);
- }
-
- public static function castException(\Exception $e, array $a, Stub $stub, $isNested, $filter = 0)
- {
- return self::filterExceptionArray($stub->class, $a, "\0Exception\0", $filter);
- }
-
- public static function castErrorException(\ErrorException $e, array $a, Stub $stub, $isNested)
- {
- if (isset($a[$s = Caster::PREFIX_PROTECTED.'severity'], self::$errorTypes[$a[$s]])) {
- $a[$s] = new ConstStub(self::$errorTypes[$a[$s]], $a[$s]);
- }
-
- return $a;
- }
-
- public static function castThrowingCasterException(ThrowingCasterException $e, array $a, Stub $stub, $isNested)
- {
- $trace = Caster::PREFIX_VIRTUAL.'trace';
- $prefix = Caster::PREFIX_PROTECTED;
- $xPrefix = "\0Exception\0";
-
- if (isset($a[$xPrefix.'previous'], $a[$trace]) && $a[$xPrefix.'previous'] instanceof \Exception) {
- $b = (array) $a[$xPrefix.'previous'];
- $class = get_debug_type($a[$xPrefix.'previous']);
- self::traceUnshift($b[$xPrefix.'trace'], $class, $b[$prefix.'file'], $b[$prefix.'line']);
- $a[$trace] = new TraceStub($b[$xPrefix.'trace'], false, 0, -\count($a[$trace]->value));
- }
-
- unset($a[$xPrefix.'previous'], $a[$prefix.'code'], $a[$prefix.'file'], $a[$prefix.'line']);
-
- return $a;
- }
-
- public static function castSilencedErrorContext(SilencedErrorContext $e, array $a, Stub $stub, $isNested)
- {
- $sPrefix = "\0".SilencedErrorContext::class."\0";
-
- if (!isset($a[$s = $sPrefix.'severity'])) {
- return $a;
- }
-
- if (isset(self::$errorTypes[$a[$s]])) {
- $a[$s] = new ConstStub(self::$errorTypes[$a[$s]], $a[$s]);
- }
-
- $trace = [[
- 'file' => $a[$sPrefix.'file'],
- 'line' => $a[$sPrefix.'line'],
- ]];
-
- if (isset($a[$sPrefix.'trace'])) {
- $trace = array_merge($trace, $a[$sPrefix.'trace']);
- }
-
- unset($a[$sPrefix.'file'], $a[$sPrefix.'line'], $a[$sPrefix.'trace']);
- $a[Caster::PREFIX_VIRTUAL.'trace'] = new TraceStub($trace, self::$traceArgs);
-
- return $a;
- }
-
- public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, $isNested)
- {
- if (!$isNested) {
- return $a;
- }
- $stub->class = '';
- $stub->handle = 0;
- $frames = $trace->value;
- $prefix = Caster::PREFIX_VIRTUAL;
-
- $a = [];
- $j = \count($frames);
- if (0 > $i = $trace->sliceOffset) {
- $i = max(0, $j + $i);
- }
- if (!isset($trace->value[$i])) {
- return [];
- }
- $lastCall = isset($frames[$i]['function']) ? (isset($frames[$i]['class']) ? $frames[0]['class'].$frames[$i]['type'] : '').$frames[$i]['function'].'()' : '';
- $frames[] = ['function' => ''];
- $collapse = false;
-
- for ($j += $trace->numberingOffset - $i++; isset($frames[$i]); ++$i, --$j) {
- $f = $frames[$i];
- $call = isset($f['function']) ? (isset($f['class']) ? $f['class'].$f['type'] : '').$f['function'] : '???';
-
- $frame = new FrameStub(
- [
- 'object' => $f['object'] ?? null,
- 'class' => $f['class'] ?? null,
- 'type' => $f['type'] ?? null,
- 'function' => $f['function'] ?? null,
- ] + $frames[$i - 1],
- false,
- true
- );
- $f = self::castFrameStub($frame, [], $frame, true);
- if (isset($f[$prefix.'src'])) {
- foreach ($f[$prefix.'src']->value as $label => $frame) {
- if (str_starts_with($label, "\0~collapse=0")) {
- if ($collapse) {
- $label = substr_replace($label, '1', 11, 1);
- } else {
- $collapse = true;
- }
- }
- $label = substr_replace($label, "title=Stack level $j.&", 2, 0);
- }
- $f = $frames[$i - 1];
- if ($trace->keepArgs && !empty($f['args']) && $frame instanceof EnumStub) {
- $frame->value['arguments'] = new ArgsStub($f['args'], $f['function'] ?? null, $f['class'] ?? null);
- }
- } elseif ('???' !== $lastCall) {
- $label = new ClassStub($lastCall);
- if (isset($label->attr['ellipsis'])) {
- $label->attr['ellipsis'] += 2;
- $label = substr_replace($prefix, "ellipsis-type=class&ellipsis={$label->attr['ellipsis']}&ellipsis-tail=1&title=Stack level $j.", 2, 0).$label->value.'()';
- } else {
- $label = substr_replace($prefix, "title=Stack level $j.", 2, 0).$label->value.'()';
- }
- } else {
- $label = substr_replace($prefix, "title=Stack level $j.", 2, 0).$lastCall;
- }
- $a[substr_replace($label, sprintf('separator=%s&', $frame instanceof EnumStub ? ' ' : ':'), 2, 0)] = $frame;
-
- $lastCall = $call;
- }
- if (null !== $trace->sliceLength) {
- $a = \array_slice($a, 0, $trace->sliceLength, true);
- }
-
- return $a;
- }
-
- public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, $isNested)
- {
- if (!$isNested) {
- return $a;
- }
- $f = $frame->value;
- $prefix = Caster::PREFIX_VIRTUAL;
-
- if (isset($f['file'], $f['line'])) {
- $cacheKey = $f;
- unset($cacheKey['object'], $cacheKey['args']);
- $cacheKey[] = self::$srcContext;
- $cacheKey = implode('-', $cacheKey);
-
- if (isset(self::$framesCache[$cacheKey])) {
- $a[$prefix.'src'] = self::$framesCache[$cacheKey];
- } else {
- if (preg_match('/\((\d+)\)(?:\([\da-f]{32}\))? : (?:eval\(\)\'d code|runtime-created function)$/', $f['file'], $match)) {
- $f['file'] = substr($f['file'], 0, -\strlen($match[0]));
- $f['line'] = (int) $match[1];
- }
- $src = $f['line'];
- $srcKey = $f['file'];
- $ellipsis = new LinkStub($srcKey, 0);
- $srcAttr = 'collapse='.(int) $ellipsis->inVendor;
- $ellipsisTail = $ellipsis->attr['ellipsis-tail'] ?? 0;
- $ellipsis = $ellipsis->attr['ellipsis'] ?? 0;
-
- if (file_exists($f['file']) && 0 <= self::$srcContext) {
- if (!empty($f['class']) && (is_subclass_of($f['class'], 'Twig\Template') || is_subclass_of($f['class'], 'Twig_Template')) && method_exists($f['class'], 'getDebugInfo')) {
- $template = null;
- if (isset($f['object'])) {
- $template = $f['object'];
- } elseif ((new \ReflectionClass($f['class']))->isInstantiable()) {
- $template = unserialize(sprintf('O:%d:"%s":0:{}', \strlen($f['class']), $f['class']));
- }
- if (null !== $template) {
- $ellipsis = 0;
- $templateSrc = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : '');
- $templateInfo = $template->getDebugInfo();
- if (isset($templateInfo[$f['line']])) {
- if (!method_exists($template, 'getSourceContext') || !file_exists($templatePath = $template->getSourceContext()->getPath())) {
- $templatePath = null;
- }
- if ($templateSrc) {
- $src = self::extractSource($templateSrc, $templateInfo[$f['line']], self::$srcContext, 'twig', $templatePath, $f);
- $srcKey = ($templatePath ?: $template->getTemplateName()).':'.$templateInfo[$f['line']];
- }
- }
- }
- }
- if ($srcKey == $f['file']) {
- $src = self::extractSource(file_get_contents($f['file']), $f['line'], self::$srcContext, 'php', $f['file'], $f);
- $srcKey .= ':'.$f['line'];
- if ($ellipsis) {
- $ellipsis += 1 + \strlen($f['line']);
- }
- }
- $srcAttr .= sprintf('&separator= &file=%s&line=%d', rawurlencode($f['file']), $f['line']);
- } else {
- $srcAttr .= '&separator=:';
- }
- $srcAttr .= $ellipsis ? '&ellipsis-type=path&ellipsis='.$ellipsis.'&ellipsis-tail='.$ellipsisTail : '';
- self::$framesCache[$cacheKey] = $a[$prefix.'src'] = new EnumStub(["\0~$srcAttr\0$srcKey" => $src]);
- }
- }
-
- unset($a[$prefix.'args'], $a[$prefix.'line'], $a[$prefix.'file']);
- if ($frame->inTraceStub) {
- unset($a[$prefix.'class'], $a[$prefix.'type'], $a[$prefix.'function']);
- }
- foreach ($a as $k => $v) {
- if (!$v) {
- unset($a[$k]);
- }
- }
- if ($frame->keepArgs && !empty($f['args'])) {
- $a[$prefix.'arguments'] = new ArgsStub($f['args'], $f['function'], $f['class']);
- }
-
- return $a;
- }
-
- private static function filterExceptionArray(string $xClass, array $a, string $xPrefix, int $filter): array
- {
- if (isset($a[$xPrefix.'trace'])) {
- $trace = $a[$xPrefix.'trace'];
- unset($a[$xPrefix.'trace']); // Ensures the trace is always last
- } else {
- $trace = [];
- }
-
- if (!($filter & Caster::EXCLUDE_VERBOSE) && $trace) {
- if (isset($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line'])) {
- self::traceUnshift($trace, $xClass, $a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line']);
- }
- $a[Caster::PREFIX_VIRTUAL.'trace'] = new TraceStub($trace, self::$traceArgs);
- }
- if (empty($a[$xPrefix.'previous'])) {
- unset($a[$xPrefix.'previous']);
- }
- unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']);
-
- if (isset($a[Caster::PREFIX_PROTECTED.'message']) && str_contains($a[Caster::PREFIX_PROTECTED.'message'], "@anonymous\0")) {
- $a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
- return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0];
- }, $a[Caster::PREFIX_PROTECTED.'message']);
- }
-
- if (isset($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line'])) {
- $a[Caster::PREFIX_PROTECTED.'file'] = new LinkStub($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line']);
- }
-
- return $a;
- }
-
- private static function traceUnshift(array &$trace, ?string $class, string $file, int $line): void
- {
- if (isset($trace[0]['file'], $trace[0]['line']) && $trace[0]['file'] === $file && $trace[0]['line'] === $line) {
- return;
- }
- array_unshift($trace, [
- 'function' => $class ? 'new '.$class : null,
- 'file' => $file,
- 'line' => $line,
- ]);
- }
-
- private static function extractSource(string $srcLines, int $line, int $srcContext, string $lang, ?string $file, array $frame): EnumStub
- {
- $srcLines = explode("\n", $srcLines);
- $src = [];
-
- for ($i = $line - 1 - $srcContext; $i <= $line - 1 + $srcContext; ++$i) {
- $src[] = ($srcLines[$i] ?? '')."\n";
- }
-
- if ($frame['function'] ?? false) {
- $stub = new CutStub(new \stdClass());
- $stub->class = (isset($frame['class']) ? $frame['class'].$frame['type'] : '').$frame['function'];
- $stub->type = Stub::TYPE_OBJECT;
- $stub->attr['cut_hash'] = true;
- $stub->attr['file'] = $frame['file'];
- $stub->attr['line'] = $frame['line'];
-
- try {
- $caller = isset($frame['class']) ? new \ReflectionMethod($frame['class'], $frame['function']) : new \ReflectionFunction($frame['function']);
- $stub->class .= ReflectionCaster::getSignature(ReflectionCaster::castFunctionAbstract($caller, [], $stub, true, Caster::EXCLUDE_VERBOSE));
-
- if ($f = $caller->getFileName()) {
- $stub->attr['file'] = $f;
- $stub->attr['line'] = $caller->getStartLine();
- }
- } catch (\ReflectionException $e) {
- // ignore fake class/function
- }
-
- $srcLines = ["\0~separator=\0" => $stub];
- } else {
- $stub = null;
- $srcLines = [];
- }
-
- $ltrim = 0;
- do {
- $pad = null;
- for ($i = $srcContext << 1; $i >= 0; --$i) {
- if (isset($src[$i][$ltrim]) && "\r" !== ($c = $src[$i][$ltrim]) && "\n" !== $c) {
- if (null === $pad) {
- $pad = $c;
- }
- if ((' ' !== $c && "\t" !== $c) || $pad !== $c) {
- break;
- }
- }
- }
- ++$ltrim;
- } while (0 > $i && null !== $pad);
-
- --$ltrim;
-
- foreach ($src as $i => $c) {
- if ($ltrim) {
- $c = isset($c[$ltrim]) && "\r" !== $c[$ltrim] ? substr($c, $ltrim) : ltrim($c, " \t");
- }
- $c = substr($c, 0, -1);
- if ($i !== $srcContext) {
- $c = new ConstStub('default', $c);
- } else {
- $c = new ConstStub($c, $stub ? 'in '.$stub->class : '');
- if (null !== $file) {
- $c->attr['file'] = $file;
- $c->attr['line'] = $line;
- }
- }
- $c->attr['lang'] = $lang;
- $srcLines[sprintf("\0~separator=› &%d\0", $i + $line - $srcContext)] = $c;
- }
-
- return new EnumStub($srcLines);
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/FrameStub.php b/vendor/symfony/var-dumper/Caster/FrameStub.php
deleted file mode 100644
index 8786755..0000000
--- a/vendor/symfony/var-dumper/Caster/FrameStub.php
+++ /dev/null
@@ -1,30 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-/**
- * Represents a single backtrace frame as returned by debug_backtrace() or Exception->getTrace().
- *
- * @author Nicolas Grekas
- */
-class FrameStub extends EnumStub
-{
- public $keepArgs;
- public $inTraceStub;
-
- public function __construct(array $frame, bool $keepArgs = true, bool $inTraceStub = false)
- {
- $this->value = $frame;
- $this->keepArgs = $keepArgs;
- $this->inTraceStub = $inTraceStub;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/GmpCaster.php b/vendor/symfony/var-dumper/Caster/GmpCaster.php
deleted file mode 100644
index 2b20e15..0000000
--- a/vendor/symfony/var-dumper/Caster/GmpCaster.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts GMP objects to array representation.
- *
- * @author Hamza Amrouche
- * @author Nicolas Grekas
- *
- * @final since Symfony 4.4
- */
-class GmpCaster
-{
- public static function castGmp(\GMP $gmp, array $a, Stub $stub, $isNested, $filter): array
- {
- $a[Caster::PREFIX_VIRTUAL.'value'] = new ConstStub(gmp_strval($gmp), gmp_strval($gmp));
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/ImagineCaster.php b/vendor/symfony/var-dumper/Caster/ImagineCaster.php
deleted file mode 100644
index d1289da..0000000
--- a/vendor/symfony/var-dumper/Caster/ImagineCaster.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Imagine\Image\ImageInterface;
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * @author Grégoire Pineau
- */
-final class ImagineCaster
-{
- public static function castImage(ImageInterface $c, array $a, Stub $stub, bool $isNested): array
- {
- $imgData = $c->get('png');
- if (\strlen($imgData) > 1 * 1000 * 1000) {
- $a += [
- Caster::PREFIX_VIRTUAL.'image' => new ConstStub($c->getSize()),
- ];
- } else {
- $a += [
- Caster::PREFIX_VIRTUAL.'image' => new ImgStub($imgData, 'image/png', $c->getSize()),
- ];
- }
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/ImgStub.php b/vendor/symfony/var-dumper/Caster/ImgStub.php
deleted file mode 100644
index 05789fe..0000000
--- a/vendor/symfony/var-dumper/Caster/ImgStub.php
+++ /dev/null
@@ -1,26 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-/**
- * @author Grégoire Pineau
- */
-class ImgStub extends ConstStub
-{
- public function __construct(string $data, string $contentType, string $size)
- {
- $this->value = '';
- $this->attr['img-data'] = $data;
- $this->attr['img-size'] = $size;
- $this->attr['content-type'] = $contentType;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/IntlCaster.php b/vendor/symfony/var-dumper/Caster/IntlCaster.php
deleted file mode 100644
index 581324d..0000000
--- a/vendor/symfony/var-dumper/Caster/IntlCaster.php
+++ /dev/null
@@ -1,172 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * @author Nicolas Grekas
- * @author Jan Schädlich
- *
- * @final since Symfony 4.4
- */
-class IntlCaster
-{
- public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub $stub, $isNested)
- {
- $a += [
- Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(),
- Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(),
- ];
-
- return self::castError($c, $a);
- }
-
- public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $stub, $isNested, $filter = 0)
- {
- $a += [
- Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(),
- Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(),
- ];
-
- if ($filter & Caster::EXCLUDE_VERBOSE) {
- $stub->cut += 3;
-
- return self::castError($c, $a);
- }
-
- $a += [
- Caster::PREFIX_VIRTUAL.'attributes' => new EnumStub(
- [
- 'PARSE_INT_ONLY' => $c->getAttribute(\NumberFormatter::PARSE_INT_ONLY),
- 'GROUPING_USED' => $c->getAttribute(\NumberFormatter::GROUPING_USED),
- 'DECIMAL_ALWAYS_SHOWN' => $c->getAttribute(\NumberFormatter::DECIMAL_ALWAYS_SHOWN),
- 'MAX_INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_INTEGER_DIGITS),
- 'MIN_INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_INTEGER_DIGITS),
- 'INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::INTEGER_DIGITS),
- 'MAX_FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_FRACTION_DIGITS),
- 'MIN_FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_FRACTION_DIGITS),
- 'FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::FRACTION_DIGITS),
- 'MULTIPLIER' => $c->getAttribute(\NumberFormatter::MULTIPLIER),
- 'GROUPING_SIZE' => $c->getAttribute(\NumberFormatter::GROUPING_SIZE),
- 'ROUNDING_MODE' => $c->getAttribute(\NumberFormatter::ROUNDING_MODE),
- 'ROUNDING_INCREMENT' => $c->getAttribute(\NumberFormatter::ROUNDING_INCREMENT),
- 'FORMAT_WIDTH' => $c->getAttribute(\NumberFormatter::FORMAT_WIDTH),
- 'PADDING_POSITION' => $c->getAttribute(\NumberFormatter::PADDING_POSITION),
- 'SECONDARY_GROUPING_SIZE' => $c->getAttribute(\NumberFormatter::SECONDARY_GROUPING_SIZE),
- 'SIGNIFICANT_DIGITS_USED' => $c->getAttribute(\NumberFormatter::SIGNIFICANT_DIGITS_USED),
- 'MIN_SIGNIFICANT_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_SIGNIFICANT_DIGITS),
- 'MAX_SIGNIFICANT_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_SIGNIFICANT_DIGITS),
- 'LENIENT_PARSE' => $c->getAttribute(\NumberFormatter::LENIENT_PARSE),
- ]
- ),
- Caster::PREFIX_VIRTUAL.'text_attributes' => new EnumStub(
- [
- 'POSITIVE_PREFIX' => $c->getTextAttribute(\NumberFormatter::POSITIVE_PREFIX),
- 'POSITIVE_SUFFIX' => $c->getTextAttribute(\NumberFormatter::POSITIVE_SUFFIX),
- 'NEGATIVE_PREFIX' => $c->getTextAttribute(\NumberFormatter::NEGATIVE_PREFIX),
- 'NEGATIVE_SUFFIX' => $c->getTextAttribute(\NumberFormatter::NEGATIVE_SUFFIX),
- 'PADDING_CHARACTER' => $c->getTextAttribute(\NumberFormatter::PADDING_CHARACTER),
- 'CURRENCY_CODE' => $c->getTextAttribute(\NumberFormatter::CURRENCY_CODE),
- 'DEFAULT_RULESET' => $c->getTextAttribute(\NumberFormatter::DEFAULT_RULESET),
- 'PUBLIC_RULESETS' => $c->getTextAttribute(\NumberFormatter::PUBLIC_RULESETS),
- ]
- ),
- Caster::PREFIX_VIRTUAL.'symbols' => new EnumStub(
- [
- 'DECIMAL_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL),
- 'GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::GROUPING_SEPARATOR_SYMBOL),
- 'PATTERN_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::PATTERN_SEPARATOR_SYMBOL),
- 'PERCENT_SYMBOL' => $c->getSymbol(\NumberFormatter::PERCENT_SYMBOL),
- 'ZERO_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::ZERO_DIGIT_SYMBOL),
- 'DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::DIGIT_SYMBOL),
- 'MINUS_SIGN_SYMBOL' => $c->getSymbol(\NumberFormatter::MINUS_SIGN_SYMBOL),
- 'PLUS_SIGN_SYMBOL' => $c->getSymbol(\NumberFormatter::PLUS_SIGN_SYMBOL),
- 'CURRENCY_SYMBOL' => $c->getSymbol(\NumberFormatter::CURRENCY_SYMBOL),
- 'INTL_CURRENCY_SYMBOL' => $c->getSymbol(\NumberFormatter::INTL_CURRENCY_SYMBOL),
- 'MONETARY_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_SEPARATOR_SYMBOL),
- 'EXPONENTIAL_SYMBOL' => $c->getSymbol(\NumberFormatter::EXPONENTIAL_SYMBOL),
- 'PERMILL_SYMBOL' => $c->getSymbol(\NumberFormatter::PERMILL_SYMBOL),
- 'PAD_ESCAPE_SYMBOL' => $c->getSymbol(\NumberFormatter::PAD_ESCAPE_SYMBOL),
- 'INFINITY_SYMBOL' => $c->getSymbol(\NumberFormatter::INFINITY_SYMBOL),
- 'NAN_SYMBOL' => $c->getSymbol(\NumberFormatter::NAN_SYMBOL),
- 'SIGNIFICANT_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL),
- 'MONETARY_GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL),
- ]
- ),
- ];
-
- return self::castError($c, $a);
- }
-
- public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, $isNested)
- {
- $a += [
- Caster::PREFIX_VIRTUAL.'display_name' => $c->getDisplayName(),
- Caster::PREFIX_VIRTUAL.'id' => $c->getID(),
- Caster::PREFIX_VIRTUAL.'raw_offset' => $c->getRawOffset(),
- ];
-
- if ($c->useDaylightTime()) {
- $a += [
- Caster::PREFIX_VIRTUAL.'dst_savings' => $c->getDSTSavings(),
- ];
- }
-
- return self::castError($c, $a);
- }
-
- public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, $isNested, $filter = 0)
- {
- $a += [
- Caster::PREFIX_VIRTUAL.'type' => $c->getType(),
- Caster::PREFIX_VIRTUAL.'first_day_of_week' => $c->getFirstDayOfWeek(),
- Caster::PREFIX_VIRTUAL.'minimal_days_in_first_week' => $c->getMinimalDaysInFirstWeek(),
- Caster::PREFIX_VIRTUAL.'repeated_wall_time_option' => $c->getRepeatedWallTimeOption(),
- Caster::PREFIX_VIRTUAL.'skipped_wall_time_option' => $c->getSkippedWallTimeOption(),
- Caster::PREFIX_VIRTUAL.'time' => $c->getTime(),
- Caster::PREFIX_VIRTUAL.'in_daylight_time' => $c->inDaylightTime(),
- Caster::PREFIX_VIRTUAL.'is_lenient' => $c->isLenient(),
- Caster::PREFIX_VIRTUAL.'time_zone' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getTimeZone()) : $c->getTimeZone(),
- ];
-
- return self::castError($c, $a);
- }
-
- public static function castIntlDateFormatter(\IntlDateFormatter $c, array $a, Stub $stub, $isNested, $filter = 0)
- {
- $a += [
- Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(),
- Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(),
- Caster::PREFIX_VIRTUAL.'calendar' => $c->getCalendar(),
- Caster::PREFIX_VIRTUAL.'time_zone_id' => $c->getTimeZoneId(),
- Caster::PREFIX_VIRTUAL.'time_type' => $c->getTimeType(),
- Caster::PREFIX_VIRTUAL.'date_type' => $c->getDateType(),
- Caster::PREFIX_VIRTUAL.'calendar_object' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getCalendarObject()) : $c->getCalendarObject(),
- Caster::PREFIX_VIRTUAL.'time_zone' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getTimeZone()) : $c->getTimeZone(),
- ];
-
- return self::castError($c, $a);
- }
-
- private static function castError($c, array $a): array
- {
- if ($errorCode = $c->getErrorCode()) {
- $a += [
- Caster::PREFIX_VIRTUAL.'error_code' => $errorCode,
- Caster::PREFIX_VIRTUAL.'error_message' => $c->getErrorMessage(),
- ];
- }
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/LinkStub.php b/vendor/symfony/var-dumper/Caster/LinkStub.php
deleted file mode 100644
index c619d9d..0000000
--- a/vendor/symfony/var-dumper/Caster/LinkStub.php
+++ /dev/null
@@ -1,108 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-/**
- * Represents a file or a URL.
- *
- * @author Nicolas Grekas
- */
-class LinkStub extends ConstStub
-{
- public $inVendor = false;
-
- private static $vendorRoots;
- private static $composerRoots;
-
- public function __construct(string $label, int $line = 0, string $href = null)
- {
- $this->value = $label;
-
- if (null === $href) {
- $href = $label;
- }
- if (!\is_string($href)) {
- return;
- }
- if (str_starts_with($href, 'file://')) {
- if ($href === $label) {
- $label = substr($label, 7);
- }
- $href = substr($href, 7);
- } elseif (str_contains($href, '://')) {
- $this->attr['href'] = $href;
-
- return;
- }
- if (!file_exists($href)) {
- return;
- }
- if ($line) {
- $this->attr['line'] = $line;
- }
- if ($label !== $this->attr['file'] = realpath($href) ?: $href) {
- return;
- }
- if ($composerRoot = $this->getComposerRoot($href, $this->inVendor)) {
- $this->attr['ellipsis'] = \strlen($href) - \strlen($composerRoot) + 1;
- $this->attr['ellipsis-type'] = 'path';
- $this->attr['ellipsis-tail'] = 1 + ($this->inVendor ? 2 + \strlen(implode('', \array_slice(explode(\DIRECTORY_SEPARATOR, substr($href, 1 - $this->attr['ellipsis'])), 0, 2))) : 0);
- } elseif (3 < \count($ellipsis = explode(\DIRECTORY_SEPARATOR, $href))) {
- $this->attr['ellipsis'] = 2 + \strlen(implode('', \array_slice($ellipsis, -2)));
- $this->attr['ellipsis-type'] = 'path';
- $this->attr['ellipsis-tail'] = 1;
- }
- }
-
- private function getComposerRoot(string $file, bool &$inVendor)
- {
- if (null === self::$vendorRoots) {
- self::$vendorRoots = [];
-
- foreach (get_declared_classes() as $class) {
- if ('C' === $class[0] && str_starts_with($class, 'ComposerAutoloaderInit')) {
- $r = new \ReflectionClass($class);
- $v = \dirname($r->getFileName(), 2);
- if (file_exists($v.'/composer/installed.json')) {
- self::$vendorRoots[] = $v.\DIRECTORY_SEPARATOR;
- }
- }
- }
- }
- $inVendor = false;
-
- if (isset(self::$composerRoots[$dir = \dirname($file)])) {
- return self::$composerRoots[$dir];
- }
-
- foreach (self::$vendorRoots as $root) {
- if ($inVendor = str_starts_with($file, $root)) {
- return $root;
- }
- }
-
- $parent = $dir;
- while (!@file_exists($parent.'/composer.json')) {
- if (!@file_exists($parent)) {
- // open_basedir restriction in effect
- break;
- }
- if ($parent === \dirname($parent)) {
- return self::$composerRoots[$dir] = false;
- }
-
- $parent = \dirname($parent);
- }
-
- return self::$composerRoots[$dir] = $parent.\DIRECTORY_SEPARATOR;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/MemcachedCaster.php b/vendor/symfony/var-dumper/Caster/MemcachedCaster.php
deleted file mode 100644
index 696cef1..0000000
--- a/vendor/symfony/var-dumper/Caster/MemcachedCaster.php
+++ /dev/null
@@ -1,81 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * @author Jan Schädlich
- *
- * @final since Symfony 4.4
- */
-class MemcachedCaster
-{
- private static $optionConstants;
- private static $defaultOptions;
-
- public static function castMemcached(\Memcached $c, array $a, Stub $stub, $isNested)
- {
- $a += [
- Caster::PREFIX_VIRTUAL.'servers' => $c->getServerList(),
- Caster::PREFIX_VIRTUAL.'options' => new EnumStub(
- self::getNonDefaultOptions($c)
- ),
- ];
-
- return $a;
- }
-
- private static function getNonDefaultOptions(\Memcached $c): array
- {
- self::$defaultOptions = self::$defaultOptions ?? self::discoverDefaultOptions();
- self::$optionConstants = self::$optionConstants ?? self::getOptionConstants();
-
- $nonDefaultOptions = [];
- foreach (self::$optionConstants as $constantKey => $value) {
- if (self::$defaultOptions[$constantKey] !== $option = $c->getOption($value)) {
- $nonDefaultOptions[$constantKey] = $option;
- }
- }
-
- return $nonDefaultOptions;
- }
-
- private static function discoverDefaultOptions(): array
- {
- $defaultMemcached = new \Memcached();
- $defaultMemcached->addServer('127.0.0.1', 11211);
-
- $defaultOptions = [];
- self::$optionConstants = self::$optionConstants ?? self::getOptionConstants();
-
- foreach (self::$optionConstants as $constantKey => $value) {
- $defaultOptions[$constantKey] = $defaultMemcached->getOption($value);
- }
-
- return $defaultOptions;
- }
-
- private static function getOptionConstants(): array
- {
- $reflectedMemcached = new \ReflectionClass(\Memcached::class);
-
- $optionConstants = [];
- foreach ($reflectedMemcached->getConstants() as $constantKey => $value) {
- if (str_starts_with($constantKey, 'OPT_')) {
- $optionConstants[$constantKey] = $value;
- }
- }
-
- return $optionConstants;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/MysqliCaster.php b/vendor/symfony/var-dumper/Caster/MysqliCaster.php
deleted file mode 100644
index bfe6f08..0000000
--- a/vendor/symfony/var-dumper/Caster/MysqliCaster.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * @author Nicolas Grekas
- *
- * @internal
- */
-final class MysqliCaster
-{
- public static function castMysqliDriver(\mysqli_driver $c, array $a, Stub $stub, bool $isNested): array
- {
- foreach ($a as $k => $v) {
- if (isset($c->$k)) {
- $a[$k] = $c->$k;
- }
- }
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/PdoCaster.php b/vendor/symfony/var-dumper/Caster/PdoCaster.php
deleted file mode 100644
index 47b0a62..0000000
--- a/vendor/symfony/var-dumper/Caster/PdoCaster.php
+++ /dev/null
@@ -1,122 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts PDO related classes to array representation.
- *
- * @author Nicolas Grekas
- *
- * @final since Symfony 4.4
- */
-class PdoCaster
-{
- private const PDO_ATTRIBUTES = [
- 'CASE' => [
- \PDO::CASE_LOWER => 'LOWER',
- \PDO::CASE_NATURAL => 'NATURAL',
- \PDO::CASE_UPPER => 'UPPER',
- ],
- 'ERRMODE' => [
- \PDO::ERRMODE_SILENT => 'SILENT',
- \PDO::ERRMODE_WARNING => 'WARNING',
- \PDO::ERRMODE_EXCEPTION => 'EXCEPTION',
- ],
- 'TIMEOUT',
- 'PREFETCH',
- 'AUTOCOMMIT',
- 'PERSISTENT',
- 'DRIVER_NAME',
- 'SERVER_INFO',
- 'ORACLE_NULLS' => [
- \PDO::NULL_NATURAL => 'NATURAL',
- \PDO::NULL_EMPTY_STRING => 'EMPTY_STRING',
- \PDO::NULL_TO_STRING => 'TO_STRING',
- ],
- 'CLIENT_VERSION',
- 'SERVER_VERSION',
- 'STATEMENT_CLASS',
- 'EMULATE_PREPARES',
- 'CONNECTION_STATUS',
- 'STRINGIFY_FETCHES',
- 'DEFAULT_FETCH_MODE' => [
- \PDO::FETCH_ASSOC => 'ASSOC',
- \PDO::FETCH_BOTH => 'BOTH',
- \PDO::FETCH_LAZY => 'LAZY',
- \PDO::FETCH_NUM => 'NUM',
- \PDO::FETCH_OBJ => 'OBJ',
- ],
- ];
-
- public static function castPdo(\PDO $c, array $a, Stub $stub, $isNested)
- {
- $attr = [];
- $errmode = $c->getAttribute(\PDO::ATTR_ERRMODE);
- $c->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
-
- foreach (self::PDO_ATTRIBUTES as $k => $v) {
- if (!isset($k[0])) {
- $k = $v;
- $v = [];
- }
-
- try {
- $attr[$k] = 'ERRMODE' === $k ? $errmode : $c->getAttribute(\constant('PDO::ATTR_'.$k));
- if ($v && isset($v[$attr[$k]])) {
- $attr[$k] = new ConstStub($v[$attr[$k]], $attr[$k]);
- }
- } catch (\Exception $e) {
- }
- }
- if (isset($attr[$k = 'STATEMENT_CLASS'][1])) {
- if ($attr[$k][1]) {
- $attr[$k][1] = new ArgsStub($attr[$k][1], '__construct', $attr[$k][0]);
- }
- $attr[$k][0] = new ClassStub($attr[$k][0]);
- }
-
- $prefix = Caster::PREFIX_VIRTUAL;
- $a += [
- $prefix.'inTransaction' => method_exists($c, 'inTransaction'),
- $prefix.'errorInfo' => $c->errorInfo(),
- $prefix.'attributes' => new EnumStub($attr),
- ];
-
- if ($a[$prefix.'inTransaction']) {
- $a[$prefix.'inTransaction'] = $c->inTransaction();
- } else {
- unset($a[$prefix.'inTransaction']);
- }
-
- if (!isset($a[$prefix.'errorInfo'][1], $a[$prefix.'errorInfo'][2])) {
- unset($a[$prefix.'errorInfo']);
- }
-
- $c->setAttribute(\PDO::ATTR_ERRMODE, $errmode);
-
- return $a;
- }
-
- public static function castPdoStatement(\PDOStatement $c, array $a, Stub $stub, $isNested)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
- $a[$prefix.'errorInfo'] = $c->errorInfo();
-
- if (!isset($a[$prefix.'errorInfo'][1], $a[$prefix.'errorInfo'][2])) {
- unset($a[$prefix.'errorInfo']);
- }
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/PgSqlCaster.php b/vendor/symfony/var-dumper/Caster/PgSqlCaster.php
deleted file mode 100644
index 3097c51..0000000
--- a/vendor/symfony/var-dumper/Caster/PgSqlCaster.php
+++ /dev/null
@@ -1,156 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts pqsql resources to array representation.
- *
- * @author Nicolas Grekas
- *
- * @final since Symfony 4.4
- */
-class PgSqlCaster
-{
- private const PARAM_CODES = [
- 'server_encoding',
- 'client_encoding',
- 'is_superuser',
- 'session_authorization',
- 'DateStyle',
- 'TimeZone',
- 'IntervalStyle',
- 'integer_datetimes',
- 'application_name',
- 'standard_conforming_strings',
- ];
-
- private const TRANSACTION_STATUS = [
- \PGSQL_TRANSACTION_IDLE => 'PGSQL_TRANSACTION_IDLE',
- \PGSQL_TRANSACTION_ACTIVE => 'PGSQL_TRANSACTION_ACTIVE',
- \PGSQL_TRANSACTION_INTRANS => 'PGSQL_TRANSACTION_INTRANS',
- \PGSQL_TRANSACTION_INERROR => 'PGSQL_TRANSACTION_INERROR',
- \PGSQL_TRANSACTION_UNKNOWN => 'PGSQL_TRANSACTION_UNKNOWN',
- ];
-
- private const RESULT_STATUS = [
- \PGSQL_EMPTY_QUERY => 'PGSQL_EMPTY_QUERY',
- \PGSQL_COMMAND_OK => 'PGSQL_COMMAND_OK',
- \PGSQL_TUPLES_OK => 'PGSQL_TUPLES_OK',
- \PGSQL_COPY_OUT => 'PGSQL_COPY_OUT',
- \PGSQL_COPY_IN => 'PGSQL_COPY_IN',
- \PGSQL_BAD_RESPONSE => 'PGSQL_BAD_RESPONSE',
- \PGSQL_NONFATAL_ERROR => 'PGSQL_NONFATAL_ERROR',
- \PGSQL_FATAL_ERROR => 'PGSQL_FATAL_ERROR',
- ];
-
- private const DIAG_CODES = [
- 'severity' => \PGSQL_DIAG_SEVERITY,
- 'sqlstate' => \PGSQL_DIAG_SQLSTATE,
- 'message' => \PGSQL_DIAG_MESSAGE_PRIMARY,
- 'detail' => \PGSQL_DIAG_MESSAGE_DETAIL,
- 'hint' => \PGSQL_DIAG_MESSAGE_HINT,
- 'statement position' => \PGSQL_DIAG_STATEMENT_POSITION,
- 'internal position' => \PGSQL_DIAG_INTERNAL_POSITION,
- 'internal query' => \PGSQL_DIAG_INTERNAL_QUERY,
- 'context' => \PGSQL_DIAG_CONTEXT,
- 'file' => \PGSQL_DIAG_SOURCE_FILE,
- 'line' => \PGSQL_DIAG_SOURCE_LINE,
- 'function' => \PGSQL_DIAG_SOURCE_FUNCTION,
- ];
-
- public static function castLargeObject($lo, array $a, Stub $stub, $isNested)
- {
- $a['seek position'] = pg_lo_tell($lo);
-
- return $a;
- }
-
- public static function castLink($link, array $a, Stub $stub, $isNested)
- {
- $a['status'] = pg_connection_status($link);
- $a['status'] = new ConstStub(\PGSQL_CONNECTION_OK === $a['status'] ? 'PGSQL_CONNECTION_OK' : 'PGSQL_CONNECTION_BAD', $a['status']);
- $a['busy'] = pg_connection_busy($link);
-
- $a['transaction'] = pg_transaction_status($link);
- if (isset(self::TRANSACTION_STATUS[$a['transaction']])) {
- $a['transaction'] = new ConstStub(self::TRANSACTION_STATUS[$a['transaction']], $a['transaction']);
- }
-
- $a['pid'] = pg_get_pid($link);
- $a['last error'] = pg_last_error($link);
- $a['last notice'] = pg_last_notice($link);
- $a['host'] = pg_host($link);
- $a['port'] = pg_port($link);
- $a['dbname'] = pg_dbname($link);
- $a['options'] = pg_options($link);
- $a['version'] = pg_version($link);
-
- foreach (self::PARAM_CODES as $v) {
- if (false !== $s = pg_parameter_status($link, $v)) {
- $a['param'][$v] = $s;
- }
- }
-
- $a['param']['client_encoding'] = pg_client_encoding($link);
- $a['param'] = new EnumStub($a['param']);
-
- return $a;
- }
-
- public static function castResult($result, array $a, Stub $stub, $isNested)
- {
- $a['num rows'] = pg_num_rows($result);
- $a['status'] = pg_result_status($result);
- if (isset(self::RESULT_STATUS[$a['status']])) {
- $a['status'] = new ConstStub(self::RESULT_STATUS[$a['status']], $a['status']);
- }
- $a['command-completion tag'] = pg_result_status($result, \PGSQL_STATUS_STRING);
-
- if (-1 === $a['num rows']) {
- foreach (self::DIAG_CODES as $k => $v) {
- $a['error'][$k] = pg_result_error_field($result, $v);
- }
- }
-
- $a['affected rows'] = pg_affected_rows($result);
- $a['last OID'] = pg_last_oid($result);
-
- $fields = pg_num_fields($result);
-
- for ($i = 0; $i < $fields; ++$i) {
- $field = [
- 'name' => pg_field_name($result, $i),
- 'table' => sprintf('%s (OID: %s)', pg_field_table($result, $i), pg_field_table($result, $i, true)),
- 'type' => sprintf('%s (OID: %s)', pg_field_type($result, $i), pg_field_type_oid($result, $i)),
- 'nullable' => (bool) pg_field_is_null($result, $i),
- 'storage' => pg_field_size($result, $i).' bytes',
- 'display' => pg_field_prtlen($result, $i).' chars',
- ];
- if (' (OID: )' === $field['table']) {
- $field['table'] = null;
- }
- if ('-1 bytes' === $field['storage']) {
- $field['storage'] = 'variable size';
- } elseif ('1 bytes' === $field['storage']) {
- $field['storage'] = '1 byte';
- }
- if ('1 chars' === $field['display']) {
- $field['display'] = '1 char';
- }
- $a['fields'][] = new EnumStub($field);
- }
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php b/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php
deleted file mode 100644
index ec02f81..0000000
--- a/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use ProxyManager\Proxy\ProxyInterface;
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * @author Nicolas Grekas
- *
- * @final since Symfony 4.4
- */
-class ProxyManagerCaster
-{
- public static function castProxy(ProxyInterface $c, array $a, Stub $stub, $isNested)
- {
- if ($parent = get_parent_class($c)) {
- $stub->class .= ' - '.$parent;
- }
- $stub->class .= '@proxy';
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/RedisCaster.php b/vendor/symfony/var-dumper/Caster/RedisCaster.php
deleted file mode 100644
index bd877cb..0000000
--- a/vendor/symfony/var-dumper/Caster/RedisCaster.php
+++ /dev/null
@@ -1,152 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts Redis class from ext-redis to array representation.
- *
- * @author Nicolas Grekas
- *
- * @final since Symfony 4.4
- */
-class RedisCaster
-{
- private const SERIALIZERS = [
- \Redis::SERIALIZER_NONE => 'NONE',
- \Redis::SERIALIZER_PHP => 'PHP',
- 2 => 'IGBINARY', // Optional Redis::SERIALIZER_IGBINARY
- ];
-
- private const MODES = [
- \Redis::ATOMIC => 'ATOMIC',
- \Redis::MULTI => 'MULTI',
- \Redis::PIPELINE => 'PIPELINE',
- ];
-
- private const COMPRESSION_MODES = [
- 0 => 'NONE', // Redis::COMPRESSION_NONE
- 1 => 'LZF', // Redis::COMPRESSION_LZF
- ];
-
- private const FAILOVER_OPTIONS = [
- \RedisCluster::FAILOVER_NONE => 'NONE',
- \RedisCluster::FAILOVER_ERROR => 'ERROR',
- \RedisCluster::FAILOVER_DISTRIBUTE => 'DISTRIBUTE',
- \RedisCluster::FAILOVER_DISTRIBUTE_SLAVES => 'DISTRIBUTE_SLAVES',
- ];
-
- public static function castRedis(\Redis $c, array $a, Stub $stub, $isNested)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
-
- if (!$connected = $c->isConnected()) {
- return $a + [
- $prefix.'isConnected' => $connected,
- ];
- }
-
- $mode = $c->getMode();
-
- return $a + [
- $prefix.'isConnected' => $connected,
- $prefix.'host' => $c->getHost(),
- $prefix.'port' => $c->getPort(),
- $prefix.'auth' => $c->getAuth(),
- $prefix.'mode' => isset(self::MODES[$mode]) ? new ConstStub(self::MODES[$mode], $mode) : $mode,
- $prefix.'dbNum' => $c->getDbNum(),
- $prefix.'timeout' => $c->getTimeout(),
- $prefix.'lastError' => $c->getLastError(),
- $prefix.'persistentId' => $c->getPersistentID(),
- $prefix.'options' => self::getRedisOptions($c),
- ];
- }
-
- public static function castRedisArray(\RedisArray $c, array $a, Stub $stub, $isNested)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
-
- return $a + [
- $prefix.'hosts' => $c->_hosts(),
- $prefix.'function' => ClassStub::wrapCallable($c->_function()),
- $prefix.'lastError' => $c->getLastError(),
- $prefix.'options' => self::getRedisOptions($c),
- ];
- }
-
- public static function castRedisCluster(\RedisCluster $c, array $a, Stub $stub, $isNested)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
- $failover = $c->getOption(\RedisCluster::OPT_SLAVE_FAILOVER);
-
- $a += [
- $prefix.'_masters' => $c->_masters(),
- $prefix.'_redir' => $c->_redir(),
- $prefix.'mode' => new ConstStub($c->getMode() ? 'MULTI' : 'ATOMIC', $c->getMode()),
- $prefix.'lastError' => $c->getLastError(),
- $prefix.'options' => self::getRedisOptions($c, [
- 'SLAVE_FAILOVER' => isset(self::FAILOVER_OPTIONS[$failover]) ? new ConstStub(self::FAILOVER_OPTIONS[$failover], $failover) : $failover,
- ]),
- ];
-
- return $a;
- }
-
- /**
- * @param \Redis|\RedisArray|\RedisCluster $redis
- */
- private static function getRedisOptions($redis, array $options = []): EnumStub
- {
- $serializer = $redis->getOption(\Redis::OPT_SERIALIZER);
- if (\is_array($serializer)) {
- foreach ($serializer as &$v) {
- if (isset(self::SERIALIZERS[$v])) {
- $v = new ConstStub(self::SERIALIZERS[$v], $v);
- }
- }
- } elseif (isset(self::SERIALIZERS[$serializer])) {
- $serializer = new ConstStub(self::SERIALIZERS[$serializer], $serializer);
- }
-
- $compression = \defined('Redis::OPT_COMPRESSION') ? $redis->getOption(\Redis::OPT_COMPRESSION) : 0;
- if (\is_array($compression)) {
- foreach ($compression as &$v) {
- if (isset(self::COMPRESSION_MODES[$v])) {
- $v = new ConstStub(self::COMPRESSION_MODES[$v], $v);
- }
- }
- } elseif (isset(self::COMPRESSION_MODES[$compression])) {
- $compression = new ConstStub(self::COMPRESSION_MODES[$compression], $compression);
- }
-
- $retry = \defined('Redis::OPT_SCAN') ? $redis->getOption(\Redis::OPT_SCAN) : 0;
- if (\is_array($retry)) {
- foreach ($retry as &$v) {
- $v = new ConstStub($v ? 'RETRY' : 'NORETRY', $v);
- }
- } else {
- $retry = new ConstStub($retry ? 'RETRY' : 'NORETRY', $retry);
- }
-
- $options += [
- 'TCP_KEEPALIVE' => \defined('Redis::OPT_TCP_KEEPALIVE') ? $redis->getOption(\Redis::OPT_TCP_KEEPALIVE) : 0,
- 'READ_TIMEOUT' => $redis->getOption(\Redis::OPT_READ_TIMEOUT),
- 'COMPRESSION' => $compression,
- 'SERIALIZER' => $serializer,
- 'PREFIX' => $redis->getOption(\Redis::OPT_PREFIX),
- 'SCAN' => $retry,
- ];
-
- return new EnumStub($options);
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/ReflectionCaster.php b/vendor/symfony/var-dumper/Caster/ReflectionCaster.php
deleted file mode 100644
index 2a74b25..0000000
--- a/vendor/symfony/var-dumper/Caster/ReflectionCaster.php
+++ /dev/null
@@ -1,405 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts Reflector related classes to array representation.
- *
- * @author Nicolas Grekas
- *
- * @final since Symfony 4.4
- */
-class ReflectionCaster
-{
- public const UNSET_CLOSURE_FILE_INFO = ['Closure' => __CLASS__.'::unsetClosureFileInfo'];
-
- private const EXTRA_MAP = [
- 'docComment' => 'getDocComment',
- 'extension' => 'getExtensionName',
- 'isDisabled' => 'isDisabled',
- 'isDeprecated' => 'isDeprecated',
- 'isInternal' => 'isInternal',
- 'isUserDefined' => 'isUserDefined',
- 'isGenerator' => 'isGenerator',
- 'isVariadic' => 'isVariadic',
- ];
-
- public static function castClosure(\Closure $c, array $a, Stub $stub, $isNested, $filter = 0)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
- $c = new \ReflectionFunction($c);
-
- $a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter);
-
- if (!str_contains($c->name, '{closure}')) {
- $stub->class = isset($a[$prefix.'class']) ? $a[$prefix.'class']->value.'::'.$c->name : $c->name;
- unset($a[$prefix.'class']);
- }
- unset($a[$prefix.'extra']);
-
- $stub->class .= self::getSignature($a);
-
- if ($f = $c->getFileName()) {
- $stub->attr['file'] = $f;
- $stub->attr['line'] = $c->getStartLine();
- }
-
- unset($a[$prefix.'parameters']);
-
- if ($filter & Caster::EXCLUDE_VERBOSE) {
- $stub->cut += ($c->getFileName() ? 2 : 0) + \count($a);
-
- return [];
- }
-
- if ($f) {
- $a[$prefix.'file'] = new LinkStub($f, $c->getStartLine());
- $a[$prefix.'line'] = $c->getStartLine().' to '.$c->getEndLine();
- }
-
- return $a;
- }
-
- public static function unsetClosureFileInfo(\Closure $c, array $a)
- {
- unset($a[Caster::PREFIX_VIRTUAL.'file'], $a[Caster::PREFIX_VIRTUAL.'line']);
-
- return $a;
- }
-
- public static function castGenerator(\Generator $c, array $a, Stub $stub, $isNested)
- {
- // Cannot create ReflectionGenerator based on a terminated Generator
- try {
- $reflectionGenerator = new \ReflectionGenerator($c);
- } catch (\Exception $e) {
- $a[Caster::PREFIX_VIRTUAL.'closed'] = true;
-
- return $a;
- }
-
- return self::castReflectionGenerator($reflectionGenerator, $a, $stub, $isNested);
- }
-
- public static function castType(\ReflectionType $c, array $a, Stub $stub, $isNested)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
-
- if ($c instanceof \ReflectionNamedType || \PHP_VERSION_ID < 80000) {
- $a += [
- $prefix.'name' => $c instanceof \ReflectionNamedType ? $c->getName() : (string) $c,
- $prefix.'allowsNull' => $c->allowsNull(),
- $prefix.'isBuiltin' => $c->isBuiltin(),
- ];
- } elseif ($c instanceof \ReflectionUnionType || $c instanceof \ReflectionIntersectionType) {
- $a[$prefix.'allowsNull'] = $c->allowsNull();
- self::addMap($a, $c, [
- 'types' => 'getTypes',
- ]);
- } else {
- $a[$prefix.'allowsNull'] = $c->allowsNull();
- }
-
- return $a;
- }
-
- public static function castReflectionGenerator(\ReflectionGenerator $c, array $a, Stub $stub, $isNested)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
-
- if ($c->getThis()) {
- $a[$prefix.'this'] = new CutStub($c->getThis());
- }
- $function = $c->getFunction();
- $frame = [
- 'class' => $function->class ?? null,
- 'type' => isset($function->class) ? ($function->isStatic() ? '::' : '->') : null,
- 'function' => $function->name,
- 'file' => $c->getExecutingFile(),
- 'line' => $c->getExecutingLine(),
- ];
- if ($trace = $c->getTrace(\DEBUG_BACKTRACE_IGNORE_ARGS)) {
- $function = new \ReflectionGenerator($c->getExecutingGenerator());
- array_unshift($trace, [
- 'function' => 'yield',
- 'file' => $function->getExecutingFile(),
- 'line' => $function->getExecutingLine() - (int) (\PHP_VERSION_ID < 80100),
- ]);
- $trace[] = $frame;
- $a[$prefix.'trace'] = new TraceStub($trace, false, 0, -1, -1);
- } else {
- $function = new FrameStub($frame, false, true);
- $function = ExceptionCaster::castFrameStub($function, [], $function, true);
- $a[$prefix.'executing'] = $function[$prefix.'src'];
- }
-
- $a[Caster::PREFIX_VIRTUAL.'closed'] = false;
-
- return $a;
- }
-
- public static function castClass(\ReflectionClass $c, array $a, Stub $stub, $isNested, $filter = 0)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
-
- if ($n = \Reflection::getModifierNames($c->getModifiers())) {
- $a[$prefix.'modifiers'] = implode(' ', $n);
- }
-
- self::addMap($a, $c, [
- 'extends' => 'getParentClass',
- 'implements' => 'getInterfaceNames',
- 'constants' => 'getConstants',
- ]);
-
- foreach ($c->getProperties() as $n) {
- $a[$prefix.'properties'][$n->name] = $n;
- }
-
- foreach ($c->getMethods() as $n) {
- $a[$prefix.'methods'][$n->name] = $n;
- }
-
- if (!($filter & Caster::EXCLUDE_VERBOSE) && !$isNested) {
- self::addExtra($a, $c);
- }
-
- return $a;
- }
-
- public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, array $a, Stub $stub, $isNested, $filter = 0)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
-
- self::addMap($a, $c, [
- 'returnsReference' => 'returnsReference',
- 'returnType' => 'getReturnType',
- 'class' => 'getClosureScopeClass',
- 'this' => 'getClosureThis',
- ]);
-
- if (isset($a[$prefix.'returnType'])) {
- $v = $a[$prefix.'returnType'];
- $v = $v instanceof \ReflectionNamedType ? $v->getName() : (string) $v;
- $a[$prefix.'returnType'] = new ClassStub($a[$prefix.'returnType'] instanceof \ReflectionNamedType && $a[$prefix.'returnType']->allowsNull() && 'mixed' !== $v ? '?'.$v : $v, [class_exists($v, false) || interface_exists($v, false) || trait_exists($v, false) ? $v : '', '']);
- }
- if (isset($a[$prefix.'class'])) {
- $a[$prefix.'class'] = new ClassStub($a[$prefix.'class']);
- }
- if (isset($a[$prefix.'this'])) {
- $a[$prefix.'this'] = new CutStub($a[$prefix.'this']);
- }
-
- foreach ($c->getParameters() as $v) {
- $k = '$'.$v->name;
- if ($v->isVariadic()) {
- $k = '...'.$k;
- }
- if ($v->isPassedByReference()) {
- $k = '&'.$k;
- }
- $a[$prefix.'parameters'][$k] = $v;
- }
- if (isset($a[$prefix.'parameters'])) {
- $a[$prefix.'parameters'] = new EnumStub($a[$prefix.'parameters']);
- }
-
- if (!($filter & Caster::EXCLUDE_VERBOSE) && $v = $c->getStaticVariables()) {
- foreach ($v as $k => &$v) {
- if (\is_object($v)) {
- $a[$prefix.'use']['$'.$k] = new CutStub($v);
- } else {
- $a[$prefix.'use']['$'.$k] = &$v;
- }
- }
- unset($v);
- $a[$prefix.'use'] = new EnumStub($a[$prefix.'use']);
- }
-
- if (!($filter & Caster::EXCLUDE_VERBOSE) && !$isNested) {
- self::addExtra($a, $c);
- }
-
- return $a;
- }
-
- public static function castMethod(\ReflectionMethod $c, array $a, Stub $stub, $isNested)
- {
- $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers()));
-
- return $a;
- }
-
- public static function castParameter(\ReflectionParameter $c, array $a, Stub $stub, $isNested)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
-
- self::addMap($a, $c, [
- 'position' => 'getPosition',
- 'isVariadic' => 'isVariadic',
- 'byReference' => 'isPassedByReference',
- 'allowsNull' => 'allowsNull',
- ]);
-
- if ($v = $c->getType()) {
- $a[$prefix.'typeHint'] = $v instanceof \ReflectionNamedType ? $v->getName() : (string) $v;
- }
-
- if (isset($a[$prefix.'typeHint'])) {
- $v = $a[$prefix.'typeHint'];
- $a[$prefix.'typeHint'] = new ClassStub($v, [class_exists($v, false) || interface_exists($v, false) || trait_exists($v, false) ? $v : '', '']);
- } else {
- unset($a[$prefix.'allowsNull']);
- }
-
- if ($c->isOptional()) {
- try {
- $a[$prefix.'default'] = $v = $c->getDefaultValue();
- if ($c->isDefaultValueConstant()) {
- $a[$prefix.'default'] = new ConstStub($c->getDefaultValueConstantName(), $v);
- }
- if (null === $v) {
- unset($a[$prefix.'allowsNull']);
- }
- } catch (\ReflectionException $e) {
- }
- }
-
- return $a;
- }
-
- public static function castProperty(\ReflectionProperty $c, array $a, Stub $stub, $isNested)
- {
- $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers()));
- self::addExtra($a, $c);
-
- return $a;
- }
-
- public static function castReference(\ReflectionReference $c, array $a, Stub $stub, $isNested)
- {
- $a[Caster::PREFIX_VIRTUAL.'id'] = $c->getId();
-
- return $a;
- }
-
- public static function castExtension(\ReflectionExtension $c, array $a, Stub $stub, $isNested)
- {
- self::addMap($a, $c, [
- 'version' => 'getVersion',
- 'dependencies' => 'getDependencies',
- 'iniEntries' => 'getIniEntries',
- 'isPersistent' => 'isPersistent',
- 'isTemporary' => 'isTemporary',
- 'constants' => 'getConstants',
- 'functions' => 'getFunctions',
- 'classes' => 'getClasses',
- ]);
-
- return $a;
- }
-
- public static function castZendExtension(\ReflectionZendExtension $c, array $a, Stub $stub, $isNested)
- {
- self::addMap($a, $c, [
- 'version' => 'getVersion',
- 'author' => 'getAuthor',
- 'copyright' => 'getCopyright',
- 'url' => 'getURL',
- ]);
-
- return $a;
- }
-
- public static function getSignature(array $a)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
- $signature = '';
-
- if (isset($a[$prefix.'parameters'])) {
- foreach ($a[$prefix.'parameters']->value as $k => $param) {
- $signature .= ', ';
- if ($type = $param->getType()) {
- if (!$type instanceof \ReflectionNamedType) {
- $signature .= $type.' ';
- } else {
- if (!$param->isOptional() && $param->allowsNull() && 'mixed' !== $type->getName()) {
- $signature .= '?';
- }
- $signature .= substr(strrchr('\\'.$type->getName(), '\\'), 1).' ';
- }
- }
- $signature .= $k;
-
- if (!$param->isDefaultValueAvailable()) {
- continue;
- }
- $v = $param->getDefaultValue();
- $signature .= ' = ';
-
- if ($param->isDefaultValueConstant()) {
- $signature .= substr(strrchr('\\'.$param->getDefaultValueConstantName(), '\\'), 1);
- } elseif (null === $v) {
- $signature .= 'null';
- } elseif (\is_array($v)) {
- $signature .= $v ? '[…'.\count($v).']' : '[]';
- } elseif (\is_string($v)) {
- $signature .= 10 > \strlen($v) && !str_contains($v, '\\') ? "'{$v}'" : "'…".\strlen($v)."'";
- } elseif (\is_bool($v)) {
- $signature .= $v ? 'true' : 'false';
- } elseif (\is_object($v)) {
- $signature .= 'new '.substr(strrchr('\\'.get_debug_type($v), '\\'), 1);
- } else {
- $signature .= $v;
- }
- }
- }
- $signature = (empty($a[$prefix.'returnsReference']) ? '' : '&').'('.substr($signature, 2).')';
-
- if (isset($a[$prefix.'returnType'])) {
- $signature .= ': '.substr(strrchr('\\'.$a[$prefix.'returnType'], '\\'), 1);
- }
-
- return $signature;
- }
-
- private static function addExtra(array &$a, \Reflector $c)
- {
- $x = isset($a[Caster::PREFIX_VIRTUAL.'extra']) ? $a[Caster::PREFIX_VIRTUAL.'extra']->value : [];
-
- if (method_exists($c, 'getFileName') && $m = $c->getFileName()) {
- $x['file'] = new LinkStub($m, $c->getStartLine());
- $x['line'] = $c->getStartLine().' to '.$c->getEndLine();
- }
-
- self::addMap($x, $c, self::EXTRA_MAP, '');
-
- if ($x) {
- $a[Caster::PREFIX_VIRTUAL.'extra'] = new EnumStub($x);
- }
- }
-
- private static function addMap(array &$a, $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL)
- {
- foreach ($map as $k => $m) {
- if (\PHP_VERSION_ID >= 80000 && 'isDisabled' === $k) {
- continue;
- }
-
- if (method_exists($c, $m) && false !== ($m = $c->$m()) && null !== $m) {
- $a[$prefix.$k] = $m instanceof \Reflector ? $m->name : $m;
- }
- }
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/ResourceCaster.php b/vendor/symfony/var-dumper/Caster/ResourceCaster.php
deleted file mode 100644
index a3278a8..0000000
--- a/vendor/symfony/var-dumper/Caster/ResourceCaster.php
+++ /dev/null
@@ -1,105 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts common resource types to array representation.
- *
- * @author Nicolas Grekas
- *
- * @final since Symfony 4.4
- */
-class ResourceCaster
-{
- /**
- * @param \CurlHandle|resource $h
- *
- * @return array
- */
- public static function castCurl($h, array $a, Stub $stub, $isNested)
- {
- return curl_getinfo($h);
- }
-
- public static function castDba($dba, array $a, Stub $stub, $isNested)
- {
- $list = dba_list();
- $a['file'] = $list[(int) $dba];
-
- return $a;
- }
-
- public static function castProcess($process, array $a, Stub $stub, $isNested)
- {
- return proc_get_status($process);
- }
-
- public static function castStream($stream, array $a, Stub $stub, $isNested)
- {
- $a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested);
- if ($a['uri'] ?? false) {
- $a['uri'] = new LinkStub($a['uri']);
- }
-
- return $a;
- }
-
- public static function castStreamContext($stream, array $a, Stub $stub, $isNested)
- {
- return @stream_context_get_params($stream) ?: $a;
- }
-
- public static function castGd($gd, array $a, Stub $stub, $isNested)
- {
- $a['size'] = imagesx($gd).'x'.imagesy($gd);
- $a['trueColor'] = imageistruecolor($gd);
-
- return $a;
- }
-
- public static function castMysqlLink($h, array $a, Stub $stub, $isNested)
- {
- $a['host'] = mysql_get_host_info($h);
- $a['protocol'] = mysql_get_proto_info($h);
- $a['server'] = mysql_get_server_info($h);
-
- return $a;
- }
-
- public static function castOpensslX509($h, array $a, Stub $stub, $isNested)
- {
- $stub->cut = -1;
- $info = openssl_x509_parse($h, false);
-
- $pin = openssl_pkey_get_public($h);
- $pin = openssl_pkey_get_details($pin)['key'];
- $pin = \array_slice(explode("\n", $pin), 1, -2);
- $pin = base64_decode(implode('', $pin));
- $pin = base64_encode(hash('sha256', $pin, true));
-
- $a += [
- 'subject' => new EnumStub(array_intersect_key($info['subject'], ['organizationName' => true, 'commonName' => true])),
- 'issuer' => new EnumStub(array_intersect_key($info['issuer'], ['organizationName' => true, 'commonName' => true])),
- 'expiry' => new ConstStub(date(\DateTime::ISO8601, $info['validTo_time_t']), $info['validTo_time_t']),
- 'fingerprint' => new EnumStub([
- 'md5' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'md5')), 2, ':', true)),
- 'sha1' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha1')), 2, ':', true)),
- 'sha256' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha256')), 2, ':', true)),
- 'pin-sha256' => new ConstStub($pin),
- ]),
- ];
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/SplCaster.php b/vendor/symfony/var-dumper/Caster/SplCaster.php
deleted file mode 100644
index be9d66b..0000000
--- a/vendor/symfony/var-dumper/Caster/SplCaster.php
+++ /dev/null
@@ -1,245 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts SPL related classes to array representation.
- *
- * @author Nicolas Grekas
- *
- * @final since Symfony 4.4
- */
-class SplCaster
-{
- private const SPL_FILE_OBJECT_FLAGS = [
- \SplFileObject::DROP_NEW_LINE => 'DROP_NEW_LINE',
- \SplFileObject::READ_AHEAD => 'READ_AHEAD',
- \SplFileObject::SKIP_EMPTY => 'SKIP_EMPTY',
- \SplFileObject::READ_CSV => 'READ_CSV',
- ];
-
- public static function castArrayObject(\ArrayObject $c, array $a, Stub $stub, $isNested)
- {
- return self::castSplArray($c, $a, $stub, $isNested);
- }
-
- public static function castArrayIterator(\ArrayIterator $c, array $a, Stub $stub, $isNested)
- {
- return self::castSplArray($c, $a, $stub, $isNested);
- }
-
- public static function castHeap(\Iterator $c, array $a, Stub $stub, $isNested)
- {
- $a += [
- Caster::PREFIX_VIRTUAL.'heap' => iterator_to_array(clone $c),
- ];
-
- return $a;
- }
-
- public static function castDoublyLinkedList(\SplDoublyLinkedList $c, array $a, Stub $stub, $isNested)
- {
- $prefix = Caster::PREFIX_VIRTUAL;
- $mode = $c->getIteratorMode();
- $c->setIteratorMode(\SplDoublyLinkedList::IT_MODE_KEEP | $mode & ~\SplDoublyLinkedList::IT_MODE_DELETE);
-
- $a += [
- $prefix.'mode' => new ConstStub((($mode & \SplDoublyLinkedList::IT_MODE_LIFO) ? 'IT_MODE_LIFO' : 'IT_MODE_FIFO').' | '.(($mode & \SplDoublyLinkedList::IT_MODE_DELETE) ? 'IT_MODE_DELETE' : 'IT_MODE_KEEP'), $mode),
- $prefix.'dllist' => iterator_to_array($c),
- ];
- $c->setIteratorMode($mode);
-
- return $a;
- }
-
- public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, $isNested)
- {
- static $map = [
- 'path' => 'getPath',
- 'filename' => 'getFilename',
- 'basename' => 'getBasename',
- 'pathname' => 'getPathname',
- 'extension' => 'getExtension',
- 'realPath' => 'getRealPath',
- 'aTime' => 'getATime',
- 'mTime' => 'getMTime',
- 'cTime' => 'getCTime',
- 'inode' => 'getInode',
- 'size' => 'getSize',
- 'perms' => 'getPerms',
- 'owner' => 'getOwner',
- 'group' => 'getGroup',
- 'type' => 'getType',
- 'writable' => 'isWritable',
- 'readable' => 'isReadable',
- 'executable' => 'isExecutable',
- 'file' => 'isFile',
- 'dir' => 'isDir',
- 'link' => 'isLink',
- 'linkTarget' => 'getLinkTarget',
- ];
-
- $prefix = Caster::PREFIX_VIRTUAL;
- unset($a["\0SplFileInfo\0fileName"]);
- unset($a["\0SplFileInfo\0pathName"]);
-
- if (\PHP_VERSION_ID < 80000) {
- if (false === $c->getPathname()) {
- $a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state';
-
- return $a;
- }
- } else {
- try {
- $c->isReadable();
- } catch (\RuntimeException $e) {
- if ('Object not initialized' !== $e->getMessage()) {
- throw $e;
- }
-
- $a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state';
-
- return $a;
- } catch (\Error $e) {
- if ('Object not initialized' !== $e->getMessage()) {
- throw $e;
- }
-
- $a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state';
-
- return $a;
- }
- }
-
- foreach ($map as $key => $accessor) {
- try {
- $a[$prefix.$key] = $c->$accessor();
- } catch (\Exception $e) {
- }
- }
-
- if ($a[$prefix.'realPath'] ?? false) {
- $a[$prefix.'realPath'] = new LinkStub($a[$prefix.'realPath']);
- }
-
- if (isset($a[$prefix.'perms'])) {
- $a[$prefix.'perms'] = new ConstStub(sprintf('0%o', $a[$prefix.'perms']), $a[$prefix.'perms']);
- }
-
- static $mapDate = ['aTime', 'mTime', 'cTime'];
- foreach ($mapDate as $key) {
- if (isset($a[$prefix.$key])) {
- $a[$prefix.$key] = new ConstStub(date('Y-m-d H:i:s', $a[$prefix.$key]), $a[$prefix.$key]);
- }
- }
-
- return $a;
- }
-
- public static function castFileObject(\SplFileObject $c, array $a, Stub $stub, $isNested)
- {
- static $map = [
- 'csvControl' => 'getCsvControl',
- 'flags' => 'getFlags',
- 'maxLineLen' => 'getMaxLineLen',
- 'fstat' => 'fstat',
- 'eof' => 'eof',
- 'key' => 'key',
- ];
-
- $prefix = Caster::PREFIX_VIRTUAL;
-
- foreach ($map as $key => $accessor) {
- try {
- $a[$prefix.$key] = $c->$accessor();
- } catch (\Exception $e) {
- }
- }
-
- if (isset($a[$prefix.'flags'])) {
- $flagsArray = [];
- foreach (self::SPL_FILE_OBJECT_FLAGS as $value => $name) {
- if ($a[$prefix.'flags'] & $value) {
- $flagsArray[] = $name;
- }
- }
- $a[$prefix.'flags'] = new ConstStub(implode('|', $flagsArray), $a[$prefix.'flags']);
- }
-
- if (isset($a[$prefix.'fstat'])) {
- $a[$prefix.'fstat'] = new CutArrayStub($a[$prefix.'fstat'], ['dev', 'ino', 'nlink', 'rdev', 'blksize', 'blocks']);
- }
-
- return $a;
- }
-
- public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $stub, $isNested)
- {
- $storage = [];
- unset($a[Caster::PREFIX_DYNAMIC."\0gcdata"]); // Don't hit https://bugs.php.net/65967
- unset($a["\0SplObjectStorage\0storage"]);
-
- $clone = clone $c;
- foreach ($clone as $obj) {
- $storage[] = [
- 'object' => $obj,
- 'info' => $clone->getInfo(),
- ];
- }
-
- $a += [
- Caster::PREFIX_VIRTUAL.'storage' => $storage,
- ];
-
- return $a;
- }
-
- public static function castOuterIterator(\OuterIterator $c, array $a, Stub $stub, $isNested)
- {
- $a[Caster::PREFIX_VIRTUAL.'innerIterator'] = $c->getInnerIterator();
-
- return $a;
- }
-
- public static function castWeakReference(\WeakReference $c, array $a, Stub $stub, $isNested)
- {
- $a[Caster::PREFIX_VIRTUAL.'object'] = $c->get();
-
- return $a;
- }
-
- private static function castSplArray($c, array $a, Stub $stub, bool $isNested): array
- {
- $prefix = Caster::PREFIX_VIRTUAL;
- $flags = $c->getFlags();
-
- if (!($flags & \ArrayObject::STD_PROP_LIST)) {
- $c->setFlags(\ArrayObject::STD_PROP_LIST);
- $a = Caster::castObject($c, \get_class($c), method_exists($c, '__debugInfo'), $stub->class);
- $c->setFlags($flags);
- }
- if (\PHP_VERSION_ID < 70400) {
- $a[$prefix.'storage'] = $c->getArrayCopy();
- }
- $a += [
- $prefix.'flag::STD_PROP_LIST' => (bool) ($flags & \ArrayObject::STD_PROP_LIST),
- $prefix.'flag::ARRAY_AS_PROPS' => (bool) ($flags & \ArrayObject::ARRAY_AS_PROPS),
- ];
- if ($c instanceof \ArrayObject) {
- $a[$prefix.'iteratorClass'] = new ClassStub($c->getIteratorClass());
- }
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/StubCaster.php b/vendor/symfony/var-dumper/Caster/StubCaster.php
deleted file mode 100644
index b6332fb..0000000
--- a/vendor/symfony/var-dumper/Caster/StubCaster.php
+++ /dev/null
@@ -1,84 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts a caster's Stub.
- *
- * @author Nicolas Grekas
- *
- * @final since Symfony 4.4
- */
-class StubCaster
-{
- public static function castStub(Stub $c, array $a, Stub $stub, $isNested)
- {
- if ($isNested) {
- $stub->type = $c->type;
- $stub->class = $c->class;
- $stub->value = $c->value;
- $stub->handle = $c->handle;
- $stub->cut = $c->cut;
- $stub->attr = $c->attr;
-
- if (Stub::TYPE_REF === $c->type && !$c->class && \is_string($c->value) && !preg_match('//u', $c->value)) {
- $stub->type = Stub::TYPE_STRING;
- $stub->class = Stub::STRING_BINARY;
- }
-
- $a = [];
- }
-
- return $a;
- }
-
- public static function castCutArray(CutArrayStub $c, array $a, Stub $stub, $isNested)
- {
- return $isNested ? $c->preservedSubset : $a;
- }
-
- public static function cutInternals($obj, array $a, Stub $stub, $isNested)
- {
- if ($isNested) {
- $stub->cut += \count($a);
-
- return [];
- }
-
- return $a;
- }
-
- public static function castEnum(EnumStub $c, array $a, Stub $stub, $isNested)
- {
- if ($isNested) {
- $stub->class = $c->dumpKeys ? '' : null;
- $stub->handle = 0;
- $stub->value = null;
- $stub->cut = $c->cut;
- $stub->attr = $c->attr;
-
- $a = [];
-
- if ($c->value) {
- foreach (array_keys($c->value) as $k) {
- $keys[] = !isset($k[0]) || "\0" !== $k[0] ? Caster::PREFIX_VIRTUAL.$k : $k;
- }
- // Preserve references with array_combine()
- $a = array_combine($keys, $c->value);
- }
- }
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/SymfonyCaster.php b/vendor/symfony/var-dumper/Caster/SymfonyCaster.php
deleted file mode 100644
index 06f213e..0000000
--- a/vendor/symfony/var-dumper/Caster/SymfonyCaster.php
+++ /dev/null
@@ -1,69 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * @final since Symfony 4.4
- */
-class SymfonyCaster
-{
- private const REQUEST_GETTERS = [
- 'pathInfo' => 'getPathInfo',
- 'requestUri' => 'getRequestUri',
- 'baseUrl' => 'getBaseUrl',
- 'basePath' => 'getBasePath',
- 'method' => 'getMethod',
- 'format' => 'getRequestFormat',
- ];
-
- public static function castRequest(Request $request, array $a, Stub $stub, $isNested)
- {
- $clone = null;
-
- foreach (self::REQUEST_GETTERS as $prop => $getter) {
- $key = Caster::PREFIX_PROTECTED.$prop;
- if (\array_key_exists($key, $a) && null === $a[$key]) {
- if (null === $clone) {
- $clone = clone $request;
- }
- $a[Caster::PREFIX_VIRTUAL.$prop] = $clone->{$getter}();
- }
- }
-
- return $a;
- }
-
- public static function castHttpClient($client, array $a, Stub $stub, $isNested)
- {
- $multiKey = sprintf("\0%s\0multi", \get_class($client));
- if (isset($a[$multiKey])) {
- $a[$multiKey] = new CutStub($a[$multiKey]);
- }
-
- return $a;
- }
-
- public static function castHttpClientResponse($response, array $a, Stub $stub, $isNested)
- {
- $stub->cut += \count($a);
- $a = [];
-
- foreach ($response->getInfo() as $k => $v) {
- $a[Caster::PREFIX_VIRTUAL.$k] = $v;
- }
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/TraceStub.php b/vendor/symfony/var-dumper/Caster/TraceStub.php
deleted file mode 100644
index 5eea1c8..0000000
--- a/vendor/symfony/var-dumper/Caster/TraceStub.php
+++ /dev/null
@@ -1,36 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Represents a backtrace as returned by debug_backtrace() or Exception->getTrace().
- *
- * @author Nicolas Grekas
- */
-class TraceStub extends Stub
-{
- public $keepArgs;
- public $sliceOffset;
- public $sliceLength;
- public $numberingOffset;
-
- public function __construct(array $trace, bool $keepArgs = true, int $sliceOffset = 0, int $sliceLength = null, int $numberingOffset = 0)
- {
- $this->value = $trace;
- $this->keepArgs = $keepArgs;
- $this->sliceOffset = $sliceOffset;
- $this->sliceLength = $sliceLength;
- $this->numberingOffset = $numberingOffset;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/UuidCaster.php b/vendor/symfony/var-dumper/Caster/UuidCaster.php
deleted file mode 100644
index b102774..0000000
--- a/vendor/symfony/var-dumper/Caster/UuidCaster.php
+++ /dev/null
@@ -1,30 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Ramsey\Uuid\UuidInterface;
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * @author Grégoire Pineau
- */
-final class UuidCaster
-{
- public static function castRamseyUuid(UuidInterface $c, array $a, Stub $stub, bool $isNested): array
- {
- $a += [
- Caster::PREFIX_VIRTUAL.'uuid' => (string) $c,
- ];
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php b/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php
deleted file mode 100644
index 9f5a375..0000000
--- a/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php
+++ /dev/null
@@ -1,91 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts XmlReader class to array representation.
- *
- * @author Baptiste Clavié
- *
- * @final since Symfony 4.4
- */
-class XmlReaderCaster
-{
- private const NODE_TYPES = [
- \XMLReader::NONE => 'NONE',
- \XMLReader::ELEMENT => 'ELEMENT',
- \XMLReader::ATTRIBUTE => 'ATTRIBUTE',
- \XMLReader::TEXT => 'TEXT',
- \XMLReader::CDATA => 'CDATA',
- \XMLReader::ENTITY_REF => 'ENTITY_REF',
- \XMLReader::ENTITY => 'ENTITY',
- \XMLReader::PI => 'PI (Processing Instruction)',
- \XMLReader::COMMENT => 'COMMENT',
- \XMLReader::DOC => 'DOC',
- \XMLReader::DOC_TYPE => 'DOC_TYPE',
- \XMLReader::DOC_FRAGMENT => 'DOC_FRAGMENT',
- \XMLReader::NOTATION => 'NOTATION',
- \XMLReader::WHITESPACE => 'WHITESPACE',
- \XMLReader::SIGNIFICANT_WHITESPACE => 'SIGNIFICANT_WHITESPACE',
- \XMLReader::END_ELEMENT => 'END_ELEMENT',
- \XMLReader::END_ENTITY => 'END_ENTITY',
- \XMLReader::XML_DECLARATION => 'XML_DECLARATION',
- ];
-
- public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, $isNested)
- {
- try {
- $properties = [
- 'LOADDTD' => @$reader->getParserProperty(\XMLReader::LOADDTD),
- 'DEFAULTATTRS' => @$reader->getParserProperty(\XMLReader::DEFAULTATTRS),
- 'VALIDATE' => @$reader->getParserProperty(\XMLReader::VALIDATE),
- 'SUBST_ENTITIES' => @$reader->getParserProperty(\XMLReader::SUBST_ENTITIES),
- ];
- } catch (\Error $e) {
- $properties = [
- 'LOADDTD' => false,
- 'DEFAULTATTRS' => false,
- 'VALIDATE' => false,
- 'SUBST_ENTITIES' => false,
- ];
- }
-
- $props = Caster::PREFIX_VIRTUAL.'parserProperties';
- $info = [
- 'localName' => $reader->localName,
- 'prefix' => $reader->prefix,
- 'nodeType' => new ConstStub(self::NODE_TYPES[$reader->nodeType], $reader->nodeType),
- 'depth' => $reader->depth,
- 'isDefault' => $reader->isDefault,
- 'isEmptyElement' => \XMLReader::NONE === $reader->nodeType ? null : $reader->isEmptyElement,
- 'xmlLang' => $reader->xmlLang,
- 'attributeCount' => $reader->attributeCount,
- 'value' => $reader->value,
- 'namespaceURI' => $reader->namespaceURI,
- 'baseURI' => $reader->baseURI ? new LinkStub($reader->baseURI) : $reader->baseURI,
- $props => $properties,
- ];
-
- if ($info[$props] = Caster::filter($info[$props], Caster::EXCLUDE_EMPTY, [], $count)) {
- $info[$props] = new EnumStub($info[$props]);
- $info[$props]->cut = $count;
- }
-
- $info = Caster::filter($info, Caster::EXCLUDE_EMPTY, [], $count);
- // +2 because hasValue and hasAttributes are always filtered
- $stub->cut += $count + 2;
-
- return $a + $info;
- }
-}
diff --git a/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php b/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php
deleted file mode 100644
index 455fc06..0000000
--- a/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php
+++ /dev/null
@@ -1,63 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Caster;
-
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * Casts XML resources to array representation.
- *
- * @author Nicolas Grekas
- *
- * @final since Symfony 4.4
- */
-class XmlResourceCaster
-{
- private const XML_ERRORS = [
- \XML_ERROR_NONE => 'XML_ERROR_NONE',
- \XML_ERROR_NO_MEMORY => 'XML_ERROR_NO_MEMORY',
- \XML_ERROR_SYNTAX => 'XML_ERROR_SYNTAX',
- \XML_ERROR_NO_ELEMENTS => 'XML_ERROR_NO_ELEMENTS',
- \XML_ERROR_INVALID_TOKEN => 'XML_ERROR_INVALID_TOKEN',
- \XML_ERROR_UNCLOSED_TOKEN => 'XML_ERROR_UNCLOSED_TOKEN',
- \XML_ERROR_PARTIAL_CHAR => 'XML_ERROR_PARTIAL_CHAR',
- \XML_ERROR_TAG_MISMATCH => 'XML_ERROR_TAG_MISMATCH',
- \XML_ERROR_DUPLICATE_ATTRIBUTE => 'XML_ERROR_DUPLICATE_ATTRIBUTE',
- \XML_ERROR_JUNK_AFTER_DOC_ELEMENT => 'XML_ERROR_JUNK_AFTER_DOC_ELEMENT',
- \XML_ERROR_PARAM_ENTITY_REF => 'XML_ERROR_PARAM_ENTITY_REF',
- \XML_ERROR_UNDEFINED_ENTITY => 'XML_ERROR_UNDEFINED_ENTITY',
- \XML_ERROR_RECURSIVE_ENTITY_REF => 'XML_ERROR_RECURSIVE_ENTITY_REF',
- \XML_ERROR_ASYNC_ENTITY => 'XML_ERROR_ASYNC_ENTITY',
- \XML_ERROR_BAD_CHAR_REF => 'XML_ERROR_BAD_CHAR_REF',
- \XML_ERROR_BINARY_ENTITY_REF => 'XML_ERROR_BINARY_ENTITY_REF',
- \XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF => 'XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF',
- \XML_ERROR_MISPLACED_XML_PI => 'XML_ERROR_MISPLACED_XML_PI',
- \XML_ERROR_UNKNOWN_ENCODING => 'XML_ERROR_UNKNOWN_ENCODING',
- \XML_ERROR_INCORRECT_ENCODING => 'XML_ERROR_INCORRECT_ENCODING',
- \XML_ERROR_UNCLOSED_CDATA_SECTION => 'XML_ERROR_UNCLOSED_CDATA_SECTION',
- \XML_ERROR_EXTERNAL_ENTITY_HANDLING => 'XML_ERROR_EXTERNAL_ENTITY_HANDLING',
- ];
-
- public static function castXml($h, array $a, Stub $stub, $isNested)
- {
- $a['current_byte_index'] = xml_get_current_byte_index($h);
- $a['current_column_number'] = xml_get_current_column_number($h);
- $a['current_line_number'] = xml_get_current_line_number($h);
- $a['error_code'] = xml_get_error_code($h);
-
- if (isset(self::XML_ERRORS[$a['error_code']])) {
- $a['error_code'] = new ConstStub(self::XML_ERRORS[$a['error_code']], $a['error_code']);
- }
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Cloner/AbstractCloner.php b/vendor/symfony/var-dumper/Cloner/AbstractCloner.php
deleted file mode 100644
index d2e5039..0000000
--- a/vendor/symfony/var-dumper/Cloner/AbstractCloner.php
+++ /dev/null
@@ -1,377 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Cloner;
-
-use Symfony\Component\VarDumper\Caster\Caster;
-use Symfony\Component\VarDumper\Exception\ThrowingCasterException;
-
-/**
- * AbstractCloner implements a generic caster mechanism for objects and resources.
- *
- * @author Nicolas Grekas
- */
-abstract class AbstractCloner implements ClonerInterface
-{
- public static $defaultCasters = [
- '__PHP_Incomplete_Class' => ['Symfony\Component\VarDumper\Caster\Caster', 'castPhpIncompleteClass'],
-
- 'Symfony\Component\VarDumper\Caster\CutStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castStub'],
- 'Symfony\Component\VarDumper\Caster\CutArrayStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castCutArray'],
- 'Symfony\Component\VarDumper\Caster\ConstStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castStub'],
- 'Symfony\Component\VarDumper\Caster\EnumStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castEnum'],
-
- 'Closure' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castClosure'],
- 'Generator' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castGenerator'],
- 'ReflectionType' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castType'],
- 'ReflectionGenerator' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castReflectionGenerator'],
- 'ReflectionClass' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castClass'],
- 'ReflectionFunctionAbstract' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castFunctionAbstract'],
- 'ReflectionMethod' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castMethod'],
- 'ReflectionParameter' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castParameter'],
- 'ReflectionProperty' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castProperty'],
- 'ReflectionReference' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castReference'],
- 'ReflectionExtension' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castExtension'],
- 'ReflectionZendExtension' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castZendExtension'],
-
- 'Doctrine\Common\Persistence\ObjectManager' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
- 'Doctrine\Common\Proxy\Proxy' => ['Symfony\Component\VarDumper\Caster\DoctrineCaster', 'castCommonProxy'],
- 'Doctrine\ORM\Proxy\Proxy' => ['Symfony\Component\VarDumper\Caster\DoctrineCaster', 'castOrmProxy'],
- 'Doctrine\ORM\PersistentCollection' => ['Symfony\Component\VarDumper\Caster\DoctrineCaster', 'castPersistentCollection'],
- 'Doctrine\Persistence\ObjectManager' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
-
- 'DOMException' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castException'],
- 'DOMStringList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
- 'DOMNameList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
- 'DOMImplementation' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castImplementation'],
- 'DOMImplementationList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
- 'DOMNode' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNode'],
- 'DOMNameSpaceNode' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNameSpaceNode'],
- 'DOMDocument' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDocument'],
- 'DOMNodeList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
- 'DOMNamedNodeMap' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
- 'DOMCharacterData' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castCharacterData'],
- 'DOMAttr' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castAttr'],
- 'DOMElement' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castElement'],
- 'DOMText' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castText'],
- 'DOMTypeinfo' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castTypeinfo'],
- 'DOMDomError' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDomError'],
- 'DOMLocator' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLocator'],
- 'DOMDocumentType' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDocumentType'],
- 'DOMNotation' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNotation'],
- 'DOMEntity' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castEntity'],
- 'DOMProcessingInstruction' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castProcessingInstruction'],
- 'DOMXPath' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castXPath'],
-
- 'XMLReader' => ['Symfony\Component\VarDumper\Caster\XmlReaderCaster', 'castXmlReader'],
-
- 'ErrorException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castErrorException'],
- 'Exception' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castException'],
- 'Error' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castError'],
- 'Symfony\Component\DependencyInjection\ContainerInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
- 'Symfony\Component\EventDispatcher\EventDispatcherInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
- 'Symfony\Component\HttpClient\CurlHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'],
- 'Symfony\Component\HttpClient\NativeHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'],
- 'Symfony\Component\HttpClient\Response\CurlResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'],
- 'Symfony\Component\HttpClient\Response\NativeResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'],
- 'Symfony\Component\HttpFoundation\Request' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castRequest'],
- 'Symfony\Component\VarDumper\Exception\ThrowingCasterException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castThrowingCasterException'],
- 'Symfony\Component\VarDumper\Caster\TraceStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castTraceStub'],
- 'Symfony\Component\VarDumper\Caster\FrameStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castFrameStub'],
- 'Symfony\Component\VarDumper\Cloner\AbstractCloner' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
- 'Symfony\Component\ErrorHandler\Exception\SilencedErrorContext' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castSilencedErrorContext'],
-
- 'Imagine\Image\ImageInterface' => ['Symfony\Component\VarDumper\Caster\ImagineCaster', 'castImage'],
-
- 'Ramsey\Uuid\UuidInterface' => ['Symfony\Component\VarDumper\Caster\UuidCaster', 'castRamseyUuid'],
-
- 'ProxyManager\Proxy\ProxyInterface' => ['Symfony\Component\VarDumper\Caster\ProxyManagerCaster', 'castProxy'],
- 'PHPUnit_Framework_MockObject_MockObject' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
- 'PHPUnit\Framework\MockObject\MockObject' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
- 'PHPUnit\Framework\MockObject\Stub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
- 'Prophecy\Prophecy\ProphecySubjectInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
- 'Mockery\MockInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
-
- 'PDO' => ['Symfony\Component\VarDumper\Caster\PdoCaster', 'castPdo'],
- 'PDOStatement' => ['Symfony\Component\VarDumper\Caster\PdoCaster', 'castPdoStatement'],
-
- 'AMQPConnection' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castConnection'],
- 'AMQPChannel' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castChannel'],
- 'AMQPQueue' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castQueue'],
- 'AMQPExchange' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castExchange'],
- 'AMQPEnvelope' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castEnvelope'],
-
- 'ArrayObject' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castArrayObject'],
- 'ArrayIterator' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castArrayIterator'],
- 'SplDoublyLinkedList' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castDoublyLinkedList'],
- 'SplFileInfo' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castFileInfo'],
- 'SplFileObject' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castFileObject'],
- 'SplHeap' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castHeap'],
- 'SplObjectStorage' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castObjectStorage'],
- 'SplPriorityQueue' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castHeap'],
- 'OuterIterator' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castOuterIterator'],
- 'WeakReference' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castWeakReference'],
-
- 'Redis' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedis'],
- 'RedisArray' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisArray'],
- 'RedisCluster' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisCluster'],
-
- 'DateTimeInterface' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castDateTime'],
- 'DateInterval' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castInterval'],
- 'DateTimeZone' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castTimeZone'],
- 'DatePeriod' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castPeriod'],
-
- 'GMP' => ['Symfony\Component\VarDumper\Caster\GmpCaster', 'castGmp'],
-
- 'MessageFormatter' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castMessageFormatter'],
- 'NumberFormatter' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castNumberFormatter'],
- 'IntlTimeZone' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castIntlTimeZone'],
- 'IntlCalendar' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castIntlCalendar'],
- 'IntlDateFormatter' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castIntlDateFormatter'],
-
- 'Memcached' => ['Symfony\Component\VarDumper\Caster\MemcachedCaster', 'castMemcached'],
-
- 'Ds\Collection' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castCollection'],
- 'Ds\Map' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castMap'],
- 'Ds\Pair' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPair'],
- 'Symfony\Component\VarDumper\Caster\DsPairStub' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPairStub'],
-
- 'mysqli_driver' => ['Symfony\Component\VarDumper\Caster\MysqliCaster', 'castMysqliDriver'],
-
- 'CurlHandle' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'],
- ':curl' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'],
-
- ':dba' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'],
- ':dba persistent' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'],
-
- 'GdImage' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castGd'],
- ':gd' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castGd'],
-
- ':mysql link' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castMysqlLink'],
- ':pgsql large object' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLargeObject'],
- ':pgsql link' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLink'],
- ':pgsql link persistent' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLink'],
- ':pgsql result' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castResult'],
- ':process' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castProcess'],
- ':stream' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castStream'],
-
- 'OpenSSLCertificate' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castOpensslX509'],
- ':OpenSSL X.509' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castOpensslX509'],
-
- ':persistent stream' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castStream'],
- ':stream-context' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castStreamContext'],
-
- 'XmlParser' => ['Symfony\Component\VarDumper\Caster\XmlResourceCaster', 'castXml'],
- ':xml' => ['Symfony\Component\VarDumper\Caster\XmlResourceCaster', 'castXml'],
- ];
-
- protected $maxItems = 2500;
- protected $maxString = -1;
- protected $minDepth = 1;
-
- private $casters = [];
- private $prevErrorHandler;
- private $classInfo = [];
- private $filter = 0;
-
- /**
- * @param callable[]|null $casters A map of casters
- *
- * @see addCasters
- */
- public function __construct(array $casters = null)
- {
- if (null === $casters) {
- $casters = static::$defaultCasters;
- }
- $this->addCasters($casters);
- }
-
- /**
- * Adds casters for resources and objects.
- *
- * Maps resources or objects types to a callback.
- * Types are in the key, with a callable caster for value.
- * Resource types are to be prefixed with a `:`,
- * see e.g. static::$defaultCasters.
- *
- * @param callable[] $casters A map of casters
- */
- public function addCasters(array $casters)
- {
- foreach ($casters as $type => $callback) {
- $this->casters[$type][] = $callback;
- }
- }
-
- /**
- * Sets the maximum number of items to clone past the minimum depth in nested structures.
- *
- * @param int $maxItems
- */
- public function setMaxItems($maxItems)
- {
- $this->maxItems = (int) $maxItems;
- }
-
- /**
- * Sets the maximum cloned length for strings.
- *
- * @param int $maxString
- */
- public function setMaxString($maxString)
- {
- $this->maxString = (int) $maxString;
- }
-
- /**
- * Sets the minimum tree depth where we are guaranteed to clone all the items. After this
- * depth is reached, only setMaxItems items will be cloned.
- *
- * @param int $minDepth
- */
- public function setMinDepth($minDepth)
- {
- $this->minDepth = (int) $minDepth;
- }
-
- /**
- * Clones a PHP variable.
- *
- * @param mixed $var Any PHP variable
- * @param int $filter A bit field of Caster::EXCLUDE_* constants
- *
- * @return Data The cloned variable represented by a Data object
- */
- public function cloneVar($var, $filter = 0)
- {
- $this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) {
- if (\E_RECOVERABLE_ERROR === $type || \E_USER_ERROR === $type) {
- // Cloner never dies
- throw new \ErrorException($msg, 0, $type, $file, $line);
- }
-
- if ($this->prevErrorHandler) {
- return ($this->prevErrorHandler)($type, $msg, $file, $line, $context);
- }
-
- return false;
- });
- $this->filter = $filter;
-
- if ($gc = gc_enabled()) {
- gc_disable();
- }
- try {
- return new Data($this->doClone($var));
- } finally {
- if ($gc) {
- gc_enable();
- }
- restore_error_handler();
- $this->prevErrorHandler = null;
- }
- }
-
- /**
- * Effectively clones the PHP variable.
- *
- * @param mixed $var Any PHP variable
- *
- * @return array The cloned variable represented in an array
- */
- abstract protected function doClone($var);
-
- /**
- * Casts an object to an array representation.
- *
- * @param bool $isNested True if the object is nested in the dumped structure
- *
- * @return array The object casted as array
- */
- protected function castObject(Stub $stub, $isNested)
- {
- $obj = $stub->value;
- $class = $stub->class;
-
- if (\PHP_VERSION_ID < 80000 ? "\0" === ($class[15] ?? null) : str_contains($class, "@anonymous\0")) {
- $stub->class = get_debug_type($obj);
- }
- if (isset($this->classInfo[$class])) {
- [$i, $parents, $hasDebugInfo, $fileInfo] = $this->classInfo[$class];
- } else {
- $i = 2;
- $parents = [$class];
- $hasDebugInfo = method_exists($class, '__debugInfo');
-
- foreach (class_parents($class) as $p) {
- $parents[] = $p;
- ++$i;
- }
- foreach (class_implements($class) as $p) {
- $parents[] = $p;
- ++$i;
- }
- $parents[] = '*';
-
- $r = new \ReflectionClass($class);
- $fileInfo = $r->isInternal() || $r->isSubclassOf(Stub::class) ? [] : [
- 'file' => $r->getFileName(),
- 'line' => $r->getStartLine(),
- ];
-
- $this->classInfo[$class] = [$i, $parents, $hasDebugInfo, $fileInfo];
- }
-
- $stub->attr += $fileInfo;
- $a = Caster::castObject($obj, $class, $hasDebugInfo, $stub->class);
-
- try {
- while ($i--) {
- if (!empty($this->casters[$p = $parents[$i]])) {
- foreach ($this->casters[$p] as $callback) {
- $a = $callback($obj, $a, $stub, $isNested, $this->filter);
- }
- }
- }
- } catch (\Exception $e) {
- $a = [(Stub::TYPE_OBJECT === $stub->type ? Caster::PREFIX_VIRTUAL : '').'⚠' => new ThrowingCasterException($e)] + $a;
- }
-
- return $a;
- }
-
- /**
- * Casts a resource to an array representation.
- *
- * @param bool $isNested True if the object is nested in the dumped structure
- *
- * @return array The resource casted as array
- */
- protected function castResource(Stub $stub, $isNested)
- {
- $a = [];
- $res = $stub->value;
- $type = $stub->class;
-
- try {
- if (!empty($this->casters[':'.$type])) {
- foreach ($this->casters[':'.$type] as $callback) {
- $a = $callback($res, $a, $stub, $isNested, $this->filter);
- }
- }
- } catch (\Exception $e) {
- $a = [(Stub::TYPE_OBJECT === $stub->type ? Caster::PREFIX_VIRTUAL : '').'⚠' => new ThrowingCasterException($e)] + $a;
- }
-
- return $a;
- }
-}
diff --git a/vendor/symfony/var-dumper/Cloner/ClonerInterface.php b/vendor/symfony/var-dumper/Cloner/ClonerInterface.php
deleted file mode 100644
index 7ed287a..0000000
--- a/vendor/symfony/var-dumper/Cloner/ClonerInterface.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Cloner;
-
-/**
- * @author Nicolas Grekas
- */
-interface ClonerInterface
-{
- /**
- * Clones a PHP variable.
- *
- * @param mixed $var Any PHP variable
- *
- * @return Data The cloned variable represented by a Data object
- */
- public function cloneVar($var);
-}
diff --git a/vendor/symfony/var-dumper/Cloner/Cursor.php b/vendor/symfony/var-dumper/Cloner/Cursor.php
deleted file mode 100644
index 1fd796d..0000000
--- a/vendor/symfony/var-dumper/Cloner/Cursor.php
+++ /dev/null
@@ -1,43 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Cloner;
-
-/**
- * Represents the current state of a dumper while dumping.
- *
- * @author Nicolas Grekas
- */
-class Cursor
-{
- public const HASH_INDEXED = Stub::ARRAY_INDEXED;
- public const HASH_ASSOC = Stub::ARRAY_ASSOC;
- public const HASH_OBJECT = Stub::TYPE_OBJECT;
- public const HASH_RESOURCE = Stub::TYPE_RESOURCE;
-
- public $depth = 0;
- public $refIndex = 0;
- public $softRefTo = 0;
- public $softRefCount = 0;
- public $softRefHandle = 0;
- public $hardRefTo = 0;
- public $hardRefCount = 0;
- public $hardRefHandle = 0;
- public $hashType;
- public $hashKey;
- public $hashKeyIsBinary;
- public $hashIndex = 0;
- public $hashLength = 0;
- public $hashCut = 0;
- public $stop = false;
- public $attr = [];
- public $skipChildren = false;
-}
diff --git a/vendor/symfony/var-dumper/Cloner/Data.php b/vendor/symfony/var-dumper/Cloner/Data.php
deleted file mode 100644
index 8f621b1..0000000
--- a/vendor/symfony/var-dumper/Cloner/Data.php
+++ /dev/null
@@ -1,470 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Cloner;
-
-use Symfony\Component\VarDumper\Caster\Caster;
-use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider;
-
-/**
- * @author Nicolas Grekas
- */
-class Data implements \ArrayAccess, \Countable, \IteratorAggregate
-{
- private $data;
- private $position = 0;
- private $key = 0;
- private $maxDepth = 20;
- private $maxItemsPerDepth = -1;
- private $useRefHandles = -1;
- private $context = [];
-
- /**
- * @param array $data An array as returned by ClonerInterface::cloneVar()
- */
- public function __construct(array $data)
- {
- $this->data = $data;
- }
-
- /**
- * @return string|null The type of the value
- */
- public function getType()
- {
- $item = $this->data[$this->position][$this->key];
-
- if ($item instanceof Stub && Stub::TYPE_REF === $item->type && !$item->position) {
- $item = $item->value;
- }
- if (!$item instanceof Stub) {
- return \gettype($item);
- }
- if (Stub::TYPE_STRING === $item->type) {
- return 'string';
- }
- if (Stub::TYPE_ARRAY === $item->type) {
- return 'array';
- }
- if (Stub::TYPE_OBJECT === $item->type) {
- return $item->class;
- }
- if (Stub::TYPE_RESOURCE === $item->type) {
- return $item->class.' resource';
- }
-
- return null;
- }
-
- /**
- * @param array|bool $recursive Whether values should be resolved recursively or not
- *
- * @return string|int|float|bool|array|Data[]|null A native representation of the original value
- */
- public function getValue($recursive = false)
- {
- $item = $this->data[$this->position][$this->key];
-
- if ($item instanceof Stub && Stub::TYPE_REF === $item->type && !$item->position) {
- $item = $item->value;
- }
- if (!($item = $this->getStub($item)) instanceof Stub) {
- return $item;
- }
- if (Stub::TYPE_STRING === $item->type) {
- return $item->value;
- }
-
- $children = $item->position ? $this->data[$item->position] : [];
-
- foreach ($children as $k => $v) {
- if ($recursive && !($v = $this->getStub($v)) instanceof Stub) {
- continue;
- }
- $children[$k] = clone $this;
- $children[$k]->key = $k;
- $children[$k]->position = $item->position;
-
- if ($recursive) {
- if (Stub::TYPE_REF === $v->type && ($v = $this->getStub($v->value)) instanceof Stub) {
- $recursive = (array) $recursive;
- if (isset($recursive[$v->position])) {
- continue;
- }
- $recursive[$v->position] = true;
- }
- $children[$k] = $children[$k]->getValue($recursive);
- }
- }
-
- return $children;
- }
-
- /**
- * @return int
- */
- #[\ReturnTypeWillChange]
- public function count()
- {
- return \count($this->getValue());
- }
-
- /**
- * @return \Traversable
- */
- #[\ReturnTypeWillChange]
- public function getIterator()
- {
- if (!\is_array($value = $this->getValue())) {
- throw new \LogicException(sprintf('"%s" object holds non-iterable type "%s".', self::class, \gettype($value)));
- }
-
- yield from $value;
- }
-
- public function __get($key)
- {
- if (null !== $data = $this->seek($key)) {
- $item = $this->getStub($data->data[$data->position][$data->key]);
-
- return $item instanceof Stub || [] === $item ? $data : $item;
- }
-
- return null;
- }
-
- /**
- * @return bool
- */
- public function __isset($key)
- {
- return null !== $this->seek($key);
- }
-
- /**
- * @return bool
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($key)
- {
- return $this->__isset($key);
- }
-
- /**
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($key)
- {
- return $this->__get($key);
- }
-
- /**
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($key, $value)
- {
- throw new \BadMethodCallException(self::class.' objects are immutable.');
- }
-
- /**
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($key)
- {
- throw new \BadMethodCallException(self::class.' objects are immutable.');
- }
-
- /**
- * @return string
- */
- public function __toString()
- {
- $value = $this->getValue();
-
- if (!\is_array($value)) {
- return (string) $value;
- }
-
- return sprintf('%s (count=%d)', $this->getType(), \count($value));
- }
-
- /**
- * Returns a depth limited clone of $this.
- *
- * @param int $maxDepth The max dumped depth level
- *
- * @return static
- */
- public function withMaxDepth($maxDepth)
- {
- $data = clone $this;
- $data->maxDepth = (int) $maxDepth;
-
- return $data;
- }
-
- /**
- * Limits the number of elements per depth level.
- *
- * @param int $maxItemsPerDepth The max number of items dumped per depth level
- *
- * @return static
- */
- public function withMaxItemsPerDepth($maxItemsPerDepth)
- {
- $data = clone $this;
- $data->maxItemsPerDepth = (int) $maxItemsPerDepth;
-
- return $data;
- }
-
- /**
- * Enables/disables objects' identifiers tracking.
- *
- * @param bool $useRefHandles False to hide global ref. handles
- *
- * @return static
- */
- public function withRefHandles($useRefHandles)
- {
- $data = clone $this;
- $data->useRefHandles = $useRefHandles ? -1 : 0;
-
- return $data;
- }
-
- /**
- * @return static
- */
- public function withContext(array $context)
- {
- $data = clone $this;
- $data->context = $context;
-
- return $data;
- }
-
- /**
- * Seeks to a specific key in nested data structures.
- *
- * @param string|int $key The key to seek to
- *
- * @return static|null Null if the key is not set
- */
- public function seek($key)
- {
- $item = $this->data[$this->position][$this->key];
-
- if ($item instanceof Stub && Stub::TYPE_REF === $item->type && !$item->position) {
- $item = $item->value;
- }
- if (!($item = $this->getStub($item)) instanceof Stub || !$item->position) {
- return null;
- }
- $keys = [$key];
-
- switch ($item->type) {
- case Stub::TYPE_OBJECT:
- $keys[] = Caster::PREFIX_DYNAMIC.$key;
- $keys[] = Caster::PREFIX_PROTECTED.$key;
- $keys[] = Caster::PREFIX_VIRTUAL.$key;
- $keys[] = "\0$item->class\0$key";
- // no break
- case Stub::TYPE_ARRAY:
- case Stub::TYPE_RESOURCE:
- break;
- default:
- return null;
- }
-
- $data = null;
- $children = $this->data[$item->position];
-
- foreach ($keys as $key) {
- if (isset($children[$key]) || \array_key_exists($key, $children)) {
- $data = clone $this;
- $data->key = $key;
- $data->position = $item->position;
- break;
- }
- }
-
- return $data;
- }
-
- /**
- * Dumps data with a DumperInterface dumper.
- */
- public function dump(DumperInterface $dumper)
- {
- $refs = [0];
- $cursor = new Cursor();
-
- if ($cursor->attr = $this->context[SourceContextProvider::class] ?? []) {
- $cursor->attr['if_links'] = true;
- $cursor->hashType = -1;
- $dumper->dumpScalar($cursor, 'default', '^');
- $cursor->attr = ['if_links' => true];
- $dumper->dumpScalar($cursor, 'default', ' ');
- $cursor->hashType = 0;
- }
-
- $this->dumpItem($dumper, $cursor, $refs, $this->data[$this->position][$this->key]);
- }
-
- /**
- * Depth-first dumping of items.
- *
- * @param mixed $item A Stub object or the original value being dumped
- */
- private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs, $item)
- {
- $cursor->refIndex = 0;
- $cursor->softRefTo = $cursor->softRefHandle = $cursor->softRefCount = 0;
- $cursor->hardRefTo = $cursor->hardRefHandle = $cursor->hardRefCount = 0;
- $firstSeen = true;
-
- if (!$item instanceof Stub) {
- $cursor->attr = [];
- $type = \gettype($item);
- if ($item && 'array' === $type) {
- $item = $this->getStub($item);
- }
- } elseif (Stub::TYPE_REF === $item->type) {
- if ($item->handle) {
- if (!isset($refs[$r = $item->handle - (\PHP_INT_MAX >> 1)])) {
- $cursor->refIndex = $refs[$r] = $cursor->refIndex ?: ++$refs[0];
- } else {
- $firstSeen = false;
- }
- $cursor->hardRefTo = $refs[$r];
- $cursor->hardRefHandle = $this->useRefHandles & $item->handle;
- $cursor->hardRefCount = 0 < $item->handle ? $item->refCount : 0;
- }
- $cursor->attr = $item->attr;
- $type = $item->class ?: \gettype($item->value);
- $item = $this->getStub($item->value);
- }
- if ($item instanceof Stub) {
- if ($item->refCount) {
- if (!isset($refs[$r = $item->handle])) {
- $cursor->refIndex = $refs[$r] = $cursor->refIndex ?: ++$refs[0];
- } else {
- $firstSeen = false;
- }
- $cursor->softRefTo = $refs[$r];
- }
- $cursor->softRefHandle = $this->useRefHandles & $item->handle;
- $cursor->softRefCount = $item->refCount;
- $cursor->attr = $item->attr;
- $cut = $item->cut;
-
- if ($item->position && $firstSeen) {
- $children = $this->data[$item->position];
-
- if ($cursor->stop) {
- if ($cut >= 0) {
- $cut += \count($children);
- }
- $children = [];
- }
- } else {
- $children = [];
- }
- switch ($item->type) {
- case Stub::TYPE_STRING:
- $dumper->dumpString($cursor, $item->value, Stub::STRING_BINARY === $item->class, $cut);
- break;
-
- case Stub::TYPE_ARRAY:
- $item = clone $item;
- $item->type = $item->class;
- $item->class = $item->value;
- // no break
- case Stub::TYPE_OBJECT:
- case Stub::TYPE_RESOURCE:
- $withChildren = $children && $cursor->depth !== $this->maxDepth && $this->maxItemsPerDepth;
- $dumper->enterHash($cursor, $item->type, $item->class, $withChildren);
- if ($withChildren) {
- if ($cursor->skipChildren) {
- $withChildren = false;
- $cut = -1;
- } else {
- $cut = $this->dumpChildren($dumper, $cursor, $refs, $children, $cut, $item->type, null !== $item->class);
- }
- } elseif ($children && 0 <= $cut) {
- $cut += \count($children);
- }
- $cursor->skipChildren = false;
- $dumper->leaveHash($cursor, $item->type, $item->class, $withChildren, $cut);
- break;
-
- default:
- throw new \RuntimeException(sprintf('Unexpected Stub type: "%s".', $item->type));
- }
- } elseif ('array' === $type) {
- $dumper->enterHash($cursor, Cursor::HASH_INDEXED, 0, false);
- $dumper->leaveHash($cursor, Cursor::HASH_INDEXED, 0, false, 0);
- } elseif ('string' === $type) {
- $dumper->dumpString($cursor, $item, false, 0);
- } else {
- $dumper->dumpScalar($cursor, $type, $item);
- }
- }
-
- /**
- * Dumps children of hash structures.
- *
- * @return int The final number of removed items
- */
- private function dumpChildren(DumperInterface $dumper, Cursor $parentCursor, array &$refs, array $children, int $hashCut, int $hashType, bool $dumpKeys): int
- {
- $cursor = clone $parentCursor;
- ++$cursor->depth;
- $cursor->hashType = $hashType;
- $cursor->hashIndex = 0;
- $cursor->hashLength = \count($children);
- $cursor->hashCut = $hashCut;
- foreach ($children as $key => $child) {
- $cursor->hashKeyIsBinary = isset($key[0]) && !preg_match('//u', $key);
- $cursor->hashKey = $dumpKeys ? $key : null;
- $this->dumpItem($dumper, $cursor, $refs, $child);
- if (++$cursor->hashIndex === $this->maxItemsPerDepth || $cursor->stop) {
- $parentCursor->stop = true;
-
- return $hashCut >= 0 ? $hashCut + $cursor->hashLength - $cursor->hashIndex : $hashCut;
- }
- }
-
- return $hashCut;
- }
-
- private function getStub($item)
- {
- if (!$item || !\is_array($item)) {
- return $item;
- }
-
- $stub = new Stub();
- $stub->type = Stub::TYPE_ARRAY;
- foreach ($item as $stub->class => $stub->position) {
- }
- if (isset($item[0])) {
- $stub->cut = $item[0];
- }
- $stub->value = $stub->cut + ($stub->position ? \count($this->data[$stub->position]) : 0);
-
- return $stub;
- }
-}
diff --git a/vendor/symfony/var-dumper/Cloner/DumperInterface.php b/vendor/symfony/var-dumper/Cloner/DumperInterface.php
deleted file mode 100644
index ec8ef27..0000000
--- a/vendor/symfony/var-dumper/Cloner/DumperInterface.php
+++ /dev/null
@@ -1,56 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Cloner;
-
-/**
- * DumperInterface used by Data objects.
- *
- * @author Nicolas Grekas
- */
-interface DumperInterface
-{
- /**
- * Dumps a scalar value.
- *
- * @param string $type The PHP type of the value being dumped
- * @param string|int|float|bool $value The scalar value being dumped
- */
- public function dumpScalar(Cursor $cursor, $type, $value);
-
- /**
- * Dumps a string.
- *
- * @param string $str The string being dumped
- * @param bool $bin Whether $str is UTF-8 or binary encoded
- * @param int $cut The number of characters $str has been cut by
- */
- public function dumpString(Cursor $cursor, $str, $bin, $cut);
-
- /**
- * Dumps while entering an hash.
- *
- * @param int $type A Cursor::HASH_* const for the type of hash
- * @param string|int $class The object class, resource type or array count
- * @param bool $hasChild When the dump of the hash has child item
- */
- public function enterHash(Cursor $cursor, $type, $class, $hasChild);
-
- /**
- * Dumps while leaving an hash.
- *
- * @param int $type A Cursor::HASH_* const for the type of hash
- * @param string|int $class The object class, resource type or array count
- * @param bool $hasChild When the dump of the hash has child item
- * @param int $cut The number of items the hash has been cut by
- */
- public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut);
-}
diff --git a/vendor/symfony/var-dumper/Cloner/Stub.php b/vendor/symfony/var-dumper/Cloner/Stub.php
deleted file mode 100644
index 073c56e..0000000
--- a/vendor/symfony/var-dumper/Cloner/Stub.php
+++ /dev/null
@@ -1,67 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Cloner;
-
-/**
- * Represents the main properties of a PHP variable.
- *
- * @author Nicolas Grekas
- */
-class Stub
-{
- public const TYPE_REF = 1;
- public const TYPE_STRING = 2;
- public const TYPE_ARRAY = 3;
- public const TYPE_OBJECT = 4;
- public const TYPE_RESOURCE = 5;
-
- public const STRING_BINARY = 1;
- public const STRING_UTF8 = 2;
-
- public const ARRAY_ASSOC = 1;
- public const ARRAY_INDEXED = 2;
-
- public $type = self::TYPE_REF;
- public $class = '';
- public $value;
- public $cut = 0;
- public $handle = 0;
- public $refCount = 0;
- public $position = 0;
- public $attr = [];
-
- private static $defaultProperties = [];
-
- /**
- * @internal
- */
- public function __sleep(): array
- {
- $properties = [];
-
- if (!isset(self::$defaultProperties[$c = static::class])) {
- self::$defaultProperties[$c] = get_class_vars($c);
-
- foreach ((new \ReflectionClass($c))->getStaticProperties() as $k => $v) {
- unset(self::$defaultProperties[$c][$k]);
- }
- }
-
- foreach (self::$defaultProperties[$c] as $k => $v) {
- if ($this->$k !== $v) {
- $properties[] = $k;
- }
- }
-
- return $properties;
- }
-}
diff --git a/vendor/symfony/var-dumper/Cloner/VarCloner.php b/vendor/symfony/var-dumper/Cloner/VarCloner.php
deleted file mode 100644
index cd6e7dc..0000000
--- a/vendor/symfony/var-dumper/Cloner/VarCloner.php
+++ /dev/null
@@ -1,324 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Cloner;
-
-/**
- * @author Nicolas Grekas
- */
-class VarCloner extends AbstractCloner
-{
- private static $gid;
- private static $arrayCache = [];
-
- /**
- * {@inheritdoc}
- */
- protected function doClone($var)
- {
- $len = 1; // Length of $queue
- $pos = 0; // Number of cloned items past the minimum depth
- $refsCounter = 0; // Hard references counter
- $queue = [[$var]]; // This breadth-first queue is the return value
- $indexedArrays = []; // Map of queue indexes that hold numerically indexed arrays
- $hardRefs = []; // Map of original zval ids to stub objects
- $objRefs = []; // Map of original object handles to their stub object counterpart
- $objects = []; // Keep a ref to objects to ensure their handle cannot be reused while cloning
- $resRefs = []; // Map of original resource handles to their stub object counterpart
- $values = []; // Map of stub objects' ids to original values
- $maxItems = $this->maxItems;
- $maxString = $this->maxString;
- $minDepth = $this->minDepth;
- $currentDepth = 0; // Current tree depth
- $currentDepthFinalIndex = 0; // Final $queue index for current tree depth
- $minimumDepthReached = 0 === $minDepth; // Becomes true when minimum tree depth has been reached
- $cookie = (object) []; // Unique object used to detect hard references
- $a = null; // Array cast for nested structures
- $stub = null; // Stub capturing the main properties of an original item value
- // or null if the original value is used directly
-
- if (!$gid = self::$gid) {
- $gid = self::$gid = md5(random_bytes(6)); // Unique string used to detect the special $GLOBALS variable
- }
- $arrayStub = new Stub();
- $arrayStub->type = Stub::TYPE_ARRAY;
- $fromObjCast = false;
-
- for ($i = 0; $i < $len; ++$i) {
- // Detect when we move on to the next tree depth
- if ($i > $currentDepthFinalIndex) {
- ++$currentDepth;
- $currentDepthFinalIndex = $len - 1;
- if ($currentDepth >= $minDepth) {
- $minimumDepthReached = true;
- }
- }
-
- $refs = $vals = $queue[$i];
- if (\PHP_VERSION_ID < 70200 && empty($indexedArrays[$i])) {
- // see https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts
- foreach ($vals as $k => $v) {
- if (\is_int($k)) {
- continue;
- }
- foreach ([$k => true] as $gk => $gv) {
- }
- if ($gk !== $k) {
- $fromObjCast = true;
- $refs = $vals = array_values($queue[$i]);
- break;
- }
- }
- }
- foreach ($vals as $k => $v) {
- // $v is the original value or a stub object in case of hard references
-
- if (\PHP_VERSION_ID >= 70400) {
- $zvalRef = ($r = \ReflectionReference::fromArrayElement($vals, $k)) ? $r->getId() : null;
- } else {
- $refs[$k] = $cookie;
- $zvalRef = $vals[$k] === $cookie;
- }
-
- if ($zvalRef) {
- $vals[$k] = &$stub; // Break hard references to make $queue completely
- unset($stub); // independent from the original structure
- if (\PHP_VERSION_ID >= 70400 ? null !== $vals[$k] = $hardRefs[$zvalRef] ?? null : $v instanceof Stub && isset($hardRefs[spl_object_id($v)])) {
- if (\PHP_VERSION_ID >= 70400) {
- $v = $vals[$k];
- } else {
- $refs[$k] = $vals[$k] = $v;
- }
- if ($v->value instanceof Stub && (Stub::TYPE_OBJECT === $v->value->type || Stub::TYPE_RESOURCE === $v->value->type)) {
- ++$v->value->refCount;
- }
- ++$v->refCount;
- continue;
- }
- $vals[$k] = new Stub();
- $vals[$k]->value = $v;
- $vals[$k]->handle = ++$refsCounter;
-
- if (\PHP_VERSION_ID >= 70400) {
- $hardRefs[$zvalRef] = $vals[$k];
- } else {
- $refs[$k] = $vals[$k];
- $h = spl_object_id($refs[$k]);
- $hardRefs[$h] = &$refs[$k];
- $values[$h] = $v;
- }
- }
- // Create $stub when the original value $v can not be used directly
- // If $v is a nested structure, put that structure in array $a
- switch (true) {
- case null === $v:
- case \is_bool($v):
- case \is_int($v):
- case \is_float($v):
- continue 2;
- case \is_string($v):
- if ('' === $v) {
- continue 2;
- }
- if (!preg_match('//u', $v)) {
- $stub = new Stub();
- $stub->type = Stub::TYPE_STRING;
- $stub->class = Stub::STRING_BINARY;
- if (0 <= $maxString && 0 < $cut = \strlen($v) - $maxString) {
- $stub->cut = $cut;
- $stub->value = substr($v, 0, -$cut);
- } else {
- $stub->value = $v;
- }
- } elseif (0 <= $maxString && isset($v[1 + ($maxString >> 2)]) && 0 < $cut = mb_strlen($v, 'UTF-8') - $maxString) {
- $stub = new Stub();
- $stub->type = Stub::TYPE_STRING;
- $stub->class = Stub::STRING_UTF8;
- $stub->cut = $cut;
- $stub->value = mb_substr($v, 0, $maxString, 'UTF-8');
- } else {
- continue 2;
- }
- $a = null;
- break;
-
- case \is_array($v):
- if (!$v) {
- continue 2;
- }
- $stub = $arrayStub;
- $stub->class = Stub::ARRAY_INDEXED;
-
- $j = -1;
- foreach ($v as $gk => $gv) {
- if ($gk !== ++$j) {
- $stub->class = Stub::ARRAY_ASSOC;
- break;
- }
- }
- $a = $v;
-
- if (Stub::ARRAY_ASSOC === $stub->class) {
- // Copies of $GLOBALS have very strange behavior,
- // let's detect them with some black magic
- if (\PHP_VERSION_ID < 80100 && ($a[$gid] = true) && isset($v[$gid])) {
- unset($v[$gid]);
- $a = [];
- foreach ($v as $gk => &$gv) {
- if ($v === $gv && (\PHP_VERSION_ID < 70400 || !isset($hardRefs[\ReflectionReference::fromArrayElement($v, $gk)->getId()]))) {
- unset($v);
- $v = new Stub();
- $v->value = [$v->cut = \count($gv), Stub::TYPE_ARRAY => 0];
- $v->handle = -1;
- if (\PHP_VERSION_ID >= 70400) {
- $gv = &$a[$gk];
- $hardRefs[\ReflectionReference::fromArrayElement($a, $gk)->getId()] = &$gv;
- } else {
- $gv = &$hardRefs[spl_object_id($v)];
- }
- $gv = $v;
- }
-
- $a[$gk] = &$gv;
- }
- unset($gv);
- } else {
- $a = $v;
- }
- } elseif (\PHP_VERSION_ID < 70200) {
- $indexedArrays[$len] = true;
- }
- break;
-
- case \is_object($v):
- case $v instanceof \__PHP_Incomplete_Class:
- if (empty($objRefs[$h = spl_object_id($v)])) {
- $stub = new Stub();
- $stub->type = Stub::TYPE_OBJECT;
- $stub->class = \get_class($v);
- $stub->value = $v;
- $stub->handle = $h;
- $a = $this->castObject($stub, 0 < $i);
- if ($v !== $stub->value) {
- if (Stub::TYPE_OBJECT !== $stub->type || null === $stub->value) {
- break;
- }
- $stub->handle = $h = spl_object_id($stub->value);
- }
- $stub->value = null;
- if (0 <= $maxItems && $maxItems <= $pos && $minimumDepthReached) {
- $stub->cut = \count($a);
- $a = null;
- }
- }
- if (empty($objRefs[$h])) {
- $objRefs[$h] = $stub;
- $objects[] = $v;
- } else {
- $stub = $objRefs[$h];
- ++$stub->refCount;
- $a = null;
- }
- break;
-
- default: // resource
- if (empty($resRefs[$h = (int) $v])) {
- $stub = new Stub();
- $stub->type = Stub::TYPE_RESOURCE;
- if ('Unknown' === $stub->class = @get_resource_type($v)) {
- $stub->class = 'Closed';
- }
- $stub->value = $v;
- $stub->handle = $h;
- $a = $this->castResource($stub, 0 < $i);
- $stub->value = null;
- if (0 <= $maxItems && $maxItems <= $pos && $minimumDepthReached) {
- $stub->cut = \count($a);
- $a = null;
- }
- }
- if (empty($resRefs[$h])) {
- $resRefs[$h] = $stub;
- } else {
- $stub = $resRefs[$h];
- ++$stub->refCount;
- $a = null;
- }
- break;
- }
-
- if ($a) {
- if (!$minimumDepthReached || 0 > $maxItems) {
- $queue[$len] = $a;
- $stub->position = $len++;
- } elseif ($pos < $maxItems) {
- if ($maxItems < $pos += \count($a)) {
- $a = \array_slice($a, 0, $maxItems - $pos, true);
- if ($stub->cut >= 0) {
- $stub->cut += $pos - $maxItems;
- }
- }
- $queue[$len] = $a;
- $stub->position = $len++;
- } elseif ($stub->cut >= 0) {
- $stub->cut += \count($a);
- $stub->position = 0;
- }
- }
-
- if ($arrayStub === $stub) {
- if ($arrayStub->cut) {
- $stub = [$arrayStub->cut, $arrayStub->class => $arrayStub->position];
- $arrayStub->cut = 0;
- } elseif (isset(self::$arrayCache[$arrayStub->class][$arrayStub->position])) {
- $stub = self::$arrayCache[$arrayStub->class][$arrayStub->position];
- } else {
- self::$arrayCache[$arrayStub->class][$arrayStub->position] = $stub = [$arrayStub->class => $arrayStub->position];
- }
- }
-
- if (!$zvalRef) {
- $vals[$k] = $stub;
- } elseif (\PHP_VERSION_ID >= 70400) {
- $hardRefs[$zvalRef]->value = $stub;
- } else {
- $refs[$k]->value = $stub;
- }
- }
-
- if ($fromObjCast) {
- $fromObjCast = false;
- $refs = $vals;
- $vals = [];
- $j = -1;
- foreach ($queue[$i] as $k => $v) {
- foreach ([$k => true] as $gk => $gv) {
- }
- if ($gk !== $k) {
- $vals = (object) $vals;
- $vals->{$k} = $refs[++$j];
- $vals = (array) $vals;
- } else {
- $vals[$k] = $refs[++$j];
- }
- }
- }
-
- $queue[$i] = $vals;
- }
-
- foreach ($values as $h => $v) {
- $hardRefs[$h] = $v;
- }
-
- return $queue;
- }
-}
diff --git a/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php b/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php
deleted file mode 100644
index 7d9ec0e..0000000
--- a/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php
+++ /dev/null
@@ -1,88 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Command\Descriptor;
-
-use Symfony\Component\Console\Formatter\OutputFormatterStyle;
-use Symfony\Component\Console\Input\ArrayInput;
-use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Style\SymfonyStyle;
-use Symfony\Component\VarDumper\Cloner\Data;
-use Symfony\Component\VarDumper\Dumper\CliDumper;
-
-/**
- * Describe collected data clones for cli output.
- *
- * @author Maxime Steinhausser
- *
- * @final
- */
-class CliDescriptor implements DumpDescriptorInterface
-{
- private $dumper;
- private $lastIdentifier;
- private $supportsHref;
-
- public function __construct(CliDumper $dumper)
- {
- $this->dumper = $dumper;
- $this->supportsHref = method_exists(OutputFormatterStyle::class, 'setHref');
- }
-
- public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void
- {
- $io = $output instanceof SymfonyStyle ? $output : new SymfonyStyle(new ArrayInput([]), $output);
- $this->dumper->setColors($output->isDecorated());
-
- $rows = [['date', date('r', (int) $context['timestamp'])]];
- $lastIdentifier = $this->lastIdentifier;
- $this->lastIdentifier = $clientId;
-
- $section = "Received from client #$clientId";
- if (isset($context['request'])) {
- $request = $context['request'];
- $this->lastIdentifier = $request['identifier'];
- $section = sprintf('%s %s', $request['method'], $request['uri']);
- if ($controller = $request['controller']) {
- $rows[] = ['controller', rtrim($this->dumper->dump($controller, true), "\n")];
- }
- } elseif (isset($context['cli'])) {
- $this->lastIdentifier = $context['cli']['identifier'];
- $section = '$ '.$context['cli']['command_line'];
- }
-
- if ($this->lastIdentifier !== $lastIdentifier) {
- $io->section($section);
- }
-
- if (isset($context['source'])) {
- $source = $context['source'];
- $sourceInfo = sprintf('%s on line %d', $source['name'], $source['line']);
- $fileLink = $source['file_link'] ?? null;
- if ($this->supportsHref && $fileLink) {
- $sourceInfo = sprintf('%s>', $fileLink, $sourceInfo);
- }
- $rows[] = ['source', $sourceInfo];
- $file = $source['file_relative'] ?? $source['file'];
- $rows[] = ['file', $file];
- }
-
- $io->table([], $rows);
-
- if (!$this->supportsHref && isset($fileLink)) {
- $io->writeln(['Open source in your IDE/browser: ', $fileLink]);
- $io->newLine();
- }
-
- $this->dumper->dump($data);
- $io->newLine();
- }
-}
diff --git a/vendor/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php b/vendor/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php
deleted file mode 100644
index 267d27b..0000000
--- a/vendor/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php
+++ /dev/null
@@ -1,23 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Command\Descriptor;
-
-use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\VarDumper\Cloner\Data;
-
-/**
- * @author Maxime Steinhausser
- */
-interface DumpDescriptorInterface
-{
- public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void;
-}
diff --git a/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php b/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php
deleted file mode 100644
index 636b618..0000000
--- a/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php
+++ /dev/null
@@ -1,119 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Command\Descriptor;
-
-use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\VarDumper\Cloner\Data;
-use Symfony\Component\VarDumper\Dumper\HtmlDumper;
-
-/**
- * Describe collected data clones for html output.
- *
- * @author Maxime Steinhausser
- *
- * @final
- */
-class HtmlDescriptor implements DumpDescriptorInterface
-{
- private $dumper;
- private $initialized = false;
-
- public function __construct(HtmlDumper $dumper)
- {
- $this->dumper = $dumper;
- }
-
- public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void
- {
- if (!$this->initialized) {
- $styles = file_get_contents(__DIR__.'/../../Resources/css/htmlDescriptor.css');
- $scripts = file_get_contents(__DIR__.'/../../Resources/js/htmlDescriptor.js');
- $output->writeln("");
- $this->initialized = true;
- }
-
- $title = '-';
- if (isset($context['request'])) {
- $request = $context['request'];
- $controller = "{$this->dumper->dump($request['controller'], true, ['maxDepth' => 0])} ";
- $title = sprintf('%s
%s ', $request['method'], $uri = $request['uri'], $uri);
- $dedupIdentifier = $request['identifier'];
- } elseif (isset($context['cli'])) {
- $title = '$
'.$context['cli']['command_line'];
- $dedupIdentifier = $context['cli']['identifier'];
- } else {
- $dedupIdentifier = uniqid('', true);
- }
-
- $sourceDescription = '';
- if (isset($context['source'])) {
- $source = $context['source'];
- $projectDir = $source['project_dir'] ?? null;
- $sourceDescription = sprintf('%s on line %d', $source['name'], $source['line']);
- if (isset($source['file_link'])) {
- $sourceDescription = sprintf('%s ', $source['file_link'], $sourceDescription);
- }
- }
-
- $isoDate = $this->extractDate($context, 'c');
- $tags = array_filter([
- 'controller' => $controller ?? null,
- 'project dir' => $projectDir ?? null,
- ]);
-
- $output->writeln(<<
-
-
-
- $sourceDescription
-
- {$this->dumper->dump($data, true)}
-
-
-HTML
- );
- }
-
- private function extractDate(array $context, string $format = 'r'): string
- {
- return date($format, (int) $context['timestamp']);
- }
-
- private function renderTags(array $tags): string
- {
- if (!$tags) {
- return '';
- }
-
- $renderedTags = '';
- foreach ($tags as $key => $value) {
- $renderedTags .= sprintf('%s %s ', $key, $value);
- }
-
- return <<
-
-
-HTML;
- }
-}
diff --git a/vendor/symfony/var-dumper/Command/ServerDumpCommand.php b/vendor/symfony/var-dumper/Command/ServerDumpCommand.php
deleted file mode 100644
index b66301b..0000000
--- a/vendor/symfony/var-dumper/Command/ServerDumpCommand.php
+++ /dev/null
@@ -1,101 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Command;
-
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Exception\InvalidArgumentException;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\InputOption;
-use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Style\SymfonyStyle;
-use Symfony\Component\VarDumper\Cloner\Data;
-use Symfony\Component\VarDumper\Command\Descriptor\CliDescriptor;
-use Symfony\Component\VarDumper\Command\Descriptor\DumpDescriptorInterface;
-use Symfony\Component\VarDumper\Command\Descriptor\HtmlDescriptor;
-use Symfony\Component\VarDumper\Dumper\CliDumper;
-use Symfony\Component\VarDumper\Dumper\HtmlDumper;
-use Symfony\Component\VarDumper\Server\DumpServer;
-
-/**
- * Starts a dump server to collect and output dumps on a single place with multiple formats support.
- *
- * @author Maxime Steinhausser
- *
- * @final
- */
-class ServerDumpCommand extends Command
-{
- protected static $defaultName = 'server:dump';
-
- private $server;
-
- /** @var DumpDescriptorInterface[] */
- private $descriptors;
-
- public function __construct(DumpServer $server, array $descriptors = [])
- {
- $this->server = $server;
- $this->descriptors = $descriptors + [
- 'cli' => new CliDescriptor(new CliDumper()),
- 'html' => new HtmlDescriptor(new HtmlDumper()),
- ];
-
- parent::__construct();
- }
-
- protected function configure()
- {
- $availableFormats = implode(', ', array_keys($this->descriptors));
-
- $this
- ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', $availableFormats), 'cli')
- ->setDescription('Start a dump server that collects and displays dumps in a single place')
- ->setHelp(<<<'EOF'
-%command.name% starts a dump server that collects and displays
-dumps in a single place for debugging you application:
-
- php %command.full_name%
-
-You can consult dumped data in HTML format in your browser by providing the --format=html option
-and redirecting the output to a file:
-
- php %command.full_name% --format="html" > dump.html
-
-EOF
- )
- ;
- }
-
- protected function execute(InputInterface $input, OutputInterface $output): int
- {
- $io = new SymfonyStyle($input, $output);
- $format = $input->getOption('format');
-
- if (!$descriptor = $this->descriptors[$format] ?? null) {
- throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $format));
- }
-
- $errorIo = $io->getErrorStyle();
- $errorIo->title('Symfony Var Dumper Server');
-
- $this->server->start();
-
- $errorIo->success(sprintf('Server listening on %s', $this->server->getHost()));
- $errorIo->comment('Quit the server with CONTROL-C.');
-
- $this->server->listen(function (Data $data, array $context, int $clientId) use ($descriptor, $io) {
- $descriptor->describe($io, $data, $context, $clientId);
- });
-
- return 0;
- }
-}
diff --git a/vendor/symfony/var-dumper/Dumper/AbstractDumper.php b/vendor/symfony/var-dumper/Dumper/AbstractDumper.php
deleted file mode 100644
index 4185329..0000000
--- a/vendor/symfony/var-dumper/Dumper/AbstractDumper.php
+++ /dev/null
@@ -1,210 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Dumper;
-
-use Symfony\Component\VarDumper\Cloner\Data;
-use Symfony\Component\VarDumper\Cloner\DumperInterface;
-
-/**
- * Abstract mechanism for dumping a Data object.
- *
- * @author Nicolas Grekas
- */
-abstract class AbstractDumper implements DataDumperInterface, DumperInterface
-{
- public const DUMP_LIGHT_ARRAY = 1;
- public const DUMP_STRING_LENGTH = 2;
- public const DUMP_COMMA_SEPARATOR = 4;
- public const DUMP_TRAILING_COMMA = 8;
-
- public static $defaultOutput = 'php://output';
-
- protected $line = '';
- protected $lineDumper;
- protected $outputStream;
- protected $decimalPoint; // This is locale dependent
- protected $indentPad = ' ';
- protected $flags;
-
- private $charset = '';
-
- /**
- * @param callable|resource|string|null $output A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput
- * @param string|null $charset The default character encoding to use for non-UTF8 strings
- * @param int $flags A bit field of static::DUMP_* constants to fine tune dumps representation
- */
- public function __construct($output = null, string $charset = null, int $flags = 0)
- {
- $this->flags = $flags;
- $this->setCharset($charset ?: \ini_get('php.output_encoding') ?: \ini_get('default_charset') ?: 'UTF-8');
- $this->decimalPoint = \PHP_VERSION_ID >= 80000 ? '.' : localeconv()['decimal_point'];
- $this->setOutput($output ?: static::$defaultOutput);
- if (!$output && \is_string(static::$defaultOutput)) {
- static::$defaultOutput = $this->outputStream;
- }
- }
-
- /**
- * Sets the output destination of the dumps.
- *
- * @param callable|resource|string $output A line dumper callable, an opened stream or an output path
- *
- * @return callable|resource|string The previous output destination
- */
- public function setOutput($output)
- {
- $prev = $this->outputStream ?? $this->lineDumper;
-
- if (\is_callable($output)) {
- $this->outputStream = null;
- $this->lineDumper = $output;
- } else {
- if (\is_string($output)) {
- $output = fopen($output, 'w');
- }
- $this->outputStream = $output;
- $this->lineDumper = [$this, 'echoLine'];
- }
-
- return $prev;
- }
-
- /**
- * Sets the default character encoding to use for non-UTF8 strings.
- *
- * @param string $charset The default character encoding to use for non-UTF8 strings
- *
- * @return string The previous charset
- */
- public function setCharset($charset)
- {
- $prev = $this->charset;
-
- $charset = strtoupper($charset);
- $charset = null === $charset || 'UTF-8' === $charset || 'UTF8' === $charset ? 'CP1252' : $charset;
-
- $this->charset = $charset;
-
- return $prev;
- }
-
- /**
- * Sets the indentation pad string.
- *
- * @param string $pad A string that will be prepended to dumped lines, repeated by nesting level
- *
- * @return string The previous indent pad
- */
- public function setIndentPad($pad)
- {
- $prev = $this->indentPad;
- $this->indentPad = $pad;
-
- return $prev;
- }
-
- /**
- * Dumps a Data object.
- *
- * @param callable|resource|string|true|null $output A line dumper callable, an opened stream, an output path or true to return the dump
- *
- * @return string|null The dump as string when $output is true
- */
- public function dump(Data $data, $output = null)
- {
- $this->decimalPoint = \PHP_VERSION_ID >= 80000 ? '.' : localeconv()['decimal_point'];
-
- if ($locale = $this->flags & (self::DUMP_COMMA_SEPARATOR | self::DUMP_TRAILING_COMMA) ? setlocale(\LC_NUMERIC, 0) : null) {
- setlocale(\LC_NUMERIC, 'C');
- }
-
- if ($returnDump = true === $output) {
- $output = fopen('php://memory', 'r+');
- }
- if ($output) {
- $prevOutput = $this->setOutput($output);
- }
- try {
- $data->dump($this);
- $this->dumpLine(-1);
-
- if ($returnDump) {
- $result = stream_get_contents($output, -1, 0);
- fclose($output);
-
- return $result;
- }
- } finally {
- if ($output) {
- $this->setOutput($prevOutput);
- }
- if ($locale) {
- setlocale(\LC_NUMERIC, $locale);
- }
- }
-
- return null;
- }
-
- /**
- * Dumps the current line.
- *
- * @param int $depth The recursive depth in the dumped structure for the line being dumped,
- * or -1 to signal the end-of-dump to the line dumper callable
- */
- protected function dumpLine($depth)
- {
- ($this->lineDumper)($this->line, $depth, $this->indentPad);
- $this->line = '';
- }
-
- /**
- * Generic line dumper callback.
- *
- * @param string $line The line to write
- * @param int $depth The recursive depth in the dumped structure
- * @param string $indentPad The line indent pad
- */
- protected function echoLine($line, $depth, $indentPad)
- {
- if (-1 !== $depth) {
- fwrite($this->outputStream, str_repeat($indentPad, $depth).$line."\n");
- }
- }
-
- /**
- * Converts a non-UTF-8 string to UTF-8.
- *
- * @param string|null $s The non-UTF-8 string to convert
- *
- * @return string|null The string converted to UTF-8
- */
- protected function utf8Encode($s)
- {
- if (null === $s || preg_match('//u', $s)) {
- return $s;
- }
-
- if (!\function_exists('iconv')) {
- throw new \RuntimeException('Unable to convert a non-UTF-8 string to UTF-8: required function iconv() does not exist. You should install ext-iconv or symfony/polyfill-iconv.');
- }
-
- if (false !== $c = @iconv($this->charset, 'UTF-8', $s)) {
- return $c;
- }
- if ('CP1252' !== $this->charset && false !== $c = @iconv('CP1252', 'UTF-8', $s)) {
- return $c;
- }
-
- return iconv('CP850', 'UTF-8', $s);
- }
-}
diff --git a/vendor/symfony/var-dumper/Dumper/CliDumper.php b/vendor/symfony/var-dumper/Dumper/CliDumper.php
deleted file mode 100644
index e3861cd..0000000
--- a/vendor/symfony/var-dumper/Dumper/CliDumper.php
+++ /dev/null
@@ -1,655 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Dumper;
-
-use Symfony\Component\VarDumper\Cloner\Cursor;
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * CliDumper dumps variables for command line output.
- *
- * @author Nicolas Grekas
- */
-class CliDumper extends AbstractDumper
-{
- public static $defaultColors;
- public static $defaultOutput = 'php://stdout';
-
- protected $colors;
- protected $maxStringWidth = 0;
- protected $styles = [
- // See http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
- 'default' => '0;38;5;208',
- 'num' => '1;38;5;38',
- 'const' => '1;38;5;208',
- 'str' => '1;38;5;113',
- 'note' => '38;5;38',
- 'ref' => '38;5;247',
- 'public' => '',
- 'protected' => '',
- 'private' => '',
- 'meta' => '38;5;170',
- 'key' => '38;5;113',
- 'index' => '38;5;38',
- ];
-
- protected static $controlCharsRx = '/[\x00-\x1F\x7F]+/';
- protected static $controlCharsMap = [
- "\t" => '\t',
- "\n" => '\n',
- "\v" => '\v',
- "\f" => '\f',
- "\r" => '\r',
- "\033" => '\e',
- ];
-
- protected $collapseNextHash = false;
- protected $expandNextHash = false;
-
- private $displayOptions = [
- 'fileLinkFormat' => null,
- ];
-
- private $handlesHrefGracefully;
-
- /**
- * {@inheritdoc}
- */
- public function __construct($output = null, string $charset = null, int $flags = 0)
- {
- parent::__construct($output, $charset, $flags);
-
- if ('\\' === \DIRECTORY_SEPARATOR && !$this->isWindowsTrueColor()) {
- // Use only the base 16 xterm colors when using ANSICON or standard Windows 10 CLI
- $this->setStyles([
- 'default' => '31',
- 'num' => '1;34',
- 'const' => '1;31',
- 'str' => '1;32',
- 'note' => '34',
- 'ref' => '1;30',
- 'meta' => '35',
- 'key' => '32',
- 'index' => '34',
- ]);
- }
-
- $this->displayOptions['fileLinkFormat'] = \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: 'file://%f#L%l';
- }
-
- /**
- * Enables/disables colored output.
- *
- * @param bool $colors
- */
- public function setColors($colors)
- {
- $this->colors = (bool) $colors;
- }
-
- /**
- * Sets the maximum number of characters per line for dumped strings.
- *
- * @param int $maxStringWidth
- */
- public function setMaxStringWidth($maxStringWidth)
- {
- $this->maxStringWidth = (int) $maxStringWidth;
- }
-
- /**
- * Configures styles.
- *
- * @param array $styles A map of style names to style definitions
- */
- public function setStyles(array $styles)
- {
- $this->styles = $styles + $this->styles;
- }
-
- /**
- * Configures display options.
- *
- * @param array $displayOptions A map of display options to customize the behavior
- */
- public function setDisplayOptions(array $displayOptions)
- {
- $this->displayOptions = $displayOptions + $this->displayOptions;
- }
-
- /**
- * {@inheritdoc}
- */
- public function dumpScalar(Cursor $cursor, $type, $value)
- {
- $this->dumpKey($cursor);
-
- $style = 'const';
- $attr = $cursor->attr;
-
- switch ($type) {
- case 'default':
- $style = 'default';
- break;
-
- case 'integer':
- $style = 'num';
- break;
-
- case 'double':
- $style = 'num';
-
- switch (true) {
- case \INF === $value: $value = 'INF'; break;
- case -\INF === $value: $value = '-INF'; break;
- case is_nan($value): $value = 'NAN'; break;
- default:
- $value = (string) $value;
- if (!str_contains($value, $this->decimalPoint)) {
- $value .= $this->decimalPoint.'0';
- }
- break;
- }
- break;
-
- case 'NULL':
- $value = 'null';
- break;
-
- case 'boolean':
- $value = $value ? 'true' : 'false';
- break;
-
- default:
- $attr += ['value' => $this->utf8Encode($value)];
- $value = $this->utf8Encode($type);
- break;
- }
-
- $this->line .= $this->style($style, $value, $attr);
-
- $this->endValue($cursor);
- }
-
- /**
- * {@inheritdoc}
- */
- public function dumpString(Cursor $cursor, $str, $bin, $cut)
- {
- $this->dumpKey($cursor);
- $attr = $cursor->attr;
-
- if ($bin) {
- $str = $this->utf8Encode($str);
- }
- if ('' === $str) {
- $this->line .= '""';
- $this->endValue($cursor);
- } else {
- $attr += [
- 'length' => 0 <= $cut ? mb_strlen($str, 'UTF-8') + $cut : 0,
- 'binary' => $bin,
- ];
- $str = explode("\n", $str);
- if (isset($str[1]) && !isset($str[2]) && !isset($str[1][0])) {
- unset($str[1]);
- $str[0] .= "\n";
- }
- $m = \count($str) - 1;
- $i = $lineCut = 0;
-
- if (self::DUMP_STRING_LENGTH & $this->flags) {
- $this->line .= '('.$attr['length'].') ';
- }
- if ($bin) {
- $this->line .= 'b';
- }
-
- if ($m) {
- $this->line .= '"""';
- $this->dumpLine($cursor->depth);
- } else {
- $this->line .= '"';
- }
-
- foreach ($str as $str) {
- if ($i < $m) {
- $str .= "\n";
- }
- if (0 < $this->maxStringWidth && $this->maxStringWidth < $len = mb_strlen($str, 'UTF-8')) {
- $str = mb_substr($str, 0, $this->maxStringWidth, 'UTF-8');
- $lineCut = $len - $this->maxStringWidth;
- }
- if ($m && 0 < $cursor->depth) {
- $this->line .= $this->indentPad;
- }
- if ('' !== $str) {
- $this->line .= $this->style('str', $str, $attr);
- }
- if ($i++ == $m) {
- if ($m) {
- if ('' !== $str) {
- $this->dumpLine($cursor->depth);
- if (0 < $cursor->depth) {
- $this->line .= $this->indentPad;
- }
- }
- $this->line .= '"""';
- } else {
- $this->line .= '"';
- }
- if ($cut < 0) {
- $this->line .= '…';
- $lineCut = 0;
- } elseif ($cut) {
- $lineCut += $cut;
- }
- }
- if ($lineCut) {
- $this->line .= '…'.$lineCut;
- $lineCut = 0;
- }
-
- if ($i > $m) {
- $this->endValue($cursor);
- } else {
- $this->dumpLine($cursor->depth);
- }
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function enterHash(Cursor $cursor, $type, $class, $hasChild)
- {
- if (null === $this->colors) {
- $this->colors = $this->supportsColors();
- }
-
- $this->dumpKey($cursor);
- $attr = $cursor->attr;
-
- if ($this->collapseNextHash) {
- $cursor->skipChildren = true;
- $this->collapseNextHash = $hasChild = false;
- }
-
- $class = $this->utf8Encode($class);
- if (Cursor::HASH_OBJECT === $type) {
- $prefix = $class && 'stdClass' !== $class ? $this->style('note', $class, $attr).(empty($attr['cut_hash']) ? ' {' : '') : '{';
- } elseif (Cursor::HASH_RESOURCE === $type) {
- $prefix = $this->style('note', $class.' resource', $attr).($hasChild ? ' {' : ' ');
- } else {
- $prefix = $class && !(self::DUMP_LIGHT_ARRAY & $this->flags) ? $this->style('note', 'array:'.$class).' [' : '[';
- }
-
- if (($cursor->softRefCount || 0 < $cursor->softRefHandle) && empty($attr['cut_hash'])) {
- $prefix .= $this->style('ref', (Cursor::HASH_RESOURCE === $type ? '@' : '#').(0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->softRefTo), ['count' => $cursor->softRefCount]);
- } elseif ($cursor->hardRefTo && !$cursor->refIndex && $class) {
- $prefix .= $this->style('ref', '&'.$cursor->hardRefTo, ['count' => $cursor->hardRefCount]);
- } elseif (!$hasChild && Cursor::HASH_RESOURCE === $type) {
- $prefix = substr($prefix, 0, -1);
- }
-
- $this->line .= $prefix;
-
- if ($hasChild) {
- $this->dumpLine($cursor->depth);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut)
- {
- if (empty($cursor->attr['cut_hash'])) {
- $this->dumpEllipsis($cursor, $hasChild, $cut);
- $this->line .= Cursor::HASH_OBJECT === $type ? '}' : (Cursor::HASH_RESOURCE !== $type ? ']' : ($hasChild ? '}' : ''));
- }
-
- $this->endValue($cursor);
- }
-
- /**
- * Dumps an ellipsis for cut children.
- *
- * @param bool $hasChild When the dump of the hash has child item
- * @param int $cut The number of items the hash has been cut by
- */
- protected function dumpEllipsis(Cursor $cursor, $hasChild, $cut)
- {
- if ($cut) {
- $this->line .= ' …';
- if (0 < $cut) {
- $this->line .= $cut;
- }
- if ($hasChild) {
- $this->dumpLine($cursor->depth + 1);
- }
- }
- }
-
- /**
- * Dumps a key in a hash structure.
- */
- protected function dumpKey(Cursor $cursor)
- {
- if (null !== $key = $cursor->hashKey) {
- if ($cursor->hashKeyIsBinary) {
- $key = $this->utf8Encode($key);
- }
- $attr = ['binary' => $cursor->hashKeyIsBinary];
- $bin = $cursor->hashKeyIsBinary ? 'b' : '';
- $style = 'key';
- switch ($cursor->hashType) {
- default:
- case Cursor::HASH_INDEXED:
- if (self::DUMP_LIGHT_ARRAY & $this->flags) {
- break;
- }
- $style = 'index';
- // no break
- case Cursor::HASH_ASSOC:
- if (\is_int($key)) {
- $this->line .= $this->style($style, $key).' => ';
- } else {
- $this->line .= $bin.'"'.$this->style($style, $key).'" => ';
- }
- break;
-
- case Cursor::HASH_RESOURCE:
- $key = "\0~\0".$key;
- // no break
- case Cursor::HASH_OBJECT:
- if (!isset($key[0]) || "\0" !== $key[0]) {
- $this->line .= '+'.$bin.$this->style('public', $key).': ';
- } elseif (0 < strpos($key, "\0", 1)) {
- $key = explode("\0", substr($key, 1), 2);
-
- switch ($key[0][0]) {
- case '+': // User inserted keys
- $attr['dynamic'] = true;
- $this->line .= '+'.$bin.'"'.$this->style('public', $key[1], $attr).'": ';
- break 2;
- case '~':
- $style = 'meta';
- if (isset($key[0][1])) {
- parse_str(substr($key[0], 1), $attr);
- $attr += ['binary' => $cursor->hashKeyIsBinary];
- }
- break;
- case '*':
- $style = 'protected';
- $bin = '#'.$bin;
- break;
- default:
- $attr['class'] = $key[0];
- $style = 'private';
- $bin = '-'.$bin;
- break;
- }
-
- if (isset($attr['collapse'])) {
- if ($attr['collapse']) {
- $this->collapseNextHash = true;
- } else {
- $this->expandNextHash = true;
- }
- }
-
- $this->line .= $bin.$this->style($style, $key[1], $attr).($attr['separator'] ?? ': ');
- } else {
- // This case should not happen
- $this->line .= '-'.$bin.'"'.$this->style('private', $key, ['class' => '']).'": ';
- }
- break;
- }
-
- if ($cursor->hardRefTo) {
- $this->line .= $this->style('ref', '&'.($cursor->hardRefCount ? $cursor->hardRefTo : ''), ['count' => $cursor->hardRefCount]).' ';
- }
- }
- }
-
- /**
- * Decorates a value with some style.
- *
- * @param string $style The type of style being applied
- * @param string $value The value being styled
- * @param array $attr Optional context information
- *
- * @return string The value with style decoration
- */
- protected function style($style, $value, $attr = [])
- {
- if (null === $this->colors) {
- $this->colors = $this->supportsColors();
- }
-
- if (null === $this->handlesHrefGracefully) {
- $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR')
- && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100);
- }
-
- if (isset($attr['ellipsis'], $attr['ellipsis-type'])) {
- $prefix = substr($value, 0, -$attr['ellipsis']);
- if ('cli' === \PHP_SAPI && 'path' === $attr['ellipsis-type'] && isset($_SERVER[$pwd = '\\' === \DIRECTORY_SEPARATOR ? 'CD' : 'PWD']) && str_starts_with($prefix, $_SERVER[$pwd])) {
- $prefix = '.'.substr($prefix, \strlen($_SERVER[$pwd]));
- }
- if (!empty($attr['ellipsis-tail'])) {
- $prefix .= substr($value, -$attr['ellipsis'], $attr['ellipsis-tail']);
- $value = substr($value, -$attr['ellipsis'] + $attr['ellipsis-tail']);
- } else {
- $value = substr($value, -$attr['ellipsis']);
- }
-
- $value = $this->style('default', $prefix).$this->style($style, $value);
-
- goto href;
- }
-
- $map = static::$controlCharsMap;
- $startCchr = $this->colors ? "\033[m\033[{$this->styles['default']}m" : '';
- $endCchr = $this->colors ? "\033[m\033[{$this->styles[$style]}m" : '';
- $value = preg_replace_callback(static::$controlCharsRx, function ($c) use ($map, $startCchr, $endCchr) {
- $s = $startCchr;
- $c = $c[$i = 0];
- do {
- $s .= $map[$c[$i]] ?? sprintf('\x%02X', \ord($c[$i]));
- } while (isset($c[++$i]));
-
- return $s.$endCchr;
- }, $value, -1, $cchrCount);
-
- if ($this->colors) {
- if ($cchrCount && "\033" === $value[0]) {
- $value = substr($value, \strlen($startCchr));
- } else {
- $value = "\033[{$this->styles[$style]}m".$value;
- }
- if ($cchrCount && str_ends_with($value, $endCchr)) {
- $value = substr($value, 0, -\strlen($endCchr));
- } else {
- $value .= "\033[{$this->styles['default']}m";
- }
- }
-
- href:
- if ($this->colors && $this->handlesHrefGracefully) {
- if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], $attr['line'] ?? 0)) {
- if ('note' === $style) {
- $value .= "\033]8;;{$href}\033\\^\033]8;;\033\\";
- } else {
- $attr['href'] = $href;
- }
- }
- if (isset($attr['href'])) {
- $value = "\033]8;;{$attr['href']}\033\\{$value}\033]8;;\033\\";
- }
- } elseif ($attr['if_links'] ?? false) {
- return '';
- }
-
- return $value;
- }
-
- /**
- * @return bool Tells if the current output stream supports ANSI colors or not
- */
- protected function supportsColors()
- {
- if ($this->outputStream !== static::$defaultOutput) {
- return $this->hasColorSupport($this->outputStream);
- }
- if (null !== static::$defaultColors) {
- return static::$defaultColors;
- }
- if (isset($_SERVER['argv'][1])) {
- $colors = $_SERVER['argv'];
- $i = \count($colors);
- while (--$i > 0) {
- if (isset($colors[$i][5])) {
- switch ($colors[$i]) {
- case '--ansi':
- case '--color':
- case '--color=yes':
- case '--color=force':
- case '--color=always':
- return static::$defaultColors = true;
-
- case '--no-ansi':
- case '--color=no':
- case '--color=none':
- case '--color=never':
- return static::$defaultColors = false;
- }
- }
- }
- }
-
- $h = stream_get_meta_data($this->outputStream) + ['wrapper_type' => null];
- $h = 'Output' === $h['stream_type'] && 'PHP' === $h['wrapper_type'] ? fopen('php://stdout', 'w') : $this->outputStream;
-
- return static::$defaultColors = $this->hasColorSupport($h);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function dumpLine($depth, $endOfValue = false)
- {
- if ($this->colors) {
- $this->line = sprintf("\033[%sm%s\033[m", $this->styles['default'], $this->line);
- }
- parent::dumpLine($depth);
- }
-
- protected function endValue(Cursor $cursor)
- {
- if (-1 === $cursor->hashType) {
- return;
- }
-
- if (Stub::ARRAY_INDEXED === $cursor->hashType || Stub::ARRAY_ASSOC === $cursor->hashType) {
- if (self::DUMP_TRAILING_COMMA & $this->flags && 0 < $cursor->depth) {
- $this->line .= ',';
- } elseif (self::DUMP_COMMA_SEPARATOR & $this->flags && 1 < $cursor->hashLength - $cursor->hashIndex) {
- $this->line .= ',';
- }
- }
-
- $this->dumpLine($cursor->depth, true);
- }
-
- /**
- * Returns true if the stream supports colorization.
- *
- * Reference: Composer\XdebugHandler\Process::supportsColor
- * https://github.com/composer/xdebug-handler
- *
- * @param mixed $stream A CLI output stream
- */
- private function hasColorSupport($stream): bool
- {
- if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) {
- return false;
- }
-
- // Follow https://no-color.org/
- if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) {
- return false;
- }
-
- if ('Hyper' === getenv('TERM_PROGRAM')) {
- return true;
- }
-
- if (\DIRECTORY_SEPARATOR === '\\') {
- return (\function_exists('sapi_windows_vt100_support')
- && @sapi_windows_vt100_support($stream))
- || false !== getenv('ANSICON')
- || 'ON' === getenv('ConEmuANSI')
- || 'xterm' === getenv('TERM');
- }
-
- if (\function_exists('stream_isatty')) {
- return @stream_isatty($stream);
- }
-
- if (\function_exists('posix_isatty')) {
- return @posix_isatty($stream);
- }
-
- $stat = @fstat($stream);
- // Check if formatted mode is S_IFCHR
- return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
- }
-
- /**
- * Returns true if the Windows terminal supports true color.
- *
- * Note that this does not check an output stream, but relies on environment
- * variables from known implementations, or a PHP and Windows version that
- * supports true color.
- */
- private function isWindowsTrueColor(): bool
- {
- $result = 183 <= getenv('ANSICON_VER')
- || 'ON' === getenv('ConEmuANSI')
- || 'xterm' === getenv('TERM')
- || 'Hyper' === getenv('TERM_PROGRAM');
-
- if (!$result && \PHP_VERSION_ID >= 70200) {
- $version = sprintf(
- '%s.%s.%s',
- PHP_WINDOWS_VERSION_MAJOR,
- PHP_WINDOWS_VERSION_MINOR,
- PHP_WINDOWS_VERSION_BUILD
- );
- $result = $version >= '10.0.15063';
- }
-
- return $result;
- }
-
- private function getSourceLink(string $file, int $line)
- {
- if ($fmt = $this->displayOptions['fileLinkFormat']) {
- return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : ($fmt->format($file, $line) ?: 'file://'.$file.'#L'.$line);
- }
-
- return false;
- }
-}
diff --git a/vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php b/vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php
deleted file mode 100644
index 38f8789..0000000
--- a/vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Dumper\ContextProvider;
-
-/**
- * Tries to provide context on CLI.
- *
- * @author Maxime Steinhausser
- */
-final class CliContextProvider implements ContextProviderInterface
-{
- public function getContext(): ?array
- {
- if ('cli' !== \PHP_SAPI) {
- return null;
- }
-
- return [
- 'command_line' => $commandLine = implode(' ', $_SERVER['argv'] ?? []),
- 'identifier' => hash('crc32b', $commandLine.$_SERVER['REQUEST_TIME_FLOAT']),
- ];
- }
-}
diff --git a/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php b/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php
deleted file mode 100644
index 38ef3b0..0000000
--- a/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php
+++ /dev/null
@@ -1,25 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Dumper\ContextProvider;
-
-/**
- * Interface to provide contextual data about dump data clones sent to a server.
- *
- * @author Maxime Steinhausser
- */
-interface ContextProviderInterface
-{
- /**
- * @return array|null Context data or null if unable to provide any context
- */
- public function getContext(): ?array;
-}
diff --git a/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php b/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php
deleted file mode 100644
index 3684a47..0000000
--- a/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php
+++ /dev/null
@@ -1,51 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Dumper\ContextProvider;
-
-use Symfony\Component\HttpFoundation\RequestStack;
-use Symfony\Component\VarDumper\Caster\ReflectionCaster;
-use Symfony\Component\VarDumper\Cloner\VarCloner;
-
-/**
- * Tries to provide context from a request.
- *
- * @author Maxime Steinhausser
- */
-final class RequestContextProvider implements ContextProviderInterface
-{
- private $requestStack;
- private $cloner;
-
- public function __construct(RequestStack $requestStack)
- {
- $this->requestStack = $requestStack;
- $this->cloner = new VarCloner();
- $this->cloner->setMaxItems(0);
- $this->cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO);
- }
-
- public function getContext(): ?array
- {
- if (null === $request = $this->requestStack->getCurrentRequest()) {
- return null;
- }
-
- $controller = $request->attributes->get('_controller');
-
- return [
- 'uri' => $request->getUri(),
- 'method' => $request->getMethod(),
- 'controller' => $controller ? $this->cloner->cloneVar($controller) : $controller,
- 'identifier' => spl_object_hash($request),
- ];
- }
-}
diff --git a/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php b/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php
deleted file mode 100644
index 2e2c818..0000000
--- a/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php
+++ /dev/null
@@ -1,126 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Dumper\ContextProvider;
-
-use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
-use Symfony\Component\VarDumper\Cloner\VarCloner;
-use Symfony\Component\VarDumper\Dumper\HtmlDumper;
-use Symfony\Component\VarDumper\VarDumper;
-use Twig\Template;
-
-/**
- * Tries to provide context from sources (class name, file, line, code excerpt, ...).
- *
- * @author Nicolas Grekas
- * @author Maxime Steinhausser
- */
-final class SourceContextProvider implements ContextProviderInterface
-{
- private $limit;
- private $charset;
- private $projectDir;
- private $fileLinkFormatter;
-
- public function __construct(string $charset = null, string $projectDir = null, FileLinkFormatter $fileLinkFormatter = null, int $limit = 9)
- {
- $this->charset = $charset;
- $this->projectDir = $projectDir;
- $this->fileLinkFormatter = $fileLinkFormatter;
- $this->limit = $limit;
- }
-
- public function getContext(): ?array
- {
- $trace = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS, $this->limit);
-
- $file = $trace[1]['file'];
- $line = $trace[1]['line'];
- $name = false;
- $fileExcerpt = false;
-
- for ($i = 2; $i < $this->limit; ++$i) {
- if (isset($trace[$i]['class'], $trace[$i]['function'])
- && 'dump' === $trace[$i]['function']
- && VarDumper::class === $trace[$i]['class']
- ) {
- $file = $trace[$i]['file'] ?? $file;
- $line = $trace[$i]['line'] ?? $line;
-
- while (++$i < $this->limit) {
- if (isset($trace[$i]['function'], $trace[$i]['file']) && empty($trace[$i]['class']) && !str_starts_with($trace[$i]['function'], 'call_user_func')) {
- $file = $trace[$i]['file'];
- $line = $trace[$i]['line'];
-
- break;
- } elseif (isset($trace[$i]['object']) && $trace[$i]['object'] instanceof Template) {
- $template = $trace[$i]['object'];
- $name = $template->getTemplateName();
- $src = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : false);
- $info = $template->getDebugInfo();
- if (isset($info[$trace[$i - 1]['line']])) {
- $line = $info[$trace[$i - 1]['line']];
- $file = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getPath() : null;
-
- if ($src) {
- $src = explode("\n", $src);
- $fileExcerpt = [];
-
- for ($i = max($line - 3, 1), $max = min($line + 3, \count($src)); $i <= $max; ++$i) {
- $fileExcerpt[] = ''.$this->htmlEncode($src[$i - 1]).'
';
- }
-
- $fileExcerpt = ''.implode("\n", $fileExcerpt).' ';
- }
- }
- break;
- }
- }
- break;
- }
- }
-
- if (false === $name) {
- $name = str_replace('\\', '/', $file);
- $name = substr($name, strrpos($name, '/') + 1);
- }
-
- $context = ['name' => $name, 'file' => $file, 'line' => $line];
- $context['file_excerpt'] = $fileExcerpt;
-
- if (null !== $this->projectDir) {
- $context['project_dir'] = $this->projectDir;
- if (str_starts_with($file, $this->projectDir)) {
- $context['file_relative'] = ltrim(substr($file, \strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
- }
- }
-
- if ($this->fileLinkFormatter && $fileLink = $this->fileLinkFormatter->format($context['file'], $context['line'])) {
- $context['file_link'] = $fileLink;
- }
-
- return $context;
- }
-
- private function htmlEncode(string $s): string
- {
- $html = '';
-
- $dumper = new HtmlDumper(function ($line) use (&$html) { $html .= $line; }, $this->charset);
- $dumper->setDumpHeader('');
- $dumper->setDumpBoundaries('', '');
-
- $cloner = new VarCloner();
- $dumper->dump($cloner->cloneVar($s));
-
- return substr(strip_tags($html), 1, -1);
- }
-}
diff --git a/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php b/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php
deleted file mode 100644
index 7638417..0000000
--- a/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php
+++ /dev/null
@@ -1,43 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Dumper;
-
-use Symfony\Component\VarDumper\Cloner\Data;
-use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
-
-/**
- * @author Kévin Thérage
- */
-class ContextualizedDumper implements DataDumperInterface
-{
- private $wrappedDumper;
- private $contextProviders;
-
- /**
- * @param ContextProviderInterface[] $contextProviders
- */
- public function __construct(DataDumperInterface $wrappedDumper, array $contextProviders)
- {
- $this->wrappedDumper = $wrappedDumper;
- $this->contextProviders = $contextProviders;
- }
-
- public function dump(Data $data)
- {
- $context = [];
- foreach ($this->contextProviders as $contextProvider) {
- $context[\get_class($contextProvider)] = $contextProvider->getContext();
- }
-
- $this->wrappedDumper->dump($data->withContext($context));
- }
-}
diff --git a/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php b/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php
deleted file mode 100644
index b173bcc..0000000
--- a/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php
+++ /dev/null
@@ -1,24 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Dumper;
-
-use Symfony\Component\VarDumper\Cloner\Data;
-
-/**
- * DataDumperInterface for dumping Data objects.
- *
- * @author Nicolas Grekas
- */
-interface DataDumperInterface
-{
- public function dump(Data $data);
-}
diff --git a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php b/vendor/symfony/var-dumper/Dumper/HtmlDumper.php
deleted file mode 100644
index 9b57f90..0000000
--- a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php
+++ /dev/null
@@ -1,1004 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Dumper;
-
-use Symfony\Component\VarDumper\Cloner\Cursor;
-use Symfony\Component\VarDumper\Cloner\Data;
-
-/**
- * HtmlDumper dumps variables as HTML.
- *
- * @author Nicolas Grekas
- */
-class HtmlDumper extends CliDumper
-{
- public static $defaultOutput = 'php://output';
-
- protected static $themes = [
- 'dark' => [
- 'default' => 'background-color:#18171B; color:#FF8400; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: break-all',
- 'num' => 'font-weight:bold; color:#1299DA',
- 'const' => 'font-weight:bold',
- 'str' => 'font-weight:bold; color:#56DB3A',
- 'note' => 'color:#1299DA',
- 'ref' => 'color:#A0A0A0',
- 'public' => 'color:#FFFFFF',
- 'protected' => 'color:#FFFFFF',
- 'private' => 'color:#FFFFFF',
- 'meta' => 'color:#B729D9',
- 'key' => 'color:#56DB3A',
- 'index' => 'color:#1299DA',
- 'ellipsis' => 'color:#FF8400',
- 'ns' => 'user-select:none;',
- ],
- 'light' => [
- 'default' => 'background:none; color:#CC7832; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: break-all',
- 'num' => 'font-weight:bold; color:#1299DA',
- 'const' => 'font-weight:bold',
- 'str' => 'font-weight:bold; color:#629755;',
- 'note' => 'color:#6897BB',
- 'ref' => 'color:#6E6E6E',
- 'public' => 'color:#262626',
- 'protected' => 'color:#262626',
- 'private' => 'color:#262626',
- 'meta' => 'color:#B729D9',
- 'key' => 'color:#789339',
- 'index' => 'color:#1299DA',
- 'ellipsis' => 'color:#CC7832',
- 'ns' => 'user-select:none;',
- ],
- ];
-
- protected $dumpHeader;
- protected $dumpPrefix = '
';
- protected $dumpSuffix = ' ';
- protected $dumpId = 'sf-dump';
- protected $colors = true;
- protected $headerIsDumped = false;
- protected $lastDepth = -1;
- protected $styles;
-
- private $displayOptions = [
- 'maxDepth' => 1,
- 'maxStringLength' => 160,
- 'fileLinkFormat' => null,
- ];
- private $extraDisplayOptions = [];
-
- /**
- * {@inheritdoc}
- */
- public function __construct($output = null, string $charset = null, int $flags = 0)
- {
- AbstractDumper::__construct($output, $charset, $flags);
- $this->dumpId = 'sf-dump-'.mt_rand();
- $this->displayOptions['fileLinkFormat'] = \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
- $this->styles = static::$themes['dark'] ?? self::$themes['dark'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function setStyles(array $styles)
- {
- $this->headerIsDumped = false;
- $this->styles = $styles + $this->styles;
- }
-
- public function setTheme(string $themeName)
- {
- if (!isset(static::$themes[$themeName])) {
- throw new \InvalidArgumentException(sprintf('Theme "%s" does not exist in class "%s".', $themeName, static::class));
- }
-
- $this->setStyles(static::$themes[$themeName]);
- }
-
- /**
- * Configures display options.
- *
- * @param array $displayOptions A map of display options to customize the behavior
- */
- public function setDisplayOptions(array $displayOptions)
- {
- $this->headerIsDumped = false;
- $this->displayOptions = $displayOptions + $this->displayOptions;
- }
-
- /**
- * Sets an HTML header that will be dumped once in the output stream.
- *
- * @param string $header An HTML string
- */
- public function setDumpHeader($header)
- {
- $this->dumpHeader = $header;
- }
-
- /**
- * Sets an HTML prefix and suffix that will encapse every single dump.
- *
- * @param string $prefix The prepended HTML string
- * @param string $suffix The appended HTML string
- */
- public function setDumpBoundaries($prefix, $suffix)
- {
- $this->dumpPrefix = $prefix;
- $this->dumpSuffix = $suffix;
- }
-
- /**
- * {@inheritdoc}
- */
- public function dump(Data $data, $output = null, array $extraDisplayOptions = [])
- {
- $this->extraDisplayOptions = $extraDisplayOptions;
- $result = parent::dump($data, $output);
- $this->dumpId = 'sf-dump-'.mt_rand();
-
- return $result;
- }
-
- /**
- * Dumps the HTML header.
- */
- protected function getDumpHeader()
- {
- $this->headerIsDumped = $this->outputStream ?? $this->lineDumper;
-
- if (null !== $this->dumpHeader) {
- return $this->dumpHeader;
- }
-
- $line = str_replace('{$options}', json_encode($this->displayOptions, \JSON_FORCE_OBJECT), <<<'EOHTML'
-'.$this->dumpHeader;
- }
-
- /**
- * {@inheritdoc}
- */
- public function dumpString(Cursor $cursor, $str, $bin, $cut)
- {
- if ('' === $str && isset($cursor->attr['img-data'], $cursor->attr['content-type'])) {
- $this->dumpKey($cursor);
- $this->line .= $this->style('default', $cursor->attr['img-size'] ?? '', []).' ';
- $this->endValue($cursor);
- $this->line .= $this->indentPad;
- $this->line .= sprintf(' ', $cursor->attr['content-type'], base64_encode($cursor->attr['img-data']));
- $this->endValue($cursor);
- } else {
- parent::dumpString($cursor, $str, $bin, $cut);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function enterHash(Cursor $cursor, $type, $class, $hasChild)
- {
- if (Cursor::HASH_OBJECT === $type) {
- $cursor->attr['depth'] = $cursor->depth;
- }
- parent::enterHash($cursor, $type, $class, false);
-
- if ($cursor->skipChildren) {
- $cursor->skipChildren = false;
- $eol = ' class=sf-dump-compact>';
- } elseif ($this->expandNextHash) {
- $this->expandNextHash = false;
- $eol = ' class=sf-dump-expanded>';
- } else {
- $eol = '>';
- }
-
- if ($hasChild) {
- $this->line .= 'refIndex) {
- $r = Cursor::HASH_OBJECT !== $type ? 1 - (Cursor::HASH_RESOURCE !== $type) : 2;
- $r .= $r && 0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->refIndex;
-
- $this->line .= sprintf(' id=%s-ref%s', $this->dumpId, $r);
- }
- $this->line .= $eol;
- $this->dumpLine($cursor->depth);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut)
- {
- $this->dumpEllipsis($cursor, $hasChild, $cut);
- if ($hasChild) {
- $this->line .= ' ';
- }
- parent::leaveHash($cursor, $type, $class, $hasChild, 0);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function style($style, $value, $attr = [])
- {
- if ('' === $value) {
- return '';
- }
-
- $v = esc($value);
-
- if ('ref' === $style) {
- if (empty($attr['count'])) {
- return sprintf('%s ', $v);
- }
- $r = ('#' !== $v[0] ? 1 - ('@' !== $v[0]) : 2).substr($value, 1);
-
- return sprintf('%s ', $this->dumpId, $r, 1 + $attr['count'], $v);
- }
-
- if ('const' === $style && isset($attr['value'])) {
- $style .= sprintf(' title="%s"', esc(\is_scalar($attr['value']) ? $attr['value'] : json_encode($attr['value'])));
- } elseif ('public' === $style) {
- $style .= sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property');
- } elseif ('str' === $style && 1 < $attr['length']) {
- $style .= sprintf(' title="%d%s characters"', $attr['length'], $attr['binary'] ? ' binary or non-UTF-8' : '');
- } elseif ('note' === $style && 0 < ($attr['depth'] ?? 0) && false !== $c = strrpos($value, '\\')) {
- $style .= ' title=""';
- $attr += [
- 'ellipsis' => \strlen($value) - $c,
- 'ellipsis-type' => 'note',
- 'ellipsis-tail' => 1,
- ];
- } elseif ('protected' === $style) {
- $style .= ' title="Protected property"';
- } elseif ('meta' === $style && isset($attr['title'])) {
- $style .= sprintf(' title="%s"', esc($this->utf8Encode($attr['title'])));
- } elseif ('private' === $style) {
- $style .= sprintf(' title="Private property defined in class:
`%s`"', esc($this->utf8Encode($attr['class'])));
- }
- $map = static::$controlCharsMap;
-
- if (isset($attr['ellipsis'])) {
- $class = 'sf-dump-ellipsis';
- if (isset($attr['ellipsis-type'])) {
- $class = sprintf('"%s sf-dump-ellipsis-%s"', $class, $attr['ellipsis-type']);
- }
- $label = esc(substr($value, -$attr['ellipsis']));
- $style = str_replace(' title="', " title=\"$v\n", $style);
- $v = sprintf('%s ', $class, substr($v, 0, -\strlen($label)));
-
- if (!empty($attr['ellipsis-tail'])) {
- $tail = \strlen(esc(substr($value, -$attr['ellipsis'], $attr['ellipsis-tail'])));
- $v .= sprintf('%s %s', $class, substr($label, 0, $tail), substr($label, $tail));
- } else {
- $v .= $label;
- }
- }
-
- $v = "".preg_replace_callback(static::$controlCharsRx, function ($c) use ($map) {
- $s = $b = '';
- }, $v).' ';
-
- if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], $attr['line'] ?? 0)) {
- $attr['href'] = $href;
- }
- if (isset($attr['href'])) {
- $target = isset($attr['file']) ? '' : ' target="_blank"';
- $v = sprintf('%s ', esc($this->utf8Encode($attr['href'])), $target, $v);
- }
- if (isset($attr['lang'])) {
- $v = sprintf('%s
', esc($attr['lang']), $v);
- }
-
- return $v;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function dumpLine($depth, $endOfValue = false)
- {
- if (-1 === $this->lastDepth) {
- $this->line = sprintf($this->dumpPrefix, $this->dumpId, $this->indentPad).$this->line;
- }
- if ($this->headerIsDumped !== ($this->outputStream ?? $this->lineDumper)) {
- $this->line = $this->getDumpHeader().$this->line;
- }
-
- if (-1 === $depth) {
- $args = ['"'.$this->dumpId.'"'];
- if ($this->extraDisplayOptions) {
- $args[] = json_encode($this->extraDisplayOptions, \JSON_FORCE_OBJECT);
- }
- // Replace is for BC
- $this->line .= sprintf(str_replace('"%s"', '%s', $this->dumpSuffix), implode(', ', $args));
- }
- $this->lastDepth = $depth;
-
- $this->line = mb_encode_numericentity($this->line, [0x80, 0x10FFFF, 0, 0x1FFFFF], 'UTF-8');
-
- if (-1 === $depth) {
- AbstractDumper::dumpLine(0);
- }
- AbstractDumper::dumpLine($depth);
- }
-
- private function getSourceLink(string $file, int $line)
- {
- $options = $this->extraDisplayOptions + $this->displayOptions;
-
- if ($fmt = $options['fileLinkFormat']) {
- return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line);
- }
-
- return false;
- }
-}
-
-function esc(string $str)
-{
- return htmlspecialchars($str, \ENT_QUOTES, 'UTF-8');
-}
diff --git a/vendor/symfony/var-dumper/Dumper/ServerDumper.php b/vendor/symfony/var-dumper/Dumper/ServerDumper.php
deleted file mode 100644
index 94795bf..0000000
--- a/vendor/symfony/var-dumper/Dumper/ServerDumper.php
+++ /dev/null
@@ -1,53 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Dumper;
-
-use Symfony\Component\VarDumper\Cloner\Data;
-use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
-use Symfony\Component\VarDumper\Server\Connection;
-
-/**
- * ServerDumper forwards serialized Data clones to a server.
- *
- * @author Maxime Steinhausser
- */
-class ServerDumper implements DataDumperInterface
-{
- private $connection;
- private $wrappedDumper;
-
- /**
- * @param string $host The server host
- * @param DataDumperInterface|null $wrappedDumper A wrapped instance used whenever we failed contacting the server
- * @param ContextProviderInterface[] $contextProviders Context providers indexed by context name
- */
- public function __construct(string $host, DataDumperInterface $wrappedDumper = null, array $contextProviders = [])
- {
- $this->connection = new Connection($host, $contextProviders);
- $this->wrappedDumper = $wrappedDumper;
- }
-
- public function getContextProviders(): array
- {
- return $this->connection->getContextProviders();
- }
-
- /**
- * {@inheritdoc}
- */
- public function dump(Data $data)
- {
- if (!$this->connection->write($data) && $this->wrappedDumper) {
- $this->wrappedDumper->dump($data);
- }
- }
-}
diff --git a/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php b/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php
deleted file mode 100644
index 122f0d3..0000000
--- a/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php
+++ /dev/null
@@ -1,26 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Exception;
-
-/**
- * @author Nicolas Grekas
- */
-class ThrowingCasterException extends \Exception
-{
- /**
- * @param \Throwable $prev The exception thrown from the caster
- */
- public function __construct(\Throwable $prev)
- {
- parent::__construct('Unexpected '.\get_class($prev).' thrown from a caster: '.$prev->getMessage(), 0, $prev);
- }
-}
diff --git a/vendor/symfony/var-dumper/LICENSE b/vendor/symfony/var-dumper/LICENSE
deleted file mode 100644
index a843ec1..0000000
--- a/vendor/symfony/var-dumper/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2014-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.
diff --git a/vendor/symfony/var-dumper/README.md b/vendor/symfony/var-dumper/README.md
deleted file mode 100644
index a0da8c9..0000000
--- a/vendor/symfony/var-dumper/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-VarDumper Component
-===================
-
-The VarDumper component provides mechanisms for walking through any arbitrary
-PHP variable. It provides a better `dump()` function that you can use instead
-of `var_dump()`.
-
-Resources
----------
-
- * [Documentation](https://symfony.com/doc/current/components/var_dumper/introduction.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)
diff --git a/vendor/symfony/var-dumper/Resources/bin/var-dump-server b/vendor/symfony/var-dumper/Resources/bin/var-dump-server
deleted file mode 100644
index f398fce..0000000
--- a/vendor/symfony/var-dumper/Resources/bin/var-dump-server
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env php
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-if ('cli' !== PHP_SAPI) {
- throw new Exception('This script must be run from the command line.');
-}
-
-/**
- * Starts a dump server to collect and output dumps on a single place with multiple formats support.
- *
- * @author Maxime Steinhausser
- */
-
-use Psr\Log\LoggerInterface;
-use Symfony\Component\Console\Application;
-use Symfony\Component\Console\Input\ArgvInput;
-use Symfony\Component\Console\Input\InputOption;
-use Symfony\Component\Console\Logger\ConsoleLogger;
-use Symfony\Component\Console\Output\ConsoleOutput;
-use Symfony\Component\VarDumper\Command\ServerDumpCommand;
-use Symfony\Component\VarDumper\Server\DumpServer;
-
-function includeIfExists(string $file): bool
-{
- return file_exists($file) && include $file;
-}
-
-if (
- !includeIfExists(__DIR__ . '/../../../../autoload.php') &&
- !includeIfExists(__DIR__ . '/../../vendor/autoload.php') &&
- !includeIfExists(__DIR__ . '/../../../../../../vendor/autoload.php')
-) {
- fwrite(STDERR, 'Install dependencies using Composer.'.PHP_EOL);
- exit(1);
-}
-
-if (!class_exists(Application::class)) {
- fwrite(STDERR, 'You need the "symfony/console" component in order to run the VarDumper server.'.PHP_EOL);
- exit(1);
-}
-
-$input = new ArgvInput();
-$output = new ConsoleOutput();
-$defaultHost = '127.0.0.1:9912';
-$host = $input->getParameterOption(['--host'], $_SERVER['VAR_DUMPER_SERVER'] ?? $defaultHost, true);
-$logger = interface_exists(LoggerInterface::class) ? new ConsoleLogger($output->getErrorOutput()) : null;
-
-$app = new Application();
-
-$app->getDefinition()->addOption(
- new InputOption('--host', null, InputOption::VALUE_REQUIRED, 'The address the server should listen to', $defaultHost)
-);
-
-$app->add($command = new ServerDumpCommand(new DumpServer($host, $logger)))
- ->getApplication()
- ->setDefaultCommand($command->getName(), true)
- ->run($input, $output)
-;
diff --git a/vendor/symfony/var-dumper/Resources/css/htmlDescriptor.css b/vendor/symfony/var-dumper/Resources/css/htmlDescriptor.css
deleted file mode 100644
index 8f706d6..0000000
--- a/vendor/symfony/var-dumper/Resources/css/htmlDescriptor.css
+++ /dev/null
@@ -1,130 +0,0 @@
-body {
- display: flex;
- flex-direction: column-reverse;
- justify-content: flex-end;
- max-width: 1140px;
- margin: auto;
- padding: 15px;
- word-wrap: break-word;
- background-color: #F9F9F9;
- color: #222;
- font-family: Helvetica, Arial, sans-serif;
- font-size: 14px;
- line-height: 1.4;
-}
-p {
- margin: 0;
-}
-a {
- color: #218BC3;
- text-decoration: none;
-}
-a:hover {
- text-decoration: underline;
-}
-.text-small {
- font-size: 12px !important;
-}
-article {
- margin: 5px;
- margin-bottom: 10px;
-}
-article > header > .row {
- display: flex;
- flex-direction: row;
- align-items: baseline;
- margin-bottom: 10px;
-}
-article > header > .row > .col {
- flex: 1;
- display: flex;
- align-items: baseline;
-}
-article > header > .row > h2 {
- font-size: 14px;
- color: #222;
- font-weight: normal;
- font-family: "Lucida Console", monospace, sans-serif;
- word-break: break-all;
- margin: 20px 5px 0 0;
- user-select: all;
-}
-article > header > .row > h2 > code {
- white-space: nowrap;
- user-select: none;
- color: #cc2255;
- background-color: #f7f7f9;
- border: 1px solid #e1e1e8;
- border-radius: 3px;
- margin-right: 5px;
- padding: 0 3px;
-}
-article > header > .row > time.col {
- flex: 0;
- text-align: right;
- white-space: nowrap;
- color: #999;
- font-style: italic;
-}
-article > header ul.tags {
- list-style: none;
- padding: 0;
- margin: 0;
- font-size: 12px;
-}
-article > header ul.tags > li {
- user-select: all;
- margin-bottom: 2px;
-}
-article > header ul.tags > li > span.badge {
- display: inline-block;
- padding: .25em .4em;
- margin-right: 5px;
- border-radius: 4px;
- background-color: #6c757d3b;
- color: #524d4d;
- font-size: 12px;
- text-align: center;
- font-weight: 700;
- line-height: 1;
- white-space: nowrap;
- vertical-align: baseline;
- user-select: none;
-}
-article > section.body {
- border: 1px solid #d8d8d8;
- background: #FFF;
- padding: 10px;
- border-radius: 3px;
-}
-pre.sf-dump {
- border-radius: 3px;
- margin-bottom: 0;
-}
-.hidden {
- display: none !important;
-}
-.dumped-tag > .sf-dump {
- display: inline-block;
- margin: 0;
- padding: 1px 5px;
- line-height: 1.4;
- vertical-align: top;
- background-color: transparent;
- user-select: auto;
-}
-.dumped-tag > pre.sf-dump,
-.dumped-tag > .sf-dump-default {
- color: #CC7832;
- background: none;
-}
-.dumped-tag > .sf-dump .sf-dump-str { color: #629755; }
-.dumped-tag > .sf-dump .sf-dump-private,
-.dumped-tag > .sf-dump .sf-dump-protected,
-.dumped-tag > .sf-dump .sf-dump-public { color: #262626; }
-.dumped-tag > .sf-dump .sf-dump-note { color: #6897BB; }
-.dumped-tag > .sf-dump .sf-dump-key { color: #789339; }
-.dumped-tag > .sf-dump .sf-dump-ref { color: #6E6E6E; }
-.dumped-tag > .sf-dump .sf-dump-ellipsis { color: #CC7832; max-width: 100em; }
-.dumped-tag > .sf-dump .sf-dump-ellipsis-path { max-width: 5em; }
-.dumped-tag > .sf-dump .sf-dump-ns { user-select: none; }
diff --git a/vendor/symfony/var-dumper/Resources/functions/dump.php b/vendor/symfony/var-dumper/Resources/functions/dump.php
deleted file mode 100644
index a485d57..0000000
--- a/vendor/symfony/var-dumper/Resources/functions/dump.php
+++ /dev/null
@@ -1,43 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-use Symfony\Component\VarDumper\VarDumper;
-
-if (!function_exists('dump')) {
- /**
- * @author Nicolas Grekas
- */
- function dump($var, ...$moreVars)
- {
- VarDumper::dump($var);
-
- foreach ($moreVars as $v) {
- VarDumper::dump($v);
- }
-
- if (1 < func_num_args()) {
- return func_get_args();
- }
-
- return $var;
- }
-}
-
-if (!function_exists('dd')) {
- function dd(...$vars)
- {
- foreach ($vars as $v) {
- VarDumper::dump($v);
- }
-
- exit(1);
- }
-}
diff --git a/vendor/symfony/var-dumper/Resources/js/htmlDescriptor.js b/vendor/symfony/var-dumper/Resources/js/htmlDescriptor.js
deleted file mode 100644
index 63101e5..0000000
--- a/vendor/symfony/var-dumper/Resources/js/htmlDescriptor.js
+++ /dev/null
@@ -1,10 +0,0 @@
-document.addEventListener('DOMContentLoaded', function() {
- let prev = null;
- Array.from(document.getElementsByTagName('article')).reverse().forEach(function (article) {
- const dedupId = article.dataset.dedupId;
- if (dedupId === prev) {
- article.getElementsByTagName('header')[0].classList.add('hidden');
- }
- prev = dedupId;
- });
-});
diff --git a/vendor/symfony/var-dumper/Server/Connection.php b/vendor/symfony/var-dumper/Server/Connection.php
deleted file mode 100644
index 55d9214..0000000
--- a/vendor/symfony/var-dumper/Server/Connection.php
+++ /dev/null
@@ -1,95 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Server;
-
-use Symfony\Component\VarDumper\Cloner\Data;
-use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
-
-/**
- * Forwards serialized Data clones to a server.
- *
- * @author Maxime Steinhausser
- */
-class Connection
-{
- private $host;
- private $contextProviders;
- private $socket;
-
- /**
- * @param string $host The server host
- * @param ContextProviderInterface[] $contextProviders Context providers indexed by context name
- */
- public function __construct(string $host, array $contextProviders = [])
- {
- if (!str_contains($host, '://')) {
- $host = 'tcp://'.$host;
- }
-
- $this->host = $host;
- $this->contextProviders = $contextProviders;
- }
-
- public function getContextProviders(): array
- {
- return $this->contextProviders;
- }
-
- public function write(Data $data): bool
- {
- $socketIsFresh = !$this->socket;
- if (!$this->socket = $this->socket ?: $this->createSocket()) {
- return false;
- }
-
- $context = ['timestamp' => microtime(true)];
- foreach ($this->contextProviders as $name => $provider) {
- $context[$name] = $provider->getContext();
- }
- $context = array_filter($context);
- $encodedPayload = base64_encode(serialize([$data, $context]))."\n";
-
- set_error_handler([self::class, 'nullErrorHandler']);
- try {
- if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) {
- return true;
- }
- if (!$socketIsFresh) {
- stream_socket_shutdown($this->socket, \STREAM_SHUT_RDWR);
- fclose($this->socket);
- $this->socket = $this->createSocket();
- }
- if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) {
- return true;
- }
- } finally {
- restore_error_handler();
- }
-
- return false;
- }
-
- private static function nullErrorHandler(int $t, string $m)
- {
- // no-op
- }
-
- private function createSocket()
- {
- set_error_handler([self::class, 'nullErrorHandler']);
- try {
- return stream_socket_client($this->host, $errno, $errstr, 3, \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT);
- } finally {
- restore_error_handler();
- }
- }
-}
diff --git a/vendor/symfony/var-dumper/Server/DumpServer.php b/vendor/symfony/var-dumper/Server/DumpServer.php
deleted file mode 100644
index 1c2c348..0000000
--- a/vendor/symfony/var-dumper/Server/DumpServer.php
+++ /dev/null
@@ -1,107 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Server;
-
-use Psr\Log\LoggerInterface;
-use Symfony\Component\VarDumper\Cloner\Data;
-use Symfony\Component\VarDumper\Cloner\Stub;
-
-/**
- * A server collecting Data clones sent by a ServerDumper.
- *
- * @author Maxime Steinhausser
- *
- * @final
- */
-class DumpServer
-{
- private $host;
- private $socket;
- private $logger;
-
- public function __construct(string $host, LoggerInterface $logger = null)
- {
- if (!str_contains($host, '://')) {
- $host = 'tcp://'.$host;
- }
-
- $this->host = $host;
- $this->logger = $logger;
- }
-
- public function start(): void
- {
- if (!$this->socket = stream_socket_server($this->host, $errno, $errstr)) {
- throw new \RuntimeException(sprintf('Server start failed on "%s": ', $this->host).$errstr.' '.$errno);
- }
- }
-
- public function listen(callable $callback): void
- {
- if (null === $this->socket) {
- $this->start();
- }
-
- foreach ($this->getMessages() as $clientId => $message) {
- $payload = @unserialize(base64_decode($message), ['allowed_classes' => [Data::class, Stub::class]]);
-
- // Impossible to decode the message, give up.
- if (false === $payload) {
- if ($this->logger) {
- $this->logger->warning('Unable to decode a message from {clientId} client.', ['clientId' => $clientId]);
- }
-
- continue;
- }
-
- if (!\is_array($payload) || \count($payload) < 2 || !$payload[0] instanceof Data || !\is_array($payload[1])) {
- if ($this->logger) {
- $this->logger->warning('Invalid payload from {clientId} client. Expected an array of two elements (Data $data, array $context)', ['clientId' => $clientId]);
- }
-
- continue;
- }
-
- [$data, $context] = $payload;
-
- $callback($data, $context, $clientId);
- }
- }
-
- public function getHost(): string
- {
- return $this->host;
- }
-
- private function getMessages(): iterable
- {
- $sockets = [(int) $this->socket => $this->socket];
- $write = [];
-
- while (true) {
- $read = $sockets;
- stream_select($read, $write, $write, null);
-
- foreach ($read as $stream) {
- if ($this->socket === $stream) {
- $stream = stream_socket_accept($this->socket);
- $sockets[(int) $stream] = $stream;
- } elseif (feof($stream)) {
- unset($sockets[(int) $stream]);
- fclose($stream);
- } else {
- yield (int) $stream => fgets($stream);
- }
- }
- }
- }
-}
diff --git a/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php b/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php
deleted file mode 100644
index 3d3d18e..0000000
--- a/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php
+++ /dev/null
@@ -1,87 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper\Test;
-
-use Symfony\Component\VarDumper\Cloner\VarCloner;
-use Symfony\Component\VarDumper\Dumper\CliDumper;
-
-/**
- * @author Nicolas Grekas
- */
-trait VarDumperTestTrait
-{
- /**
- * @internal
- */
- private $varDumperConfig = [
- 'casters' => [],
- 'flags' => null,
- ];
-
- protected function setUpVarDumper(array $casters, int $flags = null): void
- {
- $this->varDumperConfig['casters'] = $casters;
- $this->varDumperConfig['flags'] = $flags;
- }
-
- /**
- * @after
- */
- protected function tearDownVarDumper(): void
- {
- $this->varDumperConfig['casters'] = [];
- $this->varDumperConfig['flags'] = null;
- }
-
- public function assertDumpEquals($expected, $data, $filter = 0, $message = '')
- {
- $this->assertSame($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message);
- }
-
- public function assertDumpMatchesFormat($expected, $data, $filter = 0, $message = '')
- {
- $this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message);
- }
-
- /**
- * @return string|null
- */
- protected function getDump($data, $key = null, $filter = 0)
- {
- if (null === $flags = $this->varDumperConfig['flags']) {
- $flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0;
- $flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0;
- $flags |= getenv('DUMP_COMMA_SEPARATOR') ? CliDumper::DUMP_COMMA_SEPARATOR : 0;
- }
-
- $cloner = new VarCloner();
- $cloner->addCasters($this->varDumperConfig['casters']);
- $cloner->setMaxItems(-1);
- $dumper = new CliDumper(null, null, $flags);
- $dumper->setColors(false);
- $data = $cloner->cloneVar($data, $filter)->withRefHandles(false);
- if (null !== $key && null === $data = $data->seek($key)) {
- return null;
- }
-
- return rtrim($dumper->dump($data, true));
- }
-
- private function prepareExpectation($expected, int $filter): string
- {
- if (!\is_string($expected)) {
- $expected = $this->getDump($expected, null, $filter);
- }
-
- return rtrim($expected);
- }
-}
diff --git a/vendor/symfony/var-dumper/VarDumper.php b/vendor/symfony/var-dumper/VarDumper.php
deleted file mode 100644
index febc1e0..0000000
--- a/vendor/symfony/var-dumper/VarDumper.php
+++ /dev/null
@@ -1,66 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\VarDumper;
-
-use Symfony\Component\VarDumper\Caster\ReflectionCaster;
-use Symfony\Component\VarDumper\Cloner\VarCloner;
-use Symfony\Component\VarDumper\Dumper\CliDumper;
-use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider;
-use Symfony\Component\VarDumper\Dumper\ContextualizedDumper;
-use Symfony\Component\VarDumper\Dumper\HtmlDumper;
-
-// Load the global dump() function
-require_once __DIR__.'/Resources/functions/dump.php';
-
-/**
- * @author Nicolas Grekas
- */
-class VarDumper
-{
- private static $handler;
-
- public static function dump($var)
- {
- if (null === self::$handler) {
- $cloner = new VarCloner();
- $cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO);
-
- if (isset($_SERVER['VAR_DUMPER_FORMAT'])) {
- $dumper = 'html' === $_SERVER['VAR_DUMPER_FORMAT'] ? new HtmlDumper() : new CliDumper();
- } else {
- $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper() : new HtmlDumper();
- }
-
- $dumper = new ContextualizedDumper($dumper, [new SourceContextProvider()]);
-
- self::$handler = function ($var) use ($cloner, $dumper) {
- $dumper->dump($cloner->cloneVar($var));
- };
- }
-
- return (self::$handler)($var);
- }
-
- public static function setHandler(callable $callable = null)
- {
- $prevHandler = self::$handler;
-
- // Prevent replacing the handler with expected format as soon as the env var was set:
- if (isset($_SERVER['VAR_DUMPER_FORMAT'])) {
- return $prevHandler;
- }
-
- self::$handler = $callable;
-
- return $prevHandler;
- }
-}
diff --git a/vendor/symfony/var-dumper/composer.json b/vendor/symfony/var-dumper/composer.json
deleted file mode 100644
index d4e64cc..0000000
--- a/vendor/symfony/var-dumper/composer.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "name": "symfony/var-dumper",
- "type": "library",
- "description": "Provides mechanisms for walking through any arbitrary PHP variable",
- "keywords": ["dump", "debug"],
- "homepage": "https://symfony.com",
- "license": "MIT",
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "require": {
- "php": ">=7.1.3",
- "symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php72": "~1.5",
- "symfony/polyfill-php80": "^1.16"
- },
- "require-dev": {
- "ext-iconv": "*",
- "symfony/console": "^3.4|^4.0|^5.0",
- "symfony/process": "^4.4|^5.0",
- "twig/twig": "^1.43|^2.13|^3.0.4"
- },
- "conflict": {
- "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
- "symfony/console": "<3.4"
- },
- "suggest": {
- "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
- "ext-intl": "To show region name in time zone dump",
- "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
- },
- "autoload": {
- "files": [ "Resources/functions/dump.php" ],
- "psr-4": { "Symfony\\Component\\VarDumper\\": "" },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "bin": [
- "Resources/bin/var-dump-server"
- ],
- "minimum-stability": "dev"
-}
diff --git a/vendor/symfony/var-exporter/CHANGELOG.md b/vendor/symfony/var-exporter/CHANGELOG.md
index 3406c30..1b21a0b 100644
--- a/vendor/symfony/var-exporter/CHANGELOG.md
+++ b/vendor/symfony/var-exporter/CHANGELOG.md
@@ -1,6 +1,14 @@
CHANGELOG
=========
+6.2
+---
+
+ * Add support for lazy ghost objects and virtual proxies
+ * Add `Hydrator::hydrate()`
+ * Preserve PHP references also when using `Hydrator::hydrate()` or `Instantiator::instantiate()`
+ * Add support for hydrating from native (array) casts
+
5.1.0
-----
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/vendor/symfony/var-exporter/Exception/LogicException.php
similarity index 65%
rename from vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php
rename to vendor/symfony/var-exporter/Exception/LogicException.php
index 01c6c6c..619d055 100644
--- a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php
+++ b/vendor/symfony/var-exporter/Exception/LogicException.php
@@ -9,8 +9,8 @@
* file that was distributed with this source code.
*/
-if (\PHP_VERSION_ID < 80000) {
- class UnhandledMatchError extends Error
- {
- }
+namespace Symfony\Component\VarExporter\Exception;
+
+class LogicException extends \LogicException implements ExceptionInterface
+{
}
diff --git a/vendor/symfony/var-exporter/Hydrator.php b/vendor/symfony/var-exporter/Hydrator.php
new file mode 100644
index 0000000..5f456fb
--- /dev/null
+++ b/vendor/symfony/var-exporter/Hydrator.php
@@ -0,0 +1,78 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\VarExporter;
+
+use Symfony\Component\VarExporter\Internal\Hydrator as InternalHydrator;
+
+/**
+ * Utility class to hydrate the properties of an object.
+ *
+ * @author Nicolas Grekas
+ */
+final class Hydrator
+{
+ /**
+ * Sets the properties of an object, including private and protected ones.
+ *
+ * For example:
+ *
+ * // Sets the public or protected $object->propertyName property
+ * Hydrator::hydrate($object, ['propertyName' => $propertyValue]);
+ *
+ * // Sets a private property defined on its parent Bar class:
+ * Hydrator::hydrate($object, ["\0Bar\0privateBarProperty" => $propertyValue]);
+ *
+ * // Alternative way to set the private $object->privateBarProperty property
+ * Hydrator::hydrate($object, [], [
+ * Bar::class => ['privateBarProperty' => $propertyValue],
+ * ]);
+ *
+ * Instances of ArrayObject, ArrayIterator and SplObjectStorage can be hydrated
+ * by using the special "\0" property name to define their internal value:
+ *
+ * // Hydrates an SplObjectStorage where $info1 is attached to $obj1, etc.
+ * Hydrator::hydrate($object, ["\0" => [$obj1, $info1, $obj2, $info2...]]);
+ *
+ * // Hydrates an ArrayObject populated with $inputArray
+ * Hydrator::hydrate($object, ["\0" => [$inputArray]]);
+ *
+ * @template T of object
+ *
+ * @param T $instance The object to hydrate
+ * @param array $properties The properties to set on the instance
+ * @param array> $scopedProperties The properties to set on the instance,
+ * keyed by their declaring class
+ *
+ * @return T
+ */
+ public static function hydrate(object $instance, array $properties = [], array $scopedProperties = []): object
+ {
+ if ($properties) {
+ $class = $instance::class;
+ $propertyScopes = InternalHydrator::$propertyScopes[$class] ??= InternalHydrator::getPropertyScopes($class);
+
+ foreach ($properties as $name => &$value) {
+ [$scope, $name, $readonlyScope] = $propertyScopes[$name] ?? [$class, $name, $class];
+ $scopedProperties[$readonlyScope ?? $scope][$name] = &$value;
+ }
+ unset($value);
+ }
+
+ foreach ($scopedProperties as $scope => $properties) {
+ if ($properties) {
+ (InternalHydrator::$simpleHydrators[$scope] ??= InternalHydrator::getSimpleHydrator($scope))($properties, $instance);
+ }
+ }
+
+ return $instance;
+ }
+}
diff --git a/vendor/symfony/var-exporter/Instantiator.php b/vendor/symfony/var-exporter/Instantiator.php
index 368c769..10200c0 100644
--- a/vendor/symfony/var-exporter/Instantiator.php
+++ b/vendor/symfony/var-exporter/Instantiator.php
@@ -13,7 +13,6 @@ namespace Symfony\Component\VarExporter;
use Symfony\Component\VarExporter\Exception\ExceptionInterface;
use Symfony\Component\VarExporter\Exception\NotInstantiableTypeException;
-use Symfony\Component\VarExporter\Internal\Hydrator;
use Symfony\Component\VarExporter\Internal\Registry;
/**
@@ -26,67 +25,35 @@ final class Instantiator
/**
* Creates an object and sets its properties without calling its constructor nor any other methods.
*
- * For example:
+ * @see Hydrator::hydrate() for examples
*
- * // creates an empty instance of Foo
- * Instantiator::instantiate(Foo::class);
+ * @template T of object
*
- * // creates a Foo instance and sets one of its properties
- * Instantiator::instantiate(Foo::class, ['propertyName' => $propertyValue]);
+ * @param class-string $class The class of the instance to create
+ * @param array $properties The properties to set on the instance
+ * @param array> $scopedProperties The properties to set on the instance,
+ * keyed by their declaring class
*
- * // creates a Foo instance and sets a private property defined on its parent Bar class
- * Instantiator::instantiate(Foo::class, [], [
- * Bar::class => ['privateBarProperty' => $propertyValue],
- * ]);
- *
- * Instances of ArrayObject, ArrayIterator and SplObjectStorage can be created
- * by using the special "\0" property name to define their internal value:
- *
- * // creates an SplObjectStorage where $info1 is attached to $obj1, etc.
- * Instantiator::instantiate(SplObjectStorage::class, ["\0" => [$obj1, $info1, $obj2, $info2...]]);
- *
- * // creates an ArrayObject populated with $inputArray
- * Instantiator::instantiate(ArrayObject::class, ["\0" => [$inputArray]]);
- *
- * @param string $class The class of the instance to create
- * @param array $properties The properties to set on the instance
- * @param array $privateProperties The private properties to set on the instance,
- * keyed by their declaring class
+ * @return T
*
* @throws ExceptionInterface When the instance cannot be created
*/
- public static function instantiate(string $class, array $properties = [], array $privateProperties = []): object
+ public static function instantiate(string $class, array $properties = [], array $scopedProperties = []): object
{
- $reflector = Registry::$reflectors[$class] ?? Registry::getClassReflector($class);
+ $reflector = Registry::$reflectors[$class] ??= Registry::getClassReflector($class);
if (Registry::$cloneable[$class]) {
- $wrappedInstance = [clone Registry::$prototypes[$class]];
+ $instance = clone Registry::$prototypes[$class];
} elseif (Registry::$instantiableWithoutConstructor[$class]) {
- $wrappedInstance = [$reflector->newInstanceWithoutConstructor()];
+ $instance = $reflector->newInstanceWithoutConstructor();
} elseif (null === Registry::$prototypes[$class]) {
throw new NotInstantiableTypeException($class);
- } elseif ($reflector->implementsInterface('Serializable') && (\PHP_VERSION_ID < 70400 || !method_exists($class, '__unserialize'))) {
- $wrappedInstance = [unserialize('C:'.\strlen($class).':"'.$class.'":0:{}')];
+ } elseif ($reflector->implementsInterface('Serializable') && !method_exists($class, '__unserialize')) {
+ $instance = unserialize('C:'.\strlen($class).':"'.$class.'":0:{}');
} else {
- $wrappedInstance = [unserialize('O:'.\strlen($class).':"'.$class.'":0:{}')];
+ $instance = unserialize('O:'.\strlen($class).':"'.$class.'":0:{}');
}
- if ($properties) {
- $privateProperties[$class] = isset($privateProperties[$class]) ? $properties + $privateProperties[$class] : $properties;
- }
-
- foreach ($privateProperties as $class => $properties) {
- if (!$properties) {
- continue;
- }
- foreach ($properties as $name => $value) {
- // because they're also used for "unserialization", hydrators
- // deal with array of instances, so we need to wrap values
- $properties[$name] = [$value];
- }
- (Hydrator::$hydrators[$class] ?? Hydrator::getHydrator($class))($properties, $wrappedInstance);
- }
-
- return $wrappedInstance[0];
+ return $properties || $scopedProperties ? Hydrator::hydrate($instance, $properties, $scopedProperties) : $instance;
}
}
diff --git a/vendor/symfony/var-exporter/Internal/Exporter.php b/vendor/symfony/var-exporter/Internal/Exporter.php
index 6ee3ee7..e7ee44b 100644
--- a/vendor/symfony/var-exporter/Internal/Exporter.php
+++ b/vendor/symfony/var-exporter/Internal/Exporter.php
@@ -31,9 +31,11 @@ class Exporter
* @param int &$objectsCount
* @param bool &$valuesAreStatic
*
+ * @return array
+ *
* @throws NotInstantiableTypeException When a value cannot be serialized
*/
- public static function prepare($values, $objectsPool, &$refsPool, &$objectsCount, &$valuesAreStatic): array
+ public static function prepare($values, $objectsPool, &$refsPool, &$objectsCount, &$valuesAreStatic)
{
$refs = $values;
foreach ($values as $k => $value) {
@@ -71,22 +73,31 @@ class Exporter
goto handle_value;
}
- $class = \get_class($value);
- $reflector = Registry::$reflectors[$class] ?? Registry::getClassReflector($class);
+ $class = $value::class;
+ $reflector = Registry::$reflectors[$class] ??= Registry::getClassReflector($class);
+ $properties = [];
if ($reflector->hasMethod('__serialize')) {
if (!$reflector->getMethod('__serialize')->isPublic()) {
throw new \Error(sprintf('Call to %s method "%s::__serialize()".', $reflector->getMethod('__serialize')->isProtected() ? 'protected' : 'private', $class));
}
- if (!\is_array($properties = $value->__serialize())) {
+ if (!\is_array($serializeProperties = $value->__serialize())) {
throw new \TypeError($class.'::__serialize() must return an array');
}
+ if ($reflector->hasMethod('__unserialize')) {
+ $properties = $serializeProperties;
+ } else {
+ foreach ($serializeProperties as $n => $v) {
+ $c = \PHP_VERSION_ID >= 80100 && $reflector->hasProperty($n) && ($p = $reflector->getProperty($n))->isReadOnly() ? $p->class : 'stdClass';
+ $properties[$c][$n] = $v;
+ }
+ }
+
goto prepare_value;
}
- $properties = [];
$sleep = null;
$proto = Registry::$prototypes[$class];
@@ -133,7 +144,7 @@ class Exporter
$i = 0;
$n = (string) $name;
if ('' === $n || "\0" !== $n[0]) {
- $c = \PHP_VERSION_ID >= 80100 && $reflector->hasProperty($n) && ($p = $reflector->getProperty($n))->isReadOnly() ? $p->class : 'stdClass';
+ $c = $reflector->hasProperty($n) && ($p = $reflector->getProperty($n))->isReadOnly() ? $p->class : 'stdClass';
} elseif ('*' === $n[1]) {
$n = substr($n, 3);
$c = $reflector->getProperty($n)->class;
@@ -189,7 +200,7 @@ class Exporter
return $values;
}
- public static function export($value, string $indent = '')
+ public static function export($value, $indent = '')
{
switch (true) {
case \is_int($value) || \is_float($value): return var_export($value, true);
@@ -228,7 +239,7 @@ class Exporter
return substr($m[1], 0, -2);
}
- if ('n".\'' === substr($m[1], -4)) {
+ if (str_ends_with($m[1], 'n".\'')) {
return substr_replace($m[1], "\n".$subIndent.".'".$m[2], -2);
}
@@ -366,7 +377,7 @@ class Exporter
self::export($value->wakeups, $subIndent),
];
- return '\\'.\get_class($value)."::hydrate(\n".$subIndent.implode(",\n".$subIndent, $code)."\n".$indent.')';
+ return '\\'.$value::class."::hydrate(\n".$subIndent.implode(",\n".$subIndent, $code)."\n".$indent.')';
}
/**
@@ -376,7 +387,7 @@ class Exporter
private static function getArrayObjectProperties($value, $proto): array
{
$reflector = $value instanceof \ArrayIterator ? 'ArrayIterator' : 'ArrayObject';
- $reflector = Registry::$reflectors[$reflector] ?? Registry::getClassReflector($reflector);
+ $reflector = Registry::$reflectors[$reflector] ??= Registry::getClassReflector($reflector);
$properties = [
$arrayValue = (array) $value,
diff --git a/vendor/symfony/var-exporter/Internal/Hydrator.php b/vendor/symfony/var-exporter/Internal/Hydrator.php
index 5ed6bdc..f665f6e 100644
--- a/vendor/symfony/var-exporter/Internal/Hydrator.php
+++ b/vendor/symfony/var-exporter/Internal/Hydrator.php
@@ -21,6 +21,8 @@ use Symfony\Component\VarExporter\Exception\ClassNotFoundException;
class Hydrator
{
public static $hydrators = [];
+ public static $simpleHydrators = [];
+ public static $propertyScopes = [];
public $registry;
public $values;
@@ -40,7 +42,7 @@ class Hydrator
public static function hydrate($objects, $values, $properties, $value, $wakeups)
{
foreach ($properties as $class => $vars) {
- (self::$hydrators[$class] ?? self::getHydrator($class))($vars, $objects);
+ (self::$hydrators[$class] ??= self::getHydrator($class))($vars, $objects);
}
foreach ($wakeups as $k => $v) {
if (\is_array($v)) {
@@ -55,26 +57,28 @@ class Hydrator
public static function getHydrator($class)
{
+ $baseHydrator = self::$hydrators['stdClass'] ??= static function ($properties, $objects) {
+ foreach ($properties as $name => $values) {
+ foreach ($values as $i => $v) {
+ $objects[$i]->$name = $v;
+ }
+ }
+ };
+
switch ($class) {
case 'stdClass':
- return self::$hydrators[$class] = static function ($properties, $objects) {
- foreach ($properties as $name => $values) {
- foreach ($values as $i => $v) {
- $objects[$i]->$name = $v;
- }
- }
- };
+ return $baseHydrator;
case 'ErrorException':
- return self::$hydrators[$class] = (self::$hydrators['stdClass'] ?? self::getHydrator('stdClass'))->bindTo(null, new class() extends \ErrorException {
+ return $baseHydrator->bindTo(null, new class() extends \ErrorException {
});
case 'TypeError':
- return self::$hydrators[$class] = (self::$hydrators['stdClass'] ?? self::getHydrator('stdClass'))->bindTo(null, new class() extends \Error {
+ return $baseHydrator->bindTo(null, new class() extends \Error {
});
case 'SplObjectStorage':
- return self::$hydrators[$class] = static function ($properties, $objects) {
+ return static function ($properties, $objects) {
foreach ($properties as $name => $values) {
if ("\0" === $name) {
foreach ($values as $i => $v) {
@@ -99,9 +103,9 @@ class Hydrator
switch ($class) {
case 'ArrayIterator':
case 'ArrayObject':
- $constructor = \Closure::fromCallable([$classReflector->getConstructor(), 'invokeArgs']);
+ $constructor = $classReflector->getConstructor()->invokeArgs(...);
- return self::$hydrators[$class] = static function ($properties, $objects) use ($constructor) {
+ return static function ($properties, $objects) use ($constructor) {
foreach ($properties as $name => $values) {
if ("\0" !== $name) {
foreach ($values as $i => $v) {
@@ -116,26 +120,25 @@ class Hydrator
}
if (!$classReflector->isInternal()) {
- return self::$hydrators[$class] = (self::$hydrators['stdClass'] ?? self::getHydrator('stdClass'))->bindTo(null, $class);
+ return $baseHydrator->bindTo(null, $class);
}
if ($classReflector->name !== $class) {
- return self::$hydrators[$classReflector->name] ?? self::getHydrator($classReflector->name);
+ return self::$hydrators[$classReflector->name] ??= self::getHydrator($classReflector->name);
}
$propertySetters = [];
foreach ($classReflector->getProperties() as $propertyReflector) {
if (!$propertyReflector->isStatic()) {
- $propertyReflector->setAccessible(true);
- $propertySetters[$propertyReflector->name] = \Closure::fromCallable([$propertyReflector, 'setValue']);
+ $propertySetters[$propertyReflector->name] = $propertyReflector->setValue(...);
}
}
if (!$propertySetters) {
- return self::$hydrators[$class] = self::$hydrators['stdClass'] ?? self::getHydrator('stdClass');
+ return $baseHydrator;
}
- return self::$hydrators[$class] = static function ($properties, $objects) use ($propertySetters) {
+ return static function ($properties, $objects) use ($propertySetters) {
foreach ($properties as $name => $values) {
if ($setValue = $propertySetters[$name] ?? null) {
foreach ($values as $i => $v) {
@@ -149,4 +152,148 @@ class Hydrator
}
};
}
+
+ public static function getSimpleHydrator($class)
+ {
+ $baseHydrator = self::$simpleHydrators['stdClass'] ??= (function ($properties, $object) {
+ $readonly = (array) $this;
+
+ foreach ($properties as $name => &$value) {
+ $object->$name = $value;
+
+ if (!($readonly[$name] ?? false)) {
+ $object->$name = &$value;
+ }
+ }
+ })->bindTo(new \stdClass());
+
+ switch ($class) {
+ case 'stdClass':
+ return $baseHydrator;
+
+ case 'ErrorException':
+ return $baseHydrator->bindTo(new \stdClass(), new class() extends \ErrorException {
+ });
+
+ case 'TypeError':
+ return $baseHydrator->bindTo(new \stdClass(), new class() extends \Error {
+ });
+
+ case 'SplObjectStorage':
+ return static function ($properties, $object) {
+ foreach ($properties as $name => &$value) {
+ if ("\0" !== $name) {
+ $object->$name = $value;
+ $object->$name = &$value;
+ continue;
+ }
+ for ($i = 0; $i < \count($value); ++$i) {
+ $object->attach($value[$i], $value[++$i]);
+ }
+ }
+ };
+ }
+
+ if (!class_exists($class) && !interface_exists($class, false) && !trait_exists($class, false)) {
+ throw new ClassNotFoundException($class);
+ }
+ $classReflector = new \ReflectionClass($class);
+
+ switch ($class) {
+ case 'ArrayIterator':
+ case 'ArrayObject':
+ $constructor = $classReflector->getConstructor()->invokeArgs(...);
+
+ return static function ($properties, $object) use ($constructor) {
+ foreach ($properties as $name => &$value) {
+ if ("\0" === $name) {
+ $constructor($object, $value);
+ } else {
+ $object->$name = $value;
+ $object->$name = &$value;
+ }
+ }
+ };
+ }
+
+ if (!$classReflector->isInternal()) {
+ $readonly = new \stdClass();
+ foreach ($classReflector->getProperties(\ReflectionProperty::IS_READONLY) as $propertyReflector) {
+ if ($class === $propertyReflector->class) {
+ $readonly->{$propertyReflector->name} = true;
+ }
+ }
+
+ return $baseHydrator->bindTo($readonly, $class);
+ }
+
+ if ($classReflector->name !== $class) {
+ return self::$simpleHydrators[$classReflector->name] ??= self::getSimpleHydrator($classReflector->name);
+ }
+
+ $propertySetters = [];
+ foreach ($classReflector->getProperties() as $propertyReflector) {
+ if (!$propertyReflector->isStatic()) {
+ $propertySetters[$propertyReflector->name] = $propertyReflector->setValue(...);
+ }
+ }
+
+ if (!$propertySetters) {
+ return $baseHydrator;
+ }
+
+ return static function ($properties, $object) use ($propertySetters) {
+ foreach ($properties as $name => &$value) {
+ if ($setValue = $propertySetters[$name] ?? null) {
+ $setValue($object, $value);
+ } else {
+ $object->$name = $value;
+ $object->$name = &$value;
+ }
+ }
+ };
+ }
+
+ /**
+ * @return array
+ */
+ public static function getPropertyScopes($class)
+ {
+ $propertyScopes = [];
+ $r = new \ReflectionClass($class);
+
+ foreach ($r->getProperties() as $property) {
+ $flags = $property->getModifiers();
+
+ if (\ReflectionProperty::IS_STATIC & $flags) {
+ continue;
+ }
+ $name = $property->name;
+
+ if (\ReflectionProperty::IS_PRIVATE & $flags) {
+ $propertyScopes["\0$class\0$name"] = $propertyScopes[$name] = [$class, $name, $flags & \ReflectionProperty::IS_READONLY ? $class : null];
+ continue;
+ }
+ $propertyScopes[$name] = [$class, $name, $flags & \ReflectionProperty::IS_READONLY ? $property->class : null];
+
+ if (\ReflectionProperty::IS_PROTECTED & $flags) {
+ $propertyScopes["\0*\0$name"] = $propertyScopes[$name];
+ }
+ }
+
+ while ($r = $r->getParentClass()) {
+ $class = $r->name;
+
+ foreach ($r->getProperties(\ReflectionProperty::IS_PRIVATE) as $property) {
+ if (!$property->isStatic()) {
+ $name = $property->name;
+ $readonlyScope = $property->isReadOnly() ? $class : null;
+ $propertyScopes["\0$class\0$name"] = [$class, $name, $readonlyScope];
+ $propertyScopes[$name] ??= [$class, $name, $readonlyScope];
+ }
+ }
+ }
+
+ return $propertyScopes;
+ }
}
diff --git a/vendor/symfony/var-exporter/Internal/LazyObjectRegistry.php b/vendor/symfony/var-exporter/Internal/LazyObjectRegistry.php
new file mode 100644
index 0000000..d9d9925
--- /dev/null
+++ b/vendor/symfony/var-exporter/Internal/LazyObjectRegistry.php
@@ -0,0 +1,146 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\VarExporter\Internal;
+
+/**
+ * Stores the state of lazy objects and caches related reflection information.
+ *
+ * As a micro-optimization, this class uses no type declarations.
+ *
+ * @internal
+ */
+class LazyObjectRegistry
+{
+ /**
+ * @var array
+ */
+ public static $classReflectors = [];
+
+ /**
+ * @var array>
+ */
+ public static $defaultProperties = [];
+
+ /**
+ * @var array>
+ */
+ public static $classResetters = [];
+
+ /**
+ * @var array
+ */
+ public static $classAccessors = [];
+
+ /**
+ * @var array
+ */
+ public static $parentMethods = [];
+
+ public static ?\Closure $noInitializerState = null;
+
+ public static function getClassResetters($class)
+ {
+ $classProperties = [];
+
+ if ((self::$classReflectors[$class] ??= new \ReflectionClass($class))->isInternal()) {
+ $propertyScopes = [];
+ } else {
+ $propertyScopes = Hydrator::$propertyScopes[$class] ??= Hydrator::getPropertyScopes($class);
+ }
+
+ foreach ($propertyScopes as $key => [$scope, $name, $readonlyScope]) {
+ $propertyScopes[$k = "\0$scope\0$name"] ?? $propertyScopes[$k = "\0*\0$name"] ?? $k = $name;
+
+ if ($k === $key && "\0$class\0lazyObjectState" !== $k) {
+ $classProperties[$readonlyScope ?? $scope][$name] = $key;
+ }
+ }
+
+ $resetters = [];
+ foreach ($classProperties as $scope => $properties) {
+ $resetters[] = \Closure::bind(static function ($instance, $skippedProperties, $onlyProperties = null) use ($properties) {
+ foreach ($properties as $name => $key) {
+ if (!\array_key_exists($key, $skippedProperties) && (null === $onlyProperties || \array_key_exists($key, $onlyProperties))) {
+ unset($instance->$name);
+ }
+ }
+ }, null, $scope);
+ }
+
+ $resetters[] = static function ($instance, $skippedProperties, $onlyProperties = null) {
+ foreach ((array) $instance as $name => $value) {
+ if ("\0" !== ($name[0] ?? '') && !\array_key_exists($name, $skippedProperties) && (null === $onlyProperties || \array_key_exists($name, $onlyProperties))) {
+ unset($instance->$name);
+ }
+ }
+ };
+
+ return $resetters;
+ }
+
+ public static function getClassAccessors($class)
+ {
+ return \Closure::bind(static fn () => [
+ 'get' => static function &($instance, $name, $readonly) {
+ if (!$readonly) {
+ return $instance->$name;
+ }
+ $value = $instance->$name;
+
+ return $value;
+ },
+ 'set' => static function ($instance, $name, $value) {
+ $instance->$name = $value;
+ },
+ 'isset' => static fn ($instance, $name) => isset($instance->$name),
+ 'unset' => static function ($instance, $name) {
+ unset($instance->$name);
+ },
+ ], null, \Closure::class === $class ? null : $class)();
+ }
+
+ public static function getParentMethods($class)
+ {
+ $parent = get_parent_class($class);
+ $methods = [];
+
+ foreach (['set', 'isset', 'unset', 'clone', 'serialize', 'unserialize', 'sleep', 'wakeup', 'destruct', 'get'] as $method) {
+ if (!$parent || !method_exists($parent, '__'.$method)) {
+ $methods[$method] = false;
+ } else {
+ $m = new \ReflectionMethod($parent, '__'.$method);
+ $methods[$method] = !$m->isAbstract() && !$m->isPrivate();
+ }
+ }
+
+ $methods['get'] = $methods['get'] ? ($m->returnsReference() ? 2 : 1) : 0;
+
+ return $methods;
+ }
+
+ public static function getScope($propertyScopes, $class, $property, $readonlyScope = null)
+ {
+ if (null === $readonlyScope && !isset($propertyScopes[$k = "\0$class\0$property"]) && !isset($propertyScopes[$k = "\0*\0$property"])) {
+ return null;
+ }
+ $frame = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2];
+
+ if (\ReflectionProperty::class === $scope = $frame['class'] ?? \Closure::class) {
+ $scope = $frame['object']->class;
+ }
+ if (null === $readonlyScope && '*' === $k[1] && ($class === $scope || (is_subclass_of($class, $scope) && !isset($propertyScopes["\0$scope\0$property"])))) {
+ return null;
+ }
+
+ return $scope;
+ }
+}
diff --git a/vendor/symfony/var-exporter/Internal/LazyObjectState.php b/vendor/symfony/var-exporter/Internal/LazyObjectState.php
new file mode 100644
index 0000000..2f649dd
--- /dev/null
+++ b/vendor/symfony/var-exporter/Internal/LazyObjectState.php
@@ -0,0 +1,130 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\VarExporter\Internal;
+
+use Symfony\Component\VarExporter\Hydrator as PublicHydrator;
+
+/**
+ * Keeps the state of lazy objects.
+ *
+ * As a micro-optimization, this class uses no type declarations.
+ *
+ * @internal
+ */
+class LazyObjectState
+{
+ public const STATUS_UNINITIALIZED_FULL = 1;
+ public const STATUS_UNINITIALIZED_PARTIAL = 2;
+ public const STATUS_INITIALIZED_FULL = 3;
+ public const STATUS_INITIALIZED_PARTIAL = 4;
+
+ /**
+ * @var array
+ */
+ public readonly array $skippedProperties;
+
+ /**
+ * @var self::STATUS_*
+ */
+ public int $status = 0;
+
+ public object $realInstance;
+
+ public function __construct(public readonly \Closure|array $initializer, $skippedProperties = [])
+ {
+ $this->skippedProperties = $skippedProperties;
+ $this->status = \is_array($initializer) ? self::STATUS_UNINITIALIZED_PARTIAL : self::STATUS_UNINITIALIZED_FULL;
+ }
+
+ public function initialize($instance, $propertyName, $propertyScope)
+ {
+ if (self::STATUS_INITIALIZED_FULL === $this->status) {
+ return self::STATUS_INITIALIZED_FULL;
+ }
+
+ if (\is_array($this->initializer)) {
+ $class = $instance::class;
+ $propertyScope ??= $class;
+ $propertyScopes = Hydrator::$propertyScopes[$class];
+ $propertyScopes[$k = "\0$propertyScope\0$propertyName"] ?? $propertyScopes[$k = "\0*\0$propertyName"] ?? $k = $propertyName;
+
+ if ($initializer = $this->initializer[$k] ?? null) {
+ $value = $initializer(...[$instance, $propertyName, $propertyScope, LazyObjectRegistry::$defaultProperties[$class][$k] ?? null]);
+ $accessor = LazyObjectRegistry::$classAccessors[$propertyScope] ??= LazyObjectRegistry::getClassAccessors($propertyScope);
+ $accessor['set']($instance, $propertyName, $value);
+
+ return $this->status = self::STATUS_INITIALIZED_PARTIAL;
+ }
+
+ $status = self::STATUS_UNINITIALIZED_PARTIAL;
+
+ if ($initializer = $this->initializer["\0"] ?? null) {
+ if (!\is_array($values = $initializer($instance, LazyObjectRegistry::$defaultProperties[$class]))) {
+ throw new \TypeError(sprintf('The lazy-initializer defined for instance of "%s" must return an array, got "%s".', $class, get_debug_type($values)));
+ }
+ $properties = (array) $instance;
+ foreach ($values as $key => $value) {
+ if ($k === $key) {
+ $status = self::STATUS_INITIALIZED_PARTIAL;
+ }
+ if (!\array_key_exists($key, $properties) && [$scope, $name, $readonlyScope] = $propertyScopes[$key] ?? null) {
+ $scope = $readonlyScope ?? ('*' !== $scope ? $scope : $class);
+ $accessor = LazyObjectRegistry::$classAccessors[$scope] ??= LazyObjectRegistry::getClassAccessors($scope);
+ $accessor['set']($instance, $name, $value);
+ }
+ }
+ }
+
+ return $status;
+ }
+
+ $this->status = self::STATUS_INITIALIZED_FULL;
+
+ try {
+ if ($defaultProperties = array_diff_key(LazyObjectRegistry::$defaultProperties[$instance::class], $this->skippedProperties)) {
+ PublicHydrator::hydrate($instance, $defaultProperties);
+ }
+
+ ($this->initializer)($instance);
+ } catch (\Throwable $e) {
+ $this->status = self::STATUS_UNINITIALIZED_FULL;
+ $this->reset($instance);
+
+ throw $e;
+ }
+
+ return self::STATUS_INITIALIZED_FULL;
+ }
+
+ public function reset($instance): void
+ {
+ $class = $instance::class;
+ $propertyScopes = Hydrator::$propertyScopes[$class] ??= Hydrator::getPropertyScopes($class);
+ $skippedProperties = $this->skippedProperties;
+ $properties = (array) $instance;
+ $onlyProperties = \is_array($this->initializer) ? $this->initializer : null;
+
+ foreach ($propertyScopes as $key => [$scope, $name, $readonlyScope]) {
+ $propertyScopes[$k = "\0$scope\0$name"] ?? $propertyScopes[$k = "\0*\0$name"] ?? $k = $name;
+
+ if ($k === $key && (null !== $readonlyScope || !\array_key_exists($k, $properties))) {
+ $skippedProperties[$k] = true;
+ }
+ }
+
+ foreach (LazyObjectRegistry::$classResetters[$class] as $reset) {
+ $reset($instance, $skippedProperties, $onlyProperties);
+ }
+
+ $this->status = self::STATUS_INITIALIZED_FULL === $this->status ? self::STATUS_UNINITIALIZED_FULL : self::STATUS_UNINITIALIZED_PARTIAL;
+ }
+}
diff --git a/vendor/symfony/var-exporter/Internal/LazyObjectTrait.php b/vendor/symfony/var-exporter/Internal/LazyObjectTrait.php
new file mode 100644
index 0000000..cccdf6c
--- /dev/null
+++ b/vendor/symfony/var-exporter/Internal/LazyObjectTrait.php
@@ -0,0 +1,30 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\VarExporter\Internal;
+
+if (\PHP_VERSION_ID >= 80300) {
+ /**
+ * @internal
+ */
+ trait LazyObjectTrait
+ {
+ private readonly LazyObjectState $lazyObjectState;
+ }
+} else {
+ /**
+ * @internal
+ */
+ trait LazyObjectTrait
+ {
+ private LazyObjectState $lazyObjectState;
+ }
+}
diff --git a/vendor/symfony/var-exporter/Internal/Registry.php b/vendor/symfony/var-exporter/Internal/Registry.php
index 24b77b9..09d2de2 100644
--- a/vendor/symfony/var-exporter/Internal/Registry.php
+++ b/vendor/symfony/var-exporter/Internal/Registry.php
@@ -58,9 +58,9 @@ class Registry
public static function f($class)
{
- $reflector = self::$reflectors[$class] ?? self::getClassReflector($class, true, false);
+ $reflector = self::$reflectors[$class] ??= self::getClassReflector($class, true, false);
- return self::$factories[$class] = \Closure::fromCallable([$reflector, 'newInstanceWithoutConstructor']);
+ return self::$factories[$class] = [$reflector, 'newInstanceWithoutConstructor'](...);
}
public static function getClassReflector($class, $instantiableWithoutConstructor = false, $cloneable = null)
@@ -75,17 +75,17 @@ class Registry
} elseif (!$isClass || $reflector->isAbstract()) {
throw new NotInstantiableTypeException($class);
} elseif ($reflector->name !== $class) {
- $reflector = self::$reflectors[$name = $reflector->name] ?? self::getClassReflector($name, false, $cloneable);
+ $reflector = self::$reflectors[$name = $reflector->name] ??= self::getClassReflector($name, false, $cloneable);
self::$cloneable[$class] = self::$cloneable[$name];
self::$instantiableWithoutConstructor[$class] = self::$instantiableWithoutConstructor[$name];
self::$prototypes[$class] = self::$prototypes[$name];
- return self::$reflectors[$class] = $reflector;
+ return $reflector;
} else {
try {
$proto = $reflector->newInstanceWithoutConstructor();
$instantiableWithoutConstructor = true;
- } catch (\ReflectionException $e) {
+ } catch (\ReflectionException) {
$proto = $reflector->implementsInterface('Serializable') && !method_exists($class, '__unserialize') ? 'C:' : 'O:';
if ('C:' === $proto && !$reflector->getMethod('unserialize')->isInternal()) {
$proto = null;
@@ -103,7 +103,7 @@ class Registry
}
}
}
- if (null !== $proto && !$proto instanceof \Throwable && !$proto instanceof \Serializable && !method_exists($class, '__sleep') && (\PHP_VERSION_ID < 70400 || !method_exists($class, '__serialize'))) {
+ if (null !== $proto && !$proto instanceof \Throwable && !$proto instanceof \Serializable && !method_exists($class, '__sleep') && !method_exists($class, '__serialize')) {
try {
serialize($proto);
} catch (\Exception $e) {
@@ -113,7 +113,7 @@ class Registry
}
if (null === $cloneable) {
- if (($proto instanceof \Reflector || $proto instanceof \ReflectionGenerator || $proto instanceof \ReflectionType || $proto instanceof \IteratorIterator || $proto instanceof \RecursiveIteratorIterator) && (!$proto instanceof \Serializable && !method_exists($proto, '__wakeup') && (\PHP_VERSION_ID < 70400 || !method_exists($class, '__unserialize')))) {
+ if (($proto instanceof \Reflector || $proto instanceof \ReflectionGenerator || $proto instanceof \ReflectionType || $proto instanceof \IteratorIterator || $proto instanceof \RecursiveIteratorIterator) && (!$proto instanceof \Serializable && !method_exists($proto, '__wakeup') && !method_exists($class, '__unserialize'))) {
throw new NotInstantiableTypeException($class);
}
@@ -132,15 +132,13 @@ class Registry
new \ReflectionProperty(\Error::class, 'trace'),
new \ReflectionProperty(\Exception::class, 'trace'),
];
- $setTrace[0]->setAccessible(true);
- $setTrace[1]->setAccessible(true);
- $setTrace[0] = \Closure::fromCallable([$setTrace[0], 'setValue']);
- $setTrace[1] = \Closure::fromCallable([$setTrace[1], 'setValue']);
+ $setTrace[0] = $setTrace[0]->setValue(...);
+ $setTrace[1] = $setTrace[1]->setValue(...);
}
$setTrace[$proto instanceof \Exception]($proto, []);
}
- return self::$reflectors[$class] = $reflector;
+ return $reflector;
}
}
diff --git a/vendor/symfony/var-exporter/LazyGhostTrait.php b/vendor/symfony/var-exporter/LazyGhostTrait.php
new file mode 100644
index 0000000..13e33f5
--- /dev/null
+++ b/vendor/symfony/var-exporter/LazyGhostTrait.php
@@ -0,0 +1,391 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\VarExporter;
+
+use Symfony\Component\VarExporter\Internal\Hydrator;
+use Symfony\Component\VarExporter\Internal\LazyObjectRegistry as Registry;
+use Symfony\Component\VarExporter\Internal\LazyObjectState;
+use Symfony\Component\VarExporter\Internal\LazyObjectTrait;
+
+trait LazyGhostTrait
+{
+ use LazyObjectTrait;
+
+ /**
+ * Creates a lazy-loading ghost instance.
+ *
+ * When the initializer is a closure, it should initialize all properties at
+ * once and is given the instance to initialize as argument.
+ *
+ * When the initializer is an array of closures, it should be indexed by
+ * properties and closures should accept 4 arguments: the instance to
+ * initialize, the property to initialize, its write-scope, and its default
+ * value. Each closure should return the value of the corresponding property.
+ * The special "\0" key can be used to define a closure that returns all
+ * properties at once when full-initialization is needed; it takes the
+ * instance and its default properties as arguments.
+ *
+ * Properties should be indexed by their array-cast name, see
+ * https://php.net/manual/language.types.array#language.types.array.casting
+ *
+ * @param (\Closure(static):void
+ * |array
+ * |array{"\0": \Closure(static, array):array}) $initializer
+ * @param array|null $skippedProperties An array indexed by the properties to skip, aka the ones
+ * that the initializer doesn't set when its a closure
+ * @param static|null $instance
+ */
+ public static function createLazyGhost(\Closure|array $initializer, array $skippedProperties = null, object $instance = null): static
+ {
+ $onlyProperties = null === $skippedProperties && \is_array($initializer) ? $initializer : null;
+
+ if (self::class !== $class = $instance ? $instance::class : static::class) {
+ $skippedProperties["\0".self::class."\0lazyObjectState"] = true;
+ } elseif (\defined($class.'::LAZY_OBJECT_PROPERTY_SCOPES')) {
+ Hydrator::$propertyScopes[$class] ??= $class::LAZY_OBJECT_PROPERTY_SCOPES;
+ }
+
+ $instance ??= (Registry::$classReflectors[$class] ??= new \ReflectionClass($class))->newInstanceWithoutConstructor();
+ Registry::$defaultProperties[$class] ??= (array) $instance;
+ $instance->lazyObjectState = new LazyObjectState($initializer, $skippedProperties ??= []);
+
+ foreach (Registry::$classResetters[$class] ??= Registry::getClassResetters($class) as $reset) {
+ $reset($instance, $skippedProperties, $onlyProperties);
+ }
+
+ return $instance;
+ }
+
+ /**
+ * Returns whether the object is initialized.
+ *
+ * @param $partial Whether partially initialized objects should be considered as initialized
+ */
+ public function isLazyObjectInitialized(bool $partial = false): bool
+ {
+ if (!$state = $this->lazyObjectState ?? null) {
+ return true;
+ }
+
+ if (!\is_array($state->initializer)) {
+ return LazyObjectState::STATUS_INITIALIZED_FULL === $state->status;
+ }
+
+ $class = $this::class;
+ $properties = (array) $this;
+
+ if ($partial) {
+ return (bool) array_intersect_key($state->initializer, $properties);
+ }
+
+ $propertyScopes = Hydrator::$propertyScopes[$class] ??= Hydrator::getPropertyScopes($class);
+ foreach ($state->initializer as $key => $initializer) {
+ if (!\array_key_exists($key, $properties) && isset($propertyScopes[$key])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Forces initialization of a lazy object and returns it.
+ */
+ public function initializeLazyObject(): static
+ {
+ if (!$state = $this->lazyObjectState ?? null) {
+ return $this;
+ }
+
+ if (!\is_array($state->initializer)) {
+ if (LazyObjectState::STATUS_UNINITIALIZED_FULL === $state->status) {
+ $state->initialize($this, '', null);
+ }
+
+ return $this;
+ }
+
+ $values = isset($state->initializer["\0"]) ? null : [];
+
+ $class = $this::class;
+ $properties = (array) $this;
+ $propertyScopes = Hydrator::$propertyScopes[$class] ??= Hydrator::getPropertyScopes($class);
+ foreach ($state->initializer as $key => $initializer) {
+ if (\array_key_exists($key, $properties) || ![$scope, $name, $readonlyScope] = $propertyScopes[$key] ?? null) {
+ continue;
+ }
+ $scope = $readonlyScope ?? ('*' !== $scope ? $scope : $class);
+
+ if (null === $values) {
+ if (!\is_array($values = ($state->initializer["\0"])($this, Registry::$defaultProperties[$class]))) {
+ throw new \TypeError(sprintf('The lazy-initializer defined for instance of "%s" must return an array, got "%s".', $class, get_debug_type($values)));
+ }
+
+ if (\array_key_exists($key, $properties = (array) $this)) {
+ continue;
+ }
+ }
+
+ if (\array_key_exists($key, $values)) {
+ $accessor = Registry::$classAccessors[$scope] ??= Registry::getClassAccessors($scope);
+ $accessor['set']($this, $name, $properties[$key] = $values[$key]);
+ } else {
+ $state->initialize($this, $name, $scope);
+ $properties = (array) $this;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * @return bool Returns false when the object cannot be reset, ie when it's not a lazy object
+ */
+ public function resetLazyObject(): bool
+ {
+ if (!$state = $this->lazyObjectState ?? null) {
+ return false;
+ }
+
+ if (LazyObjectState::STATUS_UNINITIALIZED_FULL !== $state->status) {
+ $state->reset($this);
+ }
+
+ return true;
+ }
+
+ public function &__get($name): mixed
+ {
+ $propertyScopes = Hydrator::$propertyScopes[$this::class] ??= Hydrator::getPropertyScopes($this::class);
+ $scope = null;
+
+ if ([$class, , $readonlyScope] = $propertyScopes[$name] ?? null) {
+ $scope = Registry::getScope($propertyScopes, $class, $name);
+ $state = $this->lazyObjectState ?? null;
+
+ if ($state && (null === $scope || isset($propertyScopes["\0$scope\0$name"]))
+ && LazyObjectState::STATUS_UNINITIALIZED_PARTIAL !== $state->initialize($this, $name, $readonlyScope ?? $scope)
+ ) {
+ goto get_in_scope;
+ }
+ }
+
+ if ($parent = (Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['get']) {
+ if (2 === $parent) {
+ return parent::__get($name);
+ }
+ $value = parent::__get($name);
+
+ return $value;
+ }
+
+ if (null === $class) {
+ $frame = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1)[0];
+ trigger_error(sprintf('Undefined property: %s::$%s in %s on line %s', $this::class, $name, $frame['file'], $frame['line']), \E_USER_NOTICE);
+ }
+
+ get_in_scope:
+
+ try {
+ if (null === $scope) {
+ if (null === $readonlyScope) {
+ return $this->$name;
+ }
+ $value = $this->$name;
+
+ return $value;
+ }
+ $accessor = Registry::$classAccessors[$scope] ??= Registry::getClassAccessors($scope);
+
+ return $accessor['get']($this, $name, null !== $readonlyScope);
+ } catch (\Error $e) {
+ if (\Error::class !== $e::class || !str_starts_with($e->getMessage(), 'Cannot access uninitialized non-nullable property')) {
+ throw $e;
+ }
+
+ try {
+ if (null === $scope) {
+ $this->$name = [];
+
+ return $this->$name;
+ }
+
+ $accessor['set']($this, $name, []);
+
+ return $accessor['get']($this, $name, null !== $readonlyScope);
+ } catch (\Error) {
+ throw $e;
+ }
+ }
+ }
+
+ public function __set($name, $value): void
+ {
+ $propertyScopes = Hydrator::$propertyScopes[$this::class] ??= Hydrator::getPropertyScopes($this::class);
+ $scope = null;
+
+ if ([$class, , $readonlyScope] = $propertyScopes[$name] ?? null) {
+ $scope = Registry::getScope($propertyScopes, $class, $name, $readonlyScope);
+ $state = $this->lazyObjectState ?? null;
+
+ if ($state && ($readonlyScope === $scope || isset($propertyScopes["\0$scope\0$name"]))) {
+ if (LazyObjectState::STATUS_UNINITIALIZED_FULL === $state->status) {
+ $state->initialize($this, $name, $readonlyScope ?? $scope);
+ }
+ goto set_in_scope;
+ }
+ }
+
+ if ((Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['set']) {
+ parent::__set($name, $value);
+
+ return;
+ }
+
+ set_in_scope:
+
+ if (null === $scope) {
+ $this->$name = $value;
+ } else {
+ $accessor = Registry::$classAccessors[$scope] ??= Registry::getClassAccessors($scope);
+ $accessor['set']($this, $name, $value);
+ }
+ }
+
+ public function __isset($name): bool
+ {
+ $propertyScopes = Hydrator::$propertyScopes[$this::class] ??= Hydrator::getPropertyScopes($this::class);
+ $scope = null;
+
+ if ([$class, , $readonlyScope] = $propertyScopes[$name] ?? null) {
+ $scope = Registry::getScope($propertyScopes, $class, $name);
+ $state = $this->lazyObjectState ?? null;
+
+ if ($state && (null === $scope || isset($propertyScopes["\0$scope\0$name"]))
+ && LazyObjectState::STATUS_UNINITIALIZED_PARTIAL !== $state->initialize($this, $name, $readonlyScope ?? $scope)
+ ) {
+ goto isset_in_scope;
+ }
+ }
+
+ if ((Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['isset']) {
+ return parent::__isset($name);
+ }
+
+ isset_in_scope:
+
+ if (null === $scope) {
+ return isset($this->$name);
+ }
+ $accessor = Registry::$classAccessors[$scope] ??= Registry::getClassAccessors($scope);
+
+ return $accessor['isset']($this, $name);
+ }
+
+ public function __unset($name): void
+ {
+ $propertyScopes = Hydrator::$propertyScopes[$this::class] ??= Hydrator::getPropertyScopes($this::class);
+ $scope = null;
+
+ if ([$class, , $readonlyScope] = $propertyScopes[$name] ?? null) {
+ $scope = Registry::getScope($propertyScopes, $class, $name, $readonlyScope);
+ $state = $this->lazyObjectState ?? null;
+
+ if ($state && ($readonlyScope === $scope || isset($propertyScopes["\0$scope\0$name"]))) {
+ if (LazyObjectState::STATUS_UNINITIALIZED_FULL === $state->status) {
+ $state->initialize($this, $name, $readonlyScope ?? $scope);
+ }
+ goto unset_in_scope;
+ }
+ }
+
+ if ((Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['unset']) {
+ parent::__unset($name);
+
+ return;
+ }
+
+ unset_in_scope:
+
+ if (null === $scope) {
+ unset($this->$name);
+ } else {
+ $accessor = Registry::$classAccessors[$scope] ??= Registry::getClassAccessors($scope);
+ $accessor['unset']($this, $name);
+ }
+ }
+
+ public function __clone(): void
+ {
+ if ($state = $this->lazyObjectState ?? null) {
+ $this->lazyObjectState = clone $state;
+ }
+
+ if ((Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['clone']) {
+ parent::__clone();
+ }
+ }
+
+ public function __serialize(): array
+ {
+ $class = self::class;
+
+ if ((Registry::$parentMethods[$class] ??= Registry::getParentMethods($class))['serialize']) {
+ $properties = parent::__serialize();
+ } else {
+ $this->initializeLazyObject();
+ $properties = (array) $this;
+ }
+ unset($properties["\0$class\0lazyObjectState"]);
+
+ if (Registry::$parentMethods[$class]['serialize'] || !Registry::$parentMethods[$class]['sleep']) {
+ return $properties;
+ }
+
+ $scope = get_parent_class($class);
+ $data = [];
+
+ foreach (parent::__sleep() as $name) {
+ $value = $properties[$k = $name] ?? $properties[$k = "\0*\0$name"] ?? $properties[$k = "\0$scope\0$name"] ?? $k = null;
+
+ if (null === $k) {
+ trigger_error(sprintf('serialize(): "%s" returned as member variable from __sleep() but does not exist', $name), \E_USER_NOTICE);
+ } else {
+ $data[$k] = $value;
+ }
+ }
+
+ return $data;
+ }
+
+ public function __destruct()
+ {
+ $state = $this->lazyObjectState ?? null;
+
+ if ($state && \in_array($state->status, [LazyObjectState::STATUS_UNINITIALIZED_FULL, LazyObjectState::STATUS_UNINITIALIZED_PARTIAL], true)) {
+ return;
+ }
+
+ if ((Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['destruct']) {
+ parent::__destruct();
+ }
+ }
+
+ private function setLazyObjectAsInitialized(bool $initialized): void
+ {
+ $state = $this->lazyObjectState ?? null;
+
+ if ($state && !\is_array($state->initializer)) {
+ $state->status = $initialized ? LazyObjectState::STATUS_INITIALIZED_FULL : LazyObjectState::STATUS_UNINITIALIZED_FULL;
+ }
+ }
+}
diff --git a/vendor/symfony/var-exporter/LazyObjectInterface.php b/vendor/symfony/var-exporter/LazyObjectInterface.php
new file mode 100644
index 0000000..3670884
--- /dev/null
+++ b/vendor/symfony/var-exporter/LazyObjectInterface.php
@@ -0,0 +1,32 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\VarExporter;
+
+interface LazyObjectInterface
+{
+ /**
+ * Returns whether the object is initialized.
+ *
+ * @param $partial Whether partially initialized objects should be considered as initialized
+ */
+ public function isLazyObjectInitialized(bool $partial = false): bool;
+
+ /**
+ * Forces initialization of a lazy object and returns it.
+ */
+ public function initializeLazyObject(): object;
+
+ /**
+ * @return bool Returns false when the object cannot be reset, ie when it's not a lazy object
+ */
+ public function resetLazyObject(): bool;
+}
diff --git a/vendor/symfony/var-exporter/LazyProxyTrait.php b/vendor/symfony/var-exporter/LazyProxyTrait.php
new file mode 100644
index 0000000..153c382
--- /dev/null
+++ b/vendor/symfony/var-exporter/LazyProxyTrait.php
@@ -0,0 +1,347 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\VarExporter;
+
+use Symfony\Component\VarExporter\Hydrator as PublicHydrator;
+use Symfony\Component\VarExporter\Internal\Hydrator;
+use Symfony\Component\VarExporter\Internal\LazyObjectRegistry as Registry;
+use Symfony\Component\VarExporter\Internal\LazyObjectState;
+use Symfony\Component\VarExporter\Internal\LazyObjectTrait;
+
+trait LazyProxyTrait
+{
+ use LazyObjectTrait;
+
+ /**
+ * Creates a lazy-loading virtual proxy.
+ *
+ * @param \Closure():object $initializer Returns the proxied object
+ * @param static|null $instance
+ */
+ public static function createLazyProxy(\Closure $initializer, object $instance = null): static
+ {
+ if (self::class !== $class = $instance ? $instance::class : static::class) {
+ $skippedProperties = ["\0".self::class."\0lazyObjectState" => true];
+ } elseif (\defined($class.'::LAZY_OBJECT_PROPERTY_SCOPES')) {
+ Hydrator::$propertyScopes[$class] ??= $class::LAZY_OBJECT_PROPERTY_SCOPES;
+ }
+
+ $instance ??= (Registry::$classReflectors[$class] ??= new \ReflectionClass($class))->newInstanceWithoutConstructor();
+ $instance->lazyObjectState = new LazyObjectState($initializer);
+
+ foreach (Registry::$classResetters[$class] ??= Registry::getClassResetters($class) as $reset) {
+ $reset($instance, $skippedProperties ??= []);
+ }
+
+ return $instance;
+ }
+
+ /**
+ * Returns whether the object is initialized.
+ *
+ * @param $partial Whether partially initialized objects should be considered as initialized
+ */
+ public function isLazyObjectInitialized(bool $partial = false): bool
+ {
+ return !isset($this->lazyObjectState) || isset($this->lazyObjectState->realInstance) || Registry::$noInitializerState === $this->lazyObjectState->initializer;
+ }
+
+ /**
+ * Forces initialization of a lazy object and returns it.
+ */
+ public function initializeLazyObject(): parent
+ {
+ if ($state = $this->lazyObjectState ?? null) {
+ return $state->realInstance ??= ($state->initializer)();
+ }
+
+ return $this;
+ }
+
+ /**
+ * @return bool Returns false when the object cannot be reset, ie when it's not a lazy object
+ */
+ public function resetLazyObject(): bool
+ {
+ if (!isset($this->lazyObjectState) || Registry::$noInitializerState === $this->lazyObjectState->initializer) {
+ return false;
+ }
+
+ unset($this->lazyObjectState->realInstance);
+
+ return true;
+ }
+
+ public function &__get($name): mixed
+ {
+ $propertyScopes = Hydrator::$propertyScopes[$this::class] ??= Hydrator::getPropertyScopes($this::class);
+ $scope = null;
+ $instance = $this;
+
+ if ([$class, , $readonlyScope] = $propertyScopes[$name] ?? null) {
+ $scope = Registry::getScope($propertyScopes, $class, $name);
+
+ if (null === $scope || isset($propertyScopes["\0$scope\0$name"])) {
+ if ($state = $this->lazyObjectState ?? null) {
+ $instance = $state->realInstance ??= ($state->initializer)();
+ }
+ $parent = 2;
+ goto get_in_scope;
+ }
+ }
+ $parent = (Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['get'];
+
+ if ($state = $this->lazyObjectState ?? null) {
+ $instance = $state->realInstance ??= ($state->initializer)();
+ } else {
+ if (2 === $parent) {
+ return parent::__get($name);
+ }
+ $value = parent::__get($name);
+
+ return $value;
+ }
+
+ if (!$parent && null === $class && !\array_key_exists($name, (array) $instance)) {
+ $frame = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1)[0];
+ trigger_error(sprintf('Undefined property: %s::$%s in %s on line %s', $instance::class, $name, $frame['file'], $frame['line']), \E_USER_NOTICE);
+ }
+
+ get_in_scope:
+
+ try {
+ if (null === $scope) {
+ if (null === $readonlyScope && 1 !== $parent) {
+ return $instance->$name;
+ }
+ $value = $instance->$name;
+
+ return $value;
+ }
+ $accessor = Registry::$classAccessors[$scope] ??= Registry::getClassAccessors($scope);
+
+ return $accessor['get']($instance, $name, null !== $readonlyScope || 1 === $parent);
+ } catch (\Error $e) {
+ if (\Error::class !== $e::class || !str_starts_with($e->getMessage(), 'Cannot access uninitialized non-nullable property')) {
+ throw $e;
+ }
+
+ try {
+ if (null === $scope) {
+ $instance->$name = [];
+
+ return $instance->$name;
+ }
+
+ $accessor['set']($instance, $name, []);
+
+ return $accessor['get']($instance, $name, null !== $readonlyScope || 1 === $parent);
+ } catch (\Error) {
+ throw $e;
+ }
+ }
+ }
+
+ public function __set($name, $value): void
+ {
+ $propertyScopes = Hydrator::$propertyScopes[$this::class] ??= Hydrator::getPropertyScopes($this::class);
+ $scope = null;
+ $instance = $this;
+
+ if ([$class, , $readonlyScope] = $propertyScopes[$name] ?? null) {
+ $scope = Registry::getScope($propertyScopes, $class, $name, $readonlyScope);
+
+ if ($readonlyScope === $scope || isset($propertyScopes["\0$scope\0$name"])) {
+ if ($state = $this->lazyObjectState ?? null) {
+ $instance = $state->realInstance ??= ($state->initializer)();
+ }
+ goto set_in_scope;
+ }
+ }
+
+ if ($state = $this->lazyObjectState ?? null) {
+ $instance = $state->realInstance ??= ($state->initializer)();
+ } elseif ((Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['set']) {
+ parent::__set($name, $value);
+
+ return;
+ }
+
+ set_in_scope:
+
+ if (null === $scope) {
+ $instance->$name = $value;
+ } else {
+ $accessor = Registry::$classAccessors[$scope] ??= Registry::getClassAccessors($scope);
+ $accessor['set']($instance, $name, $value);
+ }
+ }
+
+ public function __isset($name): bool
+ {
+ $propertyScopes = Hydrator::$propertyScopes[$this::class] ??= Hydrator::getPropertyScopes($this::class);
+ $scope = null;
+ $instance = $this;
+
+ if ([$class] = $propertyScopes[$name] ?? null) {
+ $scope = Registry::getScope($propertyScopes, $class, $name);
+
+ if (null === $scope || isset($propertyScopes["\0$scope\0$name"])) {
+ if ($state = $this->lazyObjectState ?? null) {
+ $instance = $state->realInstance ??= ($state->initializer)();
+ }
+ goto isset_in_scope;
+ }
+ }
+
+ if ($state = $this->lazyObjectState ?? null) {
+ $instance = $state->realInstance ??= ($state->initializer)();
+ } elseif ((Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['isset']) {
+ return parent::__isset($name);
+ }
+
+ isset_in_scope:
+
+ if (null === $scope) {
+ return isset($instance->$name);
+ }
+ $accessor = Registry::$classAccessors[$scope] ??= Registry::getClassAccessors($scope);
+
+ return $accessor['isset']($instance, $name);
+ }
+
+ public function __unset($name): void
+ {
+ $propertyScopes = Hydrator::$propertyScopes[$this::class] ??= Hydrator::getPropertyScopes($this::class);
+ $scope = null;
+ $instance = $this;
+
+ if ([$class, , $readonlyScope] = $propertyScopes[$name] ?? null) {
+ $scope = Registry::getScope($propertyScopes, $class, $name, $readonlyScope);
+
+ if ($readonlyScope === $scope || isset($propertyScopes["\0$scope\0$name"])) {
+ if ($state = $this->lazyObjectState ?? null) {
+ $instance = $state->realInstance ??= ($state->initializer)();
+ }
+ goto unset_in_scope;
+ }
+ }
+
+ if ($state = $this->lazyObjectState ?? null) {
+ $instance = $state->realInstance ??= ($state->initializer)();
+ } elseif ((Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['unset']) {
+ parent::__unset($name);
+
+ return;
+ }
+
+ unset_in_scope:
+
+ if (null === $scope) {
+ unset($instance->$name);
+ } else {
+ $accessor = Registry::$classAccessors[$scope] ??= Registry::getClassAccessors($scope);
+ $accessor['unset']($instance, $name);
+ }
+ }
+
+ public function __clone(): void
+ {
+ if (!isset($this->lazyObjectState)) {
+ if ((Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['clone']) {
+ parent::__clone();
+ }
+
+ return;
+ }
+
+ $this->lazyObjectState = clone $this->lazyObjectState;
+
+ if (isset($this->lazyObjectState->realInstance)) {
+ $this->lazyObjectState->realInstance = clone $this->lazyObjectState->realInstance;
+ }
+ }
+
+ public function __serialize(): array
+ {
+ $class = self::class;
+ $state = $this->lazyObjectState ?? null;
+
+ if (!$state && (Registry::$parentMethods[$class] ??= Registry::getParentMethods($class))['serialize']) {
+ $properties = parent::__serialize();
+ } else {
+ $properties = (array) $this;
+
+ if ($state) {
+ unset($properties["\0$class\0lazyObjectState"]);
+ $properties["\0$class\0lazyObjectReal"] = $state->realInstance ??= ($state->initializer)();
+ }
+ }
+
+ if ($state || Registry::$parentMethods[$class]['serialize'] || !Registry::$parentMethods[$class]['sleep']) {
+ return $properties;
+ }
+
+ $scope = get_parent_class($class);
+ $data = [];
+
+ foreach (parent::__sleep() as $name) {
+ $value = $properties[$k = $name] ?? $properties[$k = "\0*\0$name"] ?? $properties[$k = "\0$scope\0$name"] ?? $k = null;
+
+ if (null === $k) {
+ trigger_error(sprintf('serialize(): "%s" returned as member variable from __sleep() but does not exist', $name), \E_USER_NOTICE);
+ } else {
+ $data[$k] = $value;
+ }
+ }
+
+ return $data;
+ }
+
+ public function __unserialize(array $data): void
+ {
+ $class = self::class;
+
+ if ($instance = $data["\0$class\0lazyObjectReal"] ?? null) {
+ unset($data["\0$class\0lazyObjectReal"]);
+
+ foreach (Registry::$classResetters[$class] ??= Registry::getClassResetters($class) as $reset) {
+ $reset($this, $data);
+ }
+
+ if ($data) {
+ PublicHydrator::hydrate($this, $data);
+ }
+ $this->lazyObjectState = new LazyObjectState(Registry::$noInitializerState ??= static fn () => throw new \LogicException('Lazy proxy has no initializer.'));
+ $this->lazyObjectState->realInstance = $instance;
+ } elseif ((Registry::$parentMethods[$class] ??= Registry::getParentMethods($class))['unserialize']) {
+ parent::__unserialize($data);
+ } else {
+ PublicHydrator::hydrate($this, $data);
+
+ if (Registry::$parentMethods[$class]['wakeup']) {
+ parent::__wakeup();
+ }
+ }
+ }
+
+ public function __destruct()
+ {
+ if (isset($this->lazyObjectState)) {
+ return;
+ }
+
+ if ((Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['destruct']) {
+ parent::__destruct();
+ }
+ }
+}
diff --git a/vendor/symfony/var-exporter/ProxyHelper.php b/vendor/symfony/var-exporter/ProxyHelper.php
new file mode 100644
index 0000000..2e150cb
--- /dev/null
+++ b/vendor/symfony/var-exporter/ProxyHelper.php
@@ -0,0 +1,365 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\VarExporter;
+
+use Symfony\Component\VarExporter\Exception\LogicException;
+use Symfony\Component\VarExporter\Internal\Hydrator;
+use Symfony\Component\VarExporter\Internal\LazyObjectRegistry;
+
+/**
+ * @author Nicolas Grekas
+ */
+final class ProxyHelper
+{
+ /**
+ * Helps generate lazy-loading ghost objects.
+ *
+ * @throws LogicException When the class is incompatible with ghost objects
+ */
+ public static function generateLazyGhost(\ReflectionClass $class): string
+ {
+ if (\PHP_VERSION_ID >= 80200 && \PHP_VERSION_ID < 80300 && $class->isReadOnly()) {
+ throw new LogicException(sprintf('Cannot generate lazy ghost: class "%s" is readonly.', $class->name));
+ }
+ if ($class->isFinal()) {
+ throw new LogicException(sprintf('Cannot generate lazy ghost: class "%s" is final.', $class->name));
+ }
+ if ($class->isInterface() || $class->isAbstract()) {
+ throw new LogicException(sprintf('Cannot generate lazy ghost: "%s" is not a concrete class.', $class->name));
+ }
+ if (\stdClass::class !== $class->name && $class->isInternal()) {
+ throw new LogicException(sprintf('Cannot generate lazy ghost: class "%s" is internal.', $class->name));
+ }
+ if ($class->hasMethod('__get') && 'mixed' !== (self::exportType($class->getMethod('__get')) ?? 'mixed')) {
+ throw new LogicException(sprintf('Cannot generate lazy ghost: return type of method "%s::__get()" should be "mixed".', $class->name));
+ }
+
+ static $traitMethods;
+ $traitMethods ??= (new \ReflectionClass(LazyGhostTrait::class))->getMethods();
+
+ foreach ($traitMethods as $method) {
+ if ($class->hasMethod($method->name) && $class->getMethod($method->name)->isFinal()) {
+ throw new LogicException(sprintf('Cannot generate lazy ghost: method "%s::%s()" is final.', $class->name, $method->name));
+ }
+ }
+
+ $parent = $class;
+ while ($parent = $parent->getParentClass()) {
+ if (\stdClass::class !== $parent->name && $parent->isInternal()) {
+ throw new LogicException(sprintf('Cannot generate lazy ghost: class "%s" extends "%s" which is internal.', $class->name, $parent->name));
+ }
+ }
+ $propertyScopes = self::exportPropertyScopes($class->name);
+
+ return <<name} implements \Symfony\Component\VarExporter\LazyObjectInterface
+ {
+ use \Symfony\Component\VarExporter\LazyGhostTrait;
+
+ private const LAZY_OBJECT_PROPERTY_SCOPES = {$propertyScopes};
+ }
+
+ // Help opcache.preload discover always-needed symbols
+ class_exists(\Symfony\Component\VarExporter\Internal\Hydrator::class);
+ class_exists(\Symfony\Component\VarExporter\Internal\LazyObjectRegistry::class);
+ class_exists(\Symfony\Component\VarExporter\Internal\LazyObjectState::class);
+
+ EOPHP;
+ }
+
+ /**
+ * Helps generate lazy-loading virtual proxies.
+ *
+ * @param \ReflectionClass[] $interfaces
+ *
+ * @throws LogicException When the class is incompatible with virtual proxies
+ */
+ public static function generateLazyProxy(?\ReflectionClass $class, array $interfaces = []): string
+ {
+ if (!class_exists($class?->name ?? \stdClass::class, false)) {
+ throw new LogicException(sprintf('Cannot generate lazy proxy: "%s" is not a class.', $class->name));
+ }
+ if ($class?->isFinal()) {
+ throw new LogicException(sprintf('Cannot generate lazy proxy: class "%s" is final.', $class->name));
+ }
+ if (\PHP_VERSION_ID >= 80200 && \PHP_VERSION_ID < 80300 && $class?->isReadOnly()) {
+ throw new LogicException(sprintf('Cannot generate lazy proxy: class "%s" is readonly.', $class->name));
+ }
+
+ $methodReflectors = [$class?->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) ?? []];
+ foreach ($interfaces as $interface) {
+ if (!$interface->isInterface()) {
+ throw new LogicException(sprintf('Cannot generate lazy proxy: "%s" is not an interface.', $interface->name));
+ }
+ $methodReflectors[] = $interface->getMethods();
+ }
+ $methodReflectors = array_merge(...$methodReflectors);
+
+ $extendsInternalClass = false;
+ if ($parent = $class) {
+ do {
+ $extendsInternalClass = \stdClass::class !== $parent->name && $parent->isInternal();
+ } while (!$extendsInternalClass && $parent = $parent->getParentClass());
+ }
+ $methodsHaveToBeProxied = $extendsInternalClass;
+ $methods = [];
+
+ foreach ($methodReflectors as $method) {
+ if ('__get' !== strtolower($method->name) || 'mixed' === ($type = self::exportType($method) ?? 'mixed')) {
+ continue;
+ }
+ $methodsHaveToBeProxied = true;
+ $trait = new \ReflectionMethod(LazyProxyTrait::class, '__get');
+ $body = \array_slice(file($trait->getFileName()), $trait->getStartLine() - 1, $trait->getEndLine() - $trait->getStartLine());
+ $body[0] = str_replace('): mixed', '): '.$type, $body[0]);
+ $methods['__get'] = strtr(implode('', $body).' }', [
+ 'Hydrator' => '\\'.Hydrator::class,
+ 'Registry' => '\\'.LazyObjectRegistry::class,
+ ]);
+ break;
+ }
+
+ foreach ($methodReflectors as $method) {
+ if (($method->isStatic() && !$method->isAbstract()) || isset($methods[$lcName = strtolower($method->name)])) {
+ continue;
+ }
+ if ($method->isFinal()) {
+ if ($extendsInternalClass || $methodsHaveToBeProxied || method_exists(LazyProxyTrait::class, $method->name)) {
+ throw new LogicException(sprintf('Cannot generate lazy proxy: method "%s::%s()" is final.', $class->name, $method->name));
+ }
+ continue;
+ }
+ if (method_exists(LazyProxyTrait::class, $method->name) || ($method->isProtected() && !$method->isAbstract())) {
+ continue;
+ }
+
+ $signature = self::exportSignature($method, true, $args);
+ $parentCall = $method->isAbstract() ? "throw new \BadMethodCallException('Cannot forward abstract method \"{$method->class}::{$method->name}()\".')" : "parent::{$method->name}({$args})";
+
+ if ($method->isStatic()) {
+ $body = " $parentCall;";
+ } elseif (str_ends_with($signature, '): never') || str_ends_with($signature, '): void')) {
+ $body = <<lazyObjectState)) {
+ (\$this->lazyObjectState->realInstance ??= (\$this->lazyObjectState->initializer)())->{$method->name}({$args});
+ } else {
+ {$parentCall};
+ }
+ EOPHP;
+ } else {
+ if (!$methodsHaveToBeProxied && !$method->isAbstract()) {
+ // Skip proxying methods that might return $this
+ foreach (preg_split('/[()|&]++/', self::exportType($method) ?? 'static') as $type) {
+ if (\in_array($type = ltrim($type, '?'), ['static', 'object'], true)) {
+ continue 2;
+ }
+ foreach ([$class, ...$interfaces] as $r) {
+ if ($r && is_a($r->name, $type, true)) {
+ continue 3;
+ }
+ }
+ }
+ }
+
+ $body = <<lazyObjectState)) {
+ return (\$this->lazyObjectState->realInstance ??= (\$this->lazyObjectState->initializer)())->{$method->name}({$args});
+ }
+
+ return {$parentCall};
+ EOPHP;
+ }
+ $methods[$lcName] = " {$signature}\n {\n{$body}\n }";
+ }
+
+ $types = $interfaces = array_unique(array_column($interfaces, 'name'));
+ $interfaces[] = LazyObjectInterface::class;
+ $interfaces = implode(', \\', $interfaces);
+ $parent = $class ? ' extends \\'.$class->name : '';
+ array_unshift($types, $class ? 'parent' : '');
+ $type = ltrim(implode('&\\', $types), '&');
+
+ if (!$class) {
+ $trait = new \ReflectionMethod(LazyProxyTrait::class, 'initializeLazyObject');
+ $body = \array_slice(file($trait->getFileName()), $trait->getStartLine() - 1, $trait->getEndLine() - $trait->getStartLine());
+ $body[0] = str_replace('): parent', '): '.$type, $body[0]);
+ $methods = ['initializeLazyObject' => implode('', $body).' }'] + $methods;
+ }
+ $body = $methods ? "\n".implode("\n\n", $methods)."\n" : '';
+ $propertyScopes = $class ? self::exportPropertyScopes($class->name) : '[]';
+
+ return <<getParameters() as $param) {
+ $parameters[] = ($param->getAttributes(\SensitiveParameter::class) ? '#[\SensitiveParameter] ' : '')
+ .($withParameterTypes && $param->hasType() ? self::exportType($param).' ' : '')
+ .($param->isPassedByReference() ? '&' : '')
+ .($param->isVariadic() ? '...' : '').'$'.$param->name
+ .($param->isOptional() && !$param->isVariadic() ? ' = '.self::exportDefault($param) : '');
+ $hasByRef = $hasByRef || $param->isPassedByReference();
+ $args .= ($param->isVariadic() ? '...$' : '$').$param->name.', ';
+ }
+
+ if (!$param || !$hasByRef) {
+ $args = '...\func_get_args()';
+ } elseif ($param->isVariadic()) {
+ $args = substr($args, 0, -2);
+ } else {
+ $args .= sprintf('...\array_slice(\func_get_args(), %d)', \count($parameters));
+ }
+
+ $signature = 'function '.($function->returnsReference() ? '&' : '')
+ .($function->isClosure() ? '' : $function->name).'('.implode(', ', $parameters).')';
+
+ if ($function instanceof \ReflectionMethod) {
+ $signature = ($function->isPublic() ? 'public ' : ($function->isProtected() ? 'protected ' : 'private '))
+ .($function->isStatic() ? 'static ' : '').$signature;
+ }
+ if ($function->hasReturnType()) {
+ $signature .= ': '.self::exportType($function);
+ }
+
+ static $getPrototype;
+ $getPrototype ??= (new \ReflectionMethod(\ReflectionMethod::class, 'getPrototype'))->invoke(...);
+
+ while ($function) {
+ if ($function->hasTentativeReturnType()) {
+ return '#[\ReturnTypeWillChange] '.$signature;
+ }
+
+ try {
+ $function = $function instanceof \ReflectionMethod && $function->isAbstract() ? false : $getPrototype($function);
+ } catch (\ReflectionException) {
+ break;
+ }
+ }
+
+ return $signature;
+ }
+
+ public static function exportType(\ReflectionFunctionAbstract|\ReflectionProperty|\ReflectionParameter $owner, bool $noBuiltin = false, \ReflectionType $type = null): ?string
+ {
+ if (!$type ??= $owner instanceof \ReflectionFunctionAbstract ? $owner->getReturnType() : $owner->getType()) {
+ return null;
+ }
+ $class = null;
+ $types = [];
+ if ($type instanceof \ReflectionUnionType) {
+ $reflectionTypes = $type->getTypes();
+ $glue = '|';
+ } elseif ($type instanceof \ReflectionIntersectionType) {
+ $reflectionTypes = $type->getTypes();
+ $glue = '&';
+ } else {
+ $reflectionTypes = [$type];
+ $glue = null;
+ }
+
+ foreach ($reflectionTypes as $type) {
+ if ($type instanceof \ReflectionIntersectionType) {
+ if ('' !== $name = '('.self::exportType($owner, $noBuiltin, $type).')') {
+ $types[] = $name;
+ }
+ continue;
+ }
+ $name = $type->getName();
+
+ if ($noBuiltin && $type->isBuiltin()) {
+ continue;
+ }
+ if (\in_array($name, ['parent', 'self'], true) && $class ??= $owner->getDeclaringClass()) {
+ $name = 'parent' === $name ? ($class->getParentClass() ?: null)?->name ?? 'parent' : $class->name;
+ }
+
+ $types[] = ($noBuiltin || $type->isBuiltin() || 'static' === $name ? '' : '\\').$name;
+ }
+
+ if (!$types) {
+ return '';
+ }
+ if (null === $glue) {
+ return (!$noBuiltin && $type->allowsNull() && 'mixed' !== $name ? '?' : '').$types[0];
+ }
+ sort($types);
+
+ return implode($glue, $types);
+ }
+
+ private static function exportPropertyScopes(string $parent): string
+ {
+ $propertyScopes = Hydrator::$propertyScopes[$parent] ??= Hydrator::getPropertyScopes($parent);
+ uksort($propertyScopes, 'strnatcmp');
+ $propertyScopes = VarExporter::export($propertyScopes);
+ $propertyScopes = str_replace(VarExporter::export($parent), 'parent::class', $propertyScopes);
+ $propertyScopes = preg_replace("/(?|(,)\n( ) |\n |,\n (\]))/", '$1$2', $propertyScopes);
+ $propertyScopes = str_replace("\n", "\n ", $propertyScopes);
+
+ return $propertyScopes;
+ }
+
+ private static function exportDefault(\ReflectionParameter $param): string
+ {
+ $default = rtrim(substr(explode('$'.$param->name.' = ', (string) $param, 2)[1] ?? '', 0, -2));
+
+ if (\in_array($default, ['', 'NULL'], true)) {
+ return 'null';
+ }
+ if (str_ends_with($default, "...'") && preg_match("/^'(?:[^'\\\\]*+(?:\\\\.)*+)*+'$/", $default)) {
+ return VarExporter::export($param->getDefaultValue());
+ }
+
+ $regexp = "/(\"(?:[^\"\\\\]*+(?:\\\\.)*+)*+\"|'(?:[^'\\\\]*+(?:\\\\.)*+)*+')/";
+ $parts = preg_split($regexp, $default, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY);
+
+ $regexp = '/([\[\( ]|^)([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\\\\[a-zA-Z0-9_\x7f-\xff]++)*+)(?!: )/';
+ $callback = (false !== strpbrk($default, "\\:('") && $class = $param->getDeclaringClass())
+ ? fn ($m) => $m[1].match ($m[2]) {
+ 'new', 'false', 'true', 'null' => $m[2],
+ 'NULL' => 'null',
+ 'self' => '\\'.$class->name,
+ 'namespace\\parent',
+ 'parent' => ($parent = $class->getParentClass()) ? '\\'.$parent->name : 'parent',
+ default => '\\'.$m[2],
+ }
+ : fn ($m) => $m[1].match ($m[2]) {
+ 'new', 'false', 'true', 'null', 'self', 'parent' => $m[2],
+ 'NULL' => 'null',
+ default => '\\'.$m[2],
+ };
+
+ return implode('', array_map(fn ($part) => match ($part[0]) {
+ '"' => $part, // for internal classes only
+ "'" => false !== strpbrk($part, "\\\0\r\n") ? '"'.substr(str_replace(['$', "\0", "\r", "\n"], ['\$', '\0', '\r', '\n'], $part), 1, -1).'"' : $part,
+ default => preg_replace_callback($regexp, $callback, $part),
+ }, $parts));
+ }
+}
diff --git a/vendor/symfony/var-exporter/README.md b/vendor/symfony/var-exporter/README.md
index a34e4c2..7c7a58e 100644
--- a/vendor/symfony/var-exporter/README.md
+++ b/vendor/symfony/var-exporter/README.md
@@ -1,15 +1,22 @@
VarExporter Component
=====================
-The VarExporter component allows exporting any serializable PHP data structure to
-plain PHP code. While doing so, it preserves all the semantics associated with
-the serialization mechanism of PHP (`__wakeup`, `__sleep`, `Serializable`,
-`__serialize`, `__unserialize`).
+The VarExporter component provides various tools to deal with the internal state
+of objects:
-It also provides an instantiator that allows creating and populating objects
-without calling their constructor nor any other methods.
+- `VarExporter::export()` allows exporting any serializable PHP data structure to
+ plain PHP code. While doing so, it preserves all the semantics associated with
+ the serialization mechanism of PHP (`__wakeup`, `__sleep`, `Serializable`,
+ `__serialize`, `__unserialize`.)
+- `Instantiator::instantiate()` creates an object and sets its properties without
+ calling its constructor nor any other methods.
+- `Hydrator::hydrate()` can set the properties of an existing object.
+- `Lazy*Trait` can make a class behave as a lazy-loading ghost or virtual proxy.
-The reason to use this component *vs* `serialize()` or
+VarExporter::export()
+---------------------
+
+The reason to use `VarExporter::export()` *vs* `serialize()` or
[igbinary](https://github.com/igbinary/igbinary) is performance: thanks to
OPcache, the resulting code is significantly faster and more memory efficient
than using `unserialize()` or `igbinary_unserialize()`.
@@ -20,14 +27,118 @@ It also provides a few improvements over `var_export()`/`serialize()`:
* the output is PSR-2 compatible;
* the output can be re-indented without messing up with `\r` or `\n` in the data
- * missing classes throw a `ClassNotFoundException` instead of being unserialized to
- `PHP_Incomplete_Class` objects;
+ * missing classes throw a `ClassNotFoundException` instead of being unserialized
+ to `PHP_Incomplete_Class` objects;
* references involving `SplObjectStorage`, `ArrayObject` or `ArrayIterator`
instances are preserved;
* `Reflection*`, `IteratorIterator` and `RecursiveIteratorIterator` classes
throw an exception when being serialized (their unserialized version is broken
anyway, see https://bugs.php.net/76737).
+Instantiator and Hydrator
+-------------------------
+
+`Instantiator::instantiate($class)` creates an object of the given class without
+calling its constructor nor any other methods.
+
+`Hydrator::hydrate()` sets the properties of an existing object, including
+private and protected ones. For example:
+
+```php
+// Sets the public or protected $object->propertyName property
+Hydrator::hydrate($object, ['propertyName' => $propertyValue]);
+
+// Sets a private property defined on its parent Bar class:
+Hydrator::hydrate($object, ["\0Bar\0privateBarProperty" => $propertyValue]);
+
+// Alternative way to set the private $object->privateBarProperty property
+Hydrator::hydrate($object, [], [
+ Bar::class => ['privateBarProperty' => $propertyValue],
+]);
+```
+
+`Lazy*Trait`
+------------
+
+The component provides two lazy-loading patterns: ghost objects and virtual
+proxies (see https://martinfowler.com/eaaCatalog/lazyLoad.html for reference.)
+
+Ghost objects work only with concrete and non-internal classes. In the generic
+case, they are not compatible with using factories in their initializer.
+
+Virtual proxies work with concrete, abstract or internal classes. They provide an
+API that looks like the actual objects and forward calls to them. They can cause
+identity problems because proxies might not be seen as equivalents to the actual
+objects they proxy.
+
+Because of this identity problem, ghost objects should be preferred when
+possible. Exceptions thrown by the `ProxyHelper` class can help decide when it
+can be used or not.
+
+Ghost objects and virtual proxies both provide implementations for the
+`LazyObjectInterface` which allows resetting them to their initial state or to
+forcibly initialize them when needed. Note that resetting a ghost object skips
+its read-only properties. You should use a virtual proxy to reset read-only
+properties.
+
+### `LazyGhostTrait`
+
+By using `LazyGhostTrait` either directly in your classes or by using
+`ProxyHelper::generateLazyGhost()`, you can make their instances lazy-loadable.
+This works by creating these instances empty and by computing their state only
+when accessing a property.
+
+```php
+class FooLazyGhost extends Foo
+{
+ use LazyGhostTrait;
+}
+
+$foo = FooLazyGhost::createLazyGhost(initializer: function (Foo $instance): void {
+ // [...] Use whatever heavy logic you need here
+ // to compute the $dependencies of the $instance
+ $instance->__construct(...$dependencies);
+ // [...] Call setters, etc. if needed
+});
+
+// $foo is now a lazy-loading ghost object. The initializer will
+// be called only when and if a *property* is accessed.
+```
+
+You can also partially initialize the objects on a property-by-property basis by
+adding two arguments to the initializer:
+
+```php
+$initializer = function (Foo $instance, string $propertyName, ?string $propertyScope): mixed {
+ if (Foo::class === $propertyScope && 'bar' === $propertyName) {
+ return 123;
+ }
+ // [...] Add more logic for the other properties
+};
+```
+
+### `LazyProxyTrait`
+
+Alternatively, `LazyProxyTrait` can be used to create virtual proxies:
+
+```php
+$proxyCode = ProxyHelper::generateLazyProxy(new ReflectionClass(Foo::class));
+// $proxyCode contains the reference to LazyProxyTrait
+// and should be dumped into a file in production envs
+eval('class FooLazyProxy'.$proxyCode);
+
+$foo = FooLazyProxy::createLazyProxy(initializer: function (): Foo {
+ // [...] Use whatever heavy logic you need here
+ // to compute the $dependencies of the $instance
+ $instance = new Foo(...$dependencies);
+ // [...] Call setters, etc. if needed
+
+ return $instance;
+});
+// $foo is now a lazy-loading virtual proxy object. The initializer will
+// be called only when and if a *method* is called.
+```
+
Resources
---------
diff --git a/vendor/symfony/var-exporter/VarExporter.php b/vendor/symfony/var-exporter/VarExporter.php
index 8581337..c12eb4f 100644
--- a/vendor/symfony/var-exporter/VarExporter.php
+++ b/vendor/symfony/var-exporter/VarExporter.php
@@ -32,13 +32,12 @@ final class VarExporter
/**
* Exports a serializable PHP value to PHP code.
*
- * @param mixed $value The value to export
* @param bool &$isStaticValue Set to true after execution if the provided value is static, false otherwise
* @param array &$foundClasses Classes found in the value are added to this list as both keys and values
*
* @throws ExceptionInterface When the provided value cannot be serialized
*/
- public static function export($value, bool &$isStaticValue = null, array &$foundClasses = []): string
+ public static function export(mixed $value, bool &$isStaticValue = null, array &$foundClasses = []): string
{
$isStaticValue = true;
diff --git a/vendor/symfony/var-exporter/composer.json b/vendor/symfony/var-exporter/composer.json
index 29d4901..83140ee 100644
--- a/vendor/symfony/var-exporter/composer.json
+++ b/vendor/symfony/var-exporter/composer.json
@@ -2,7 +2,7 @@
"name": "symfony/var-exporter",
"type": "library",
"description": "Allows exporting any serializable PHP data structure to plain PHP code",
- "keywords": ["export", "serialize", "instantiate", "hydrate", "construct", "clone"],
+ "keywords": ["export", "serialize", "instantiate", "hydrate", "construct", "clone", "lazy-loading", "proxy"],
"homepage": "https://symfony.com",
"license": "MIT",
"authors": [
@@ -16,11 +16,10 @@
}
],
"require": {
- "php": ">=7.2.5",
- "symfony/polyfill-php80": "^1.16"
+ "php": ">=8.1"
},
"require-dev": {
- "symfony/var-dumper": "^4.4.9|^5.0.9|^6.0"
+ "symfony/var-dumper": "^5.4|^6.0"
},
"autoload": {
"psr-4": { "Symfony\\Component\\VarExporter\\": "" },
diff --git a/vendor/taoser/think-addons/README.md b/vendor/taoser/think-addons/README.md
index 5ca893c..e529117 100644
--- a/vendor/taoser/think-addons/README.md
+++ b/vendor/taoser/think-addons/README.md
@@ -1,5 +1,5 @@
# think-addons
-The ThinkPHP 6 Addons Package
+The ThinkPHP 8 Addons Package
## 安装
> composer require taoser/think-addons
@@ -80,7 +80,7 @@ class Plugin extends Addons // 需继承think\Addons类
public $info = [
'name' => 'test', // 插件标识
'title' => '插件测试', // 插件名称
- 'description' => 'thinkph6插件测试', // 插件简介
+ 'description' => 'thinkph8插件测试', // 插件简介
'status' => 0, // 状态
'author' => 'byron sampson',
'version' => '0.1'
diff --git a/vendor/taoser/think-addons/composer.json b/vendor/taoser/think-addons/composer.json
index 81d0f06..f25f210 100644
--- a/vendor/taoser/think-addons/composer.json
+++ b/vendor/taoser/think-addons/composer.json
@@ -1,6 +1,6 @@
{
"name": "taoser/think-addons",
- "description": "The ThinkPHP6 Addons Package",
+ "description": "The ThinkPHP8 Addons Package",
"license": "mit",
"authors": [
{
@@ -9,11 +9,11 @@
}
],
"require": {
- "php": ">=7.1.0",
- "topthink/framework": "^6.0",
- "topthink/think-view": "^1.0",
+ "php": ">=8.0.0",
+ "topthink/framework": "^8.0",
+ "topthink/think-view": "^2.0",
"topthink/think-helper": "^3.0.0",
- "symfony/var-exporter": "^5.4"
+ "symfony/var-exporter": "^6.0"
},
"autoload": {
"psr-4": {
diff --git a/vendor/taoser/think-auth/README.md b/vendor/taoser/think-auth/README.md
index c4701b6..cb46f4a 100644
--- a/vendor/taoser/think-auth/README.md
+++ b/vendor/taoser/think-auth/README.md
@@ -1,11 +1,11 @@
# thinkphp-auth
-ThinkPHP6权限Auth扩展
+ThinkPHP8权限Auth扩展
## 安装
~~~php
-//thinkphp6.0
+//thinkphp8.0
composer require taoser/think-auth
~~~
diff --git a/vendor/taoser/think-auth/composer.json b/vendor/taoser/think-auth/composer.json
index 4df28de..9bf945b 100644
--- a/vendor/taoser/think-auth/composer.json
+++ b/vendor/taoser/think-auth/composer.json
@@ -1,7 +1,7 @@
{
"name": "taoser/think-auth",
"description": "The Auth package forThinkphp6,ThinkPHP6的Auth权限扩展",
- "keywords": ["think-auth", "thinkphp6"],
+ "keywords": ["think-auth", "thinkphp8"],
"homepage": "https://github.com/taoser/think-auth",
"license": "Apache-2.0",
"type": "think-extend",
@@ -12,8 +12,8 @@
}
],
"require": {
- "php": ">=7.1.0",
- "topthink/framework": "^6.0"
+ "php": ">=8.0.0",
+ "topthink/framework": "^8.0"
},
"autoload": {
"psr-4": {
diff --git a/vendor/taoser/think-setarr/README.md b/vendor/taoser/think-setarr/README.md
index 99f5cfb..ecb7fb0 100644
--- a/vendor/taoser/think-setarr/README.md
+++ b/vendor/taoser/think-setarr/README.md
@@ -218,4 +218,10 @@ $conf = SetArr::name('app')->delete($del);
```
+### 清理空数组
+
+```
+Set::name('app')->clearNullArr();
+```
+
详细参考 [作者](http://wiki.aieok.com)
\ No newline at end of file
diff --git a/vendor/taoser/think-setarr/src/SetArr.php b/vendor/taoser/think-setarr/src/SetArr.php
index 383562f..8c672cc 100644
--- a/vendor/taoser/think-setarr/src/SetArr.php
+++ b/vendor/taoser/think-setarr/src/SetArr.php
@@ -2,10 +2,10 @@
/*
* @Author: TaoLer
* @Date: 2022-04-14 16:05:35
- * @LastEditTime: 2022-05-09 11:31:00
+ * @LastEditTime: 2022-04-17 07:04:31
* @LastEditors: TaoLer
- * @Description: 搜索引擎SEO优化设置
- * @FilePath: \TaoLer\vendor\taoser\think-setarr\src\SetArr.php
+ * @Description: Config配置文件设置
+ * @FilePath: \undefinede:\github\think-setarr\src\SetArr.php
* Copyright (c) 2020~2022 https://www.aieok.com All rights reserved.
*/
namespace taoser;
@@ -219,7 +219,6 @@ class SetArr
//$kpats = '/\''.$k.'\'\s*=>\s*\[[^\[|\]]*,\r?\n/';
// 添加一维数组,数组中有元素匹配到最后一个数组,没有数组,匹配到数组开头[
$kpats = self::getArrSonCount(config(self::$configName.'.'.$k)) ? '/\''.$k.'\'\s*=>\s*\[[^\[|\]]*,\r?\n/' : '/\''.$k.'\'\s*=>\s*\[\r?\n/';
-
preg_match($kpats,self::$str,$arrk);
if(!is_int($kk)) {
@@ -785,18 +784,24 @@ class SetArr
}
}
- /* 匹配空数组
- * 'key' => [
- * ],
- */
- $nullArray = '/[^\n]*\'\w+\'\s*=>\s*\[\s*\]{1}\S*\,?\r?\n/m';
- //preg_match($nullArray,self::$str,$arr);
- //self::$str = preg_replace($nullArray, '', self::$str);
+ // 是否清理空数组?
}
//写入配置
return file_put_contents(self::$configFile, self::$str) ? true : false;
}
+
+ /* 匹配空数组
+ * 'key' => [
+ * ],
+ */
+ public static function clearNullArr()
+ {
+ $nullArray = '/[^\n]*\'\w+\'\s*=>\s*\[\s*\]{1}\S*\,?\r?\n/m';
+ //preg_match($nullArray,self::$str,$arr);
+ self::$str = preg_replace($nullArray, '', self::$str);
+ return file_put_contents(self::$configFile, self::$str) ? true : false;
+ }
/**
* 获取数组中子元素为数组的个数
diff --git a/vendor/tightenco/collect/.github/workflows/run-tests.yml b/vendor/tightenco/collect/.github/workflows/run-tests.yml
deleted file mode 100644
index 2a0d42f..0000000
--- a/vendor/tightenco/collect/.github/workflows/run-tests.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-name: Run tests
-
-on:
- push:
- branches: [laravel-9-ongoing, laravel-8-ongoing]
- pull_request:
-
-jobs:
- tests:
- strategy:
- matrix:
- os: [Ubuntu, macOS]
- php: [7.3, 7.4, 8.0, 8.1]
-
- include:
- - os: Ubuntu
- os-version: ubuntu-latest
-
- - os: macOS
- os-version: macos-latest
-
- name: ${{ matrix.os }} - PHP ${{ matrix.php }}
-
- runs-on: ${{ matrix.os-version }}
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v1
-
- - name: Setup PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: ${{ matrix.php }}
- extensions: posix, dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
- coverage: none
-
- - name: Install dependencies
- run: composer update --prefer-stable --prefer-dist --no-interaction
-
- - name: Run tests
- run: bash upgrade.sh
diff --git a/vendor/tightenco/collect/branch-commit-push.sh b/vendor/tightenco/collect/branch-commit-push.sh
deleted file mode 100644
index 124e583..0000000
--- a/vendor/tightenco/collect/branch-commit-push.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/bash
-
-
-GREEN='\033[0;32m'
-RED='\033[0;31m'
-WHITE='\033[0;37m'
-RESET='\033[0m'
-
-function validateVersion()
-{
- echo ""
- passedVersion=$1
- echo -e "${WHITE}-- Validating tag '$passedVersion'...${RESET}"
-
- # Todo: validate the version here using a regex; if fail, just exit
- # ... expect 8.75.0, with no v in front of it
-
- if [[ $passedVersion == '' ]]; then
- echo -e "\n-- Invalid tag. Tags should be structured without v; e.g. 8.57.0"
- exit
- fi
-
- echo -e "${WHITE}-- Tag valid.${RESET}"
- echo ""
-}
-
-# Exit script if any command fails (e.g. phpunit)
-set -e
-
-
-# Require confirmation it's set up corrctly
-echo
-echo -e "${WHITE}-- This script is meant to be run after running upgrade.sh, BEFORE committing to Git.${RESET}"
-
-while true; do
- echo -e "${GREEN}-- Is that the current state of your local project?${RESET}"
- read -p "-- (y/n) " yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer y or n.";;
- esac
-done
-
-# Get the version and exit if not valid
-validateVersion $1
-
-# Create official v prefaced version
-version="v$1"
-
-# Run tests (and bail if they fail)
-phpunit
-echo -e "\n${WHITE}-- Tests succeeded.${RESET}"
-
-# Branch
-echo -e "\n${WHITE}-- Creating a Git branch '$version-changes'...${RESET}\n"
-git checkout -b $version-changes
-
-# Add and commit, with "v8.57.0 changes" as the commit name
-git add -A
-git commit -m "$version changes"
-
-echo
-echo -e "${WHITE}-- Git committed.${RESET}"
-
-# Push
-git push -u origin $version-changes
diff --git a/vendor/tightenco/collect/composer.json b/vendor/tightenco/collect/composer.json
deleted file mode 100644
index 88ebb77..0000000
--- a/vendor/tightenco/collect/composer.json
+++ /dev/null
@@ -1,51 +0,0 @@
-{
- "name": "tightenco/collect",
- "description": "Collect - Illuminate Collections as a separate package.",
- "keywords": ["laravel", "collection"],
- "license": "MIT",
- "authors": [
- {
- "name": "Taylor Otwell",
- "email": "taylorotwell@gmail.com"
- }
- ],
- "require": {
- "php": "^7.3|^8.0",
- "symfony/var-dumper": "^3.4 || ^4.0 || ^5.0 || ^6.0"
- },
- "require-dev": {
- "mockery/mockery": "^1.0",
- "phpunit/phpunit": "^8.3",
- "nesbot/carbon": "^2.23.0"
- },
- "autoload": {
- "files": [
- "src/Collect/Support/helpers.php",
- "src/Collect/Support/alias.php"
- ],
- "psr-4": {
- "Tightenco\\Collect\\": "src/Collect"
- }
- },
- "autoload-dev": {
- "files": [
- "tests/files/Support/Carbon.php",
- "tests/files/Support/HtmlString.php",
- "tests/files/Support/HigherOrderTapProxy.php",
- "tests/files/Support/Str.php",
- "tests/files/Support/Traits/Conditionable.php",
- "tests/files/Support/Stringable.php",
- "tests/files/Support/ItemNotFoundException.php",
- "tests/files/Support/MultipleItemsFoundException.php",
- "tests/Support/Concerns/CountsEnumerations.php"
- ]
- },
- "scripts": {
- "test": [
- "@composer install",
- "phpunit"
- ]
- },
- "minimum-stability": "dev",
- "prefer-stable": true
-}
diff --git a/vendor/tightenco/collect/framework-.zip b/vendor/tightenco/collect/framework-.zip
deleted file mode 100644
index e69de29..0000000
diff --git a/vendor/tightenco/collect/src/Collect/Contracts/Support/Arrayable.php b/vendor/tightenco/collect/src/Collect/Contracts/Support/Arrayable.php
deleted file mode 100644
index a205804..0000000
--- a/vendor/tightenco/collect/src/Collect/Contracts/Support/Arrayable.php
+++ /dev/null
@@ -1,13 +0,0 @@
-all();
- } elseif (! is_array($values)) {
- continue;
- }
-
- $results[] = $values;
- }
-
- return array_merge([], ...$results);
- }
-
- /**
- * Cross join the given arrays, returning all possible permutations.
- *
- * @param iterable ...$arrays
- * @return array
- */
- public static function crossJoin(...$arrays)
- {
- $results = [[]];
-
- foreach ($arrays as $index => $array) {
- $append = [];
-
- foreach ($results as $product) {
- foreach ($array as $item) {
- $product[$index] = $item;
-
- $append[] = $product;
- }
- }
-
- $results = $append;
- }
-
- return $results;
- }
-
- /**
- * Divide an array into two arrays. One with keys and the other with values.
- *
- * @param array $array
- * @return array
- */
- public static function divide($array)
- {
- return [array_keys($array), array_values($array)];
- }
-
- /**
- * Flatten a multi-dimensional associative array with dots.
- *
- * @param iterable $array
- * @param string $prepend
- * @return array
- */
- public static function dot($array, $prepend = '')
- {
- $results = [];
-
- foreach ($array as $key => $value) {
- if (is_array($value) && ! empty($value)) {
- $results = array_merge($results, static::dot($value, $prepend.$key.'.'));
- } else {
- $results[$prepend.$key] = $value;
- }
- }
-
- return $results;
- }
-
- /**
- * Convert a flatten "dot" notation array into an expanded array.
- *
- * @param iterable $array
- * @return array
- */
- public static function undot($array)
- {
- $results = [];
-
- foreach ($array as $key => $value) {
- static::set($results, $key, $value);
- }
-
- return $results;
- }
-
- /**
- * Get all of the given array except for a specified array of keys.
- *
- * @param array $array
- * @param array|string $keys
- * @return array
- */
- public static function except($array, $keys)
- {
- static::forget($array, $keys);
-
- return $array;
- }
-
- /**
- * Determine if the given key exists in the provided array.
- *
- * @param \ArrayAccess|array $array
- * @param string|int $key
- * @return bool
- */
- public static function exists($array, $key)
- {
- if ($array instanceof Enumerable) {
- return $array->has($key);
- }
-
- if ($array instanceof ArrayAccess) {
- return $array->offsetExists($key);
- }
-
- return array_key_exists($key, $array);
- }
-
- /**
- * Return the first element in an array passing a given truth test.
- *
- * @param iterable $array
- * @param callable|null $callback
- * @param mixed $default
- * @return mixed
- */
- public static function first($array, callable $callback = null, $default = null)
- {
- if (is_null($callback)) {
- if (empty($array)) {
- return value($default);
- }
-
- foreach ($array as $item) {
- return $item;
- }
- }
-
- foreach ($array as $key => $value) {
- if ($callback($value, $key)) {
- return $value;
- }
- }
-
- return value($default);
- }
-
- /**
- * Return the last element in an array passing a given truth test.
- *
- * @param array $array
- * @param callable|null $callback
- * @param mixed $default
- * @return mixed
- */
- public static function last($array, callable $callback = null, $default = null)
- {
- if (is_null($callback)) {
- return empty($array) ? value($default) : end($array);
- }
-
- return static::first(array_reverse($array, true), $callback, $default);
- }
-
- /**
- * Flatten a multi-dimensional array into a single level.
- *
- * @param iterable $array
- * @param int $depth
- * @return array
- */
- public static function flatten($array, $depth = INF)
- {
- $result = [];
-
- foreach ($array as $item) {
- $item = $item instanceof Collection ? $item->all() : $item;
-
- if (! is_array($item)) {
- $result[] = $item;
- } else {
- $values = $depth === 1
- ? array_values($item)
- : static::flatten($item, $depth - 1);
-
- foreach ($values as $value) {
- $result[] = $value;
- }
- }
- }
-
- return $result;
- }
-
- /**
- * Remove one or many array items from a given array using "dot" notation.
- *
- * @param array $array
- * @param array|string $keys
- * @return void
- */
- public static function forget(&$array, $keys)
- {
- $original = &$array;
-
- $keys = (array) $keys;
-
- if (count($keys) === 0) {
- return;
- }
-
- foreach ($keys as $key) {
- // if the exact key exists in the top-level, remove it
- if (static::exists($array, $key)) {
- unset($array[$key]);
-
- continue;
- }
-
- $parts = explode('.', $key);
-
- // clean up before each pass
- $array = &$original;
-
- while (count($parts) > 1) {
- $part = array_shift($parts);
-
- if (isset($array[$part]) && is_array($array[$part])) {
- $array = &$array[$part];
- } else {
- continue 2;
- }
- }
-
- unset($array[array_shift($parts)]);
- }
- }
-
- /**
- * Get an item from an array using "dot" notation.
- *
- * @param \ArrayAccess|array $array
- * @param string|int|null $key
- * @param mixed $default
- * @return mixed
- */
- public static function get($array, $key, $default = null)
- {
- if (! static::accessible($array)) {
- return value($default);
- }
-
- if (is_null($key)) {
- return $array;
- }
-
- if (static::exists($array, $key)) {
- return $array[$key];
- }
-
- if (strpos($key, '.') === false) {
- return $array[$key] ?? value($default);
- }
-
- foreach (explode('.', $key) as $segment) {
- if (static::accessible($array) && static::exists($array, $segment)) {
- $array = $array[$segment];
- } else {
- return value($default);
- }
- }
-
- return $array;
- }
-
- /**
- * Check if an item or items exist in an array using "dot" notation.
- *
- * @param \ArrayAccess|array $array
- * @param string|array $keys
- * @return bool
- */
- public static function has($array, $keys)
- {
- $keys = (array) $keys;
-
- if (! $array || $keys === []) {
- return false;
- }
-
- foreach ($keys as $key) {
- $subKeyArray = $array;
-
- if (static::exists($array, $key)) {
- continue;
- }
-
- foreach (explode('.', $key) as $segment) {
- if (static::accessible($subKeyArray) && static::exists($subKeyArray, $segment)) {
- $subKeyArray = $subKeyArray[$segment];
- } else {
- return false;
- }
- }
- }
-
- return true;
- }
-
- /**
- * Determine if any of the keys exist in an array using "dot" notation.
- *
- * @param \ArrayAccess|array $array
- * @param string|array $keys
- * @return bool
- */
- public static function hasAny($array, $keys)
- {
- if (is_null($keys)) {
- return false;
- }
-
- $keys = (array) $keys;
-
- if (! $array) {
- return false;
- }
-
- if ($keys === []) {
- return false;
- }
-
- foreach ($keys as $key) {
- if (static::has($array, $key)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Determines if an array is associative.
- *
- * An array is "associative" if it doesn't have sequential numerical keys beginning with zero.
- *
- * @param array $array
- * @return bool
- */
- public static function isAssoc(array $array)
- {
- $keys = array_keys($array);
-
- return array_keys($keys) !== $keys;
- }
-
- /**
- * Determines if an array is a list.
- *
- * An array is a "list" if all array keys are sequential integers starting from 0 with no gaps in between.
- *
- * @param array $array
- * @return bool
- */
- public static function isList($array)
- {
- return ! self::isAssoc($array);
- }
-
- /**
- * Get a subset of the items from the given array.
- *
- * @param array $array
- * @param array|string $keys
- * @return array
- */
- public static function only($array, $keys)
- {
- return array_intersect_key($array, array_flip((array) $keys));
- }
-
- /**
- * Pluck an array of values from an array.
- *
- * @param iterable $array
- * @param string|array|int|null $value
- * @param string|array|null $key
- * @return array
- */
- public static function pluck($array, $value, $key = null)
- {
- $results = [];
-
- [$value, $key] = static::explodePluckParameters($value, $key);
-
- foreach ($array as $item) {
- $itemValue = data_get($item, $value);
-
- // If the key is "null", we will just append the value to the array and keep
- // looping. Otherwise we will key the array using the value of the key we
- // received from the developer. Then we'll return the final array form.
- if (is_null($key)) {
- $results[] = $itemValue;
- } else {
- $itemKey = data_get($item, $key);
-
- if (is_object($itemKey) && method_exists($itemKey, '__toString')) {
- $itemKey = (string) $itemKey;
- }
-
- $results[$itemKey] = $itemValue;
- }
- }
-
- return $results;
- }
-
- /**
- * Explode the "value" and "key" arguments passed to "pluck".
- *
- * @param string|array $value
- * @param string|array|null $key
- * @return array
- */
- protected static function explodePluckParameters($value, $key)
- {
- $value = is_string($value) ? explode('.', $value) : $value;
-
- $key = is_null($key) || is_array($key) ? $key : explode('.', $key);
-
- return [$value, $key];
- }
-
- /**
- * Push an item onto the beginning of an array.
- *
- * @param array $array
- * @param mixed $value
- * @param mixed $key
- * @return array
- */
- public static function prepend($array, $value, $key = null)
- {
- if (func_num_args() == 2) {
- array_unshift($array, $value);
- } else {
- $array = [$key => $value] + $array;
- }
-
- return $array;
- }
-
- /**
- * Get a value from the array, and remove it.
- *
- * @param array $array
- * @param string|int $key
- * @param mixed $default
- * @return mixed
- */
- public static function pull(&$array, $key, $default = null)
- {
- $value = static::get($array, $key, $default);
-
- static::forget($array, $key);
-
- return $value;
- }
-
- /**
- * Convert the array into a query string.
- *
- * @param array $array
- * @return string
- */
- public static function query($array)
- {
- return http_build_query($array, '', '&', PHP_QUERY_RFC3986);
- }
-
- /**
- * Get one or a specified number of random values from an array.
- *
- * @param array $array
- * @param int|null $number
- * @param bool|false $preserveKeys
- * @return mixed
- *
- * @throws \InvalidArgumentException
- */
- public static function random($array, $number = null, $preserveKeys = false)
- {
- $requested = is_null($number) ? 1 : $number;
-
- $count = count($array);
-
- if ($requested > $count) {
- throw new InvalidArgumentException(
- "You requested {$requested} items, but there are only {$count} items available."
- );
- }
-
- if (is_null($number)) {
- return $array[array_rand($array)];
- }
-
- if ((int) $number === 0) {
- return [];
- }
-
- $keys = array_rand($array, $number);
-
- $results = [];
-
- if ($preserveKeys) {
- foreach ((array) $keys as $key) {
- $results[$key] = $array[$key];
- }
- } else {
- foreach ((array) $keys as $key) {
- $results[] = $array[$key];
- }
- }
-
- return $results;
- }
-
- /**
- * Set an array item to a given value using "dot" notation.
- *
- * If no key is given to the method, the entire array will be replaced.
- *
- * @param array $array
- * @param string|null $key
- * @param mixed $value
- * @return array
- */
- public static function set(&$array, $key, $value)
- {
- if (is_null($key)) {
- return $array = $value;
- }
-
- $keys = explode('.', $key);
-
- foreach ($keys as $i => $key) {
- if (count($keys) === 1) {
- break;
- }
-
- unset($keys[$i]);
-
- // If the key doesn't exist at this depth, we will just create an empty array
- // to hold the next value, allowing us to create the arrays to hold final
- // values at the correct depth. Then we'll keep digging into the array.
- if (! isset($array[$key]) || ! is_array($array[$key])) {
- $array[$key] = [];
- }
-
- $array = &$array[$key];
- }
-
- $array[array_shift($keys)] = $value;
-
- return $array;
- }
-
- /**
- * Shuffle the given array and return the result.
- *
- * @param array $array
- * @param int|null $seed
- * @return array
- */
- public static function shuffle($array, $seed = null)
- {
- if (is_null($seed)) {
- shuffle($array);
- } else {
- mt_srand($seed);
- shuffle($array);
- mt_srand();
- }
-
- return $array;
- }
-
- /**
- * Sort the array using the given callback or "dot" notation.
- *
- * @param array $array
- * @param callable|array|string|null $callback
- * @return array
- */
- public static function sort($array, $callback = null)
- {
- return Collection::make($array)->sortBy($callback)->all();
- }
-
- /**
- * Recursively sort an array by keys and values.
- *
- * @param array $array
- * @param int $options
- * @param bool $descending
- * @return array
- */
- public static function sortRecursive($array, $options = SORT_REGULAR, $descending = false)
- {
- foreach ($array as &$value) {
- if (is_array($value)) {
- $value = static::sortRecursive($value, $options, $descending);
- }
- }
-
- if (static::isAssoc($array)) {
- $descending
- ? krsort($array, $options)
- : ksort($array, $options);
- } else {
- $descending
- ? rsort($array, $options)
- : sort($array, $options);
- }
-
- return $array;
- }
-
- /**
- * Conditionally compile classes from an array into a CSS class list.
- *
- * @param array $array
- * @return string
- */
- public static function toCssClasses($array)
- {
- $classList = static::wrap($array);
-
- $classes = [];
-
- foreach ($classList as $class => $constraint) {
- if (is_numeric($class)) {
- $classes[] = $constraint;
- } elseif ($constraint) {
- $classes[] = $class;
- }
- }
-
- return implode(' ', $classes);
- }
-
- /**
- * Filter the array using the given callback.
- *
- * @param array $array
- * @param callable $callback
- * @return array
- */
- public static function where($array, callable $callback)
- {
- return array_filter($array, $callback, ARRAY_FILTER_USE_BOTH);
- }
-
- /**
- * Filter items where the value is not null.
- *
- * @param array $array
- * @return array
- */
- public static function whereNotNull($array)
- {
- return static::where($array, function ($value) {
- return ! is_null($value);
- });
- }
-
- /**
- * If the given value is not an array and not null, wrap it in one.
- *
- * @param mixed $value
- * @return array
- */
- public static function wrap($value)
- {
- if (is_null($value)) {
- return [];
- }
-
- return is_array($value) ? $value : [$value];
- }
-}
diff --git a/vendor/tightenco/collect/src/Collect/Support/Collection.php b/vendor/tightenco/collect/src/Collect/Support/Collection.php
deleted file mode 100644
index 0dc7323..0000000
--- a/vendor/tightenco/collect/src/Collect/Support/Collection.php
+++ /dev/null
@@ -1,1672 +0,0 @@
-items = $this->getArrayableItems($items);
- }
-
- /**
- * Create a collection with the given range.
- *
- * @param int $from
- * @param int $to
- * @return static
- */
- public static function range($from, $to)
- {
- return new static(range($from, $to));
- }
-
- /**
- * Get all of the items in the collection.
- *
- * @return array
- */
- public function all()
- {
- return $this->items;
- }
-
- /**
- * Get a lazy collection for the items in this collection.
- *
- * @return \Tightenco\Collect\Support\LazyCollection
- */
- public function lazy()
- {
- return new LazyCollection($this->items);
- }
-
- /**
- * Get the average value of a given key.
- *
- * @param callable|string|null $callback
- * @return mixed
- */
- public function avg($callback = null)
- {
- $callback = $this->valueRetriever($callback);
-
- $items = $this->map(function ($value) use ($callback) {
- return $callback($value);
- })->filter(function ($value) {
- return ! is_null($value);
- });
-
- if ($count = $items->count()) {
- return $items->sum() / $count;
- }
- }
-
- /**
- * Get the median of a given key.
- *
- * @param string|array|null $key
- * @return mixed
- */
- public function median($key = null)
- {
- $values = (isset($key) ? $this->pluck($key) : $this)
- ->filter(function ($item) {
- return ! is_null($item);
- })->sort()->values();
-
- $count = $values->count();
-
- if ($count === 0) {
- return;
- }
-
- $middle = (int) ($count / 2);
-
- if ($count % 2) {
- return $values->get($middle);
- }
-
- return (new static([
- $values->get($middle - 1), $values->get($middle),
- ]))->average();
- }
-
- /**
- * Get the mode of a given key.
- *
- * @param string|array|null $key
- * @return array|null
- */
- public function mode($key = null)
- {
- if ($this->count() === 0) {
- return;
- }
-
- $collection = isset($key) ? $this->pluck($key) : $this;
-
- $counts = new static;
-
- $collection->each(function ($value) use ($counts) {
- $counts[$value] = isset($counts[$value]) ? $counts[$value] + 1 : 1;
- });
-
- $sorted = $counts->sort();
-
- $highestValue = $sorted->last();
-
- return $sorted->filter(function ($value) use ($highestValue) {
- return $value == $highestValue;
- })->sort()->keys()->all();
- }
-
- /**
- * Collapse the collection of items into a single array.
- *
- * @return static
- */
- public function collapse()
- {
- return new static(Arr::collapse($this->items));
- }
-
- /**
- * Determine if an item exists in the collection.
- *
- * @param mixed $key
- * @param mixed $operator
- * @param mixed $value
- * @return bool
- */
- public function contains($key, $operator = null, $value = null)
- {
- if (func_num_args() === 1) {
- if ($this->useAsCallable($key)) {
- $placeholder = new stdClass;
-
- return $this->first($key, $placeholder) !== $placeholder;
- }
-
- return in_array($key, $this->items);
- }
-
- return $this->contains($this->operatorForWhere(...func_get_args()));
- }
-
- /**
- * Determine if an item is not contained in the collection.
- *
- * @param mixed $key
- * @param mixed $operator
- * @param mixed $value
- * @return bool
- */
- public function doesntContain($key, $operator = null, $value = null)
- {
- return ! $this->contains(...func_get_args());
- }
-
- /**
- * Cross join with the given lists, returning all possible permutations.
- *
- * @param mixed ...$lists
- * @return static
- */
- public function crossJoin(...$lists)
- {
- return new static(Arr::crossJoin(
- $this->items, ...array_map([$this, 'getArrayableItems'], $lists)
- ));
- }
-
- /**
- * Get the items in the collection that are not present in the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function diff($items)
- {
- return new static(array_diff($this->items, $this->getArrayableItems($items)));
- }
-
- /**
- * Get the items in the collection that are not present in the given items, using the callback.
- *
- * @param mixed $items
- * @param callable $callback
- * @return static
- */
- public function diffUsing($items, callable $callback)
- {
- return new static(array_udiff($this->items, $this->getArrayableItems($items), $callback));
- }
-
- /**
- * Get the items in the collection whose keys and values are not present in the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function diffAssoc($items)
- {
- return new static(array_diff_assoc($this->items, $this->getArrayableItems($items)));
- }
-
- /**
- * Get the items in the collection whose keys and values are not present in the given items, using the callback.
- *
- * @param mixed $items
- * @param callable $callback
- * @return static
- */
- public function diffAssocUsing($items, callable $callback)
- {
- return new static(array_diff_uassoc($this->items, $this->getArrayableItems($items), $callback));
- }
-
- /**
- * Get the items in the collection whose keys are not present in the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function diffKeys($items)
- {
- return new static(array_diff_key($this->items, $this->getArrayableItems($items)));
- }
-
- /**
- * Get the items in the collection whose keys are not present in the given items, using the callback.
- *
- * @param mixed $items
- * @param callable $callback
- * @return static
- */
- public function diffKeysUsing($items, callable $callback)
- {
- return new static(array_diff_ukey($this->items, $this->getArrayableItems($items), $callback));
- }
-
- /**
- * Retrieve duplicate items from the collection.
- *
- * @param callable|string|null $callback
- * @param bool $strict
- * @return static
- */
- public function duplicates($callback = null, $strict = false)
- {
- $items = $this->map($this->valueRetriever($callback));
-
- $uniqueItems = $items->unique(null, $strict);
-
- $compare = $this->duplicateComparator($strict);
-
- $duplicates = new static;
-
- foreach ($items as $key => $value) {
- if ($uniqueItems->isNotEmpty() && $compare($value, $uniqueItems->first())) {
- $uniqueItems->shift();
- } else {
- $duplicates[$key] = $value;
- }
- }
-
- return $duplicates;
- }
-
- /**
- * Retrieve duplicate items from the collection using strict comparison.
- *
- * @param callable|string|null $callback
- * @return static
- */
- public function duplicatesStrict($callback = null)
- {
- return $this->duplicates($callback, true);
- }
-
- /**
- * Get the comparison function to detect duplicates.
- *
- * @param bool $strict
- * @return \Closure
- */
- protected function duplicateComparator($strict)
- {
- if ($strict) {
- return function ($a, $b) {
- return $a === $b;
- };
- }
-
- return function ($a, $b) {
- return $a == $b;
- };
- }
-
- /**
- * Get all items except for those with the specified keys.
- *
- * @param \Tightenco\Collect\Support\Collection|mixed $keys
- * @return static
- */
- public function except($keys)
- {
- if ($keys instanceof Enumerable) {
- $keys = $keys->all();
- } elseif (! is_array($keys)) {
- $keys = func_get_args();
- }
-
- return new static(Arr::except($this->items, $keys));
- }
-
- /**
- * Run a filter over each of the items.
- *
- * @param callable|null $callback
- * @return static
- */
- public function filter(callable $callback = null)
- {
- if ($callback) {
- return new static(Arr::where($this->items, $callback));
- }
-
- return new static(array_filter($this->items));
- }
-
- /**
- * Get the first item from the collection passing the given truth test.
- *
- * @param callable|null $callback
- * @param mixed $default
- * @return mixed
- */
- public function first(callable $callback = null, $default = null)
- {
- return Arr::first($this->items, $callback, $default);
- }
-
- /**
- * Get a flattened array of the items in the collection.
- *
- * @param int $depth
- * @return static
- */
- public function flatten($depth = INF)
- {
- return new static(Arr::flatten($this->items, $depth));
- }
-
- /**
- * Flip the items in the collection.
- *
- * @return static
- */
- public function flip()
- {
- return new static(array_flip($this->items));
- }
-
- /**
- * Remove an item from the collection by key.
- *
- * @param string|int|array $keys
- * @return $this
- */
- public function forget($keys)
- {
- foreach ((array) $keys as $key) {
- $this->offsetUnset($key);
- }
-
- return $this;
- }
-
- /**
- * Get an item from the collection by key.
- *
- * @param mixed $key
- * @param mixed $default
- * @return mixed
- */
- public function get($key, $default = null)
- {
- if (array_key_exists($key, $this->items)) {
- return $this->items[$key];
- }
-
- return value($default);
- }
-
- /**
- * Get an item from the collection by key or add it to collection if it does not exist.
- *
- * @param mixed $key
- * @param mixed $value
- * @return mixed
- */
- public function getOrPut($key, $value)
- {
- if (array_key_exists($key, $this->items)) {
- return $this->items[$key];
- }
-
- $this->offsetSet($key, $value = value($value));
-
- return $value;
- }
-
- /**
- * Group an associative array by a field or using a callback.
- *
- * @param array|callable|string $groupBy
- * @param bool $preserveKeys
- * @return static
- */
- public function groupBy($groupBy, $preserveKeys = false)
- {
- if (! $this->useAsCallable($groupBy) && is_array($groupBy)) {
- $nextGroups = $groupBy;
-
- $groupBy = array_shift($nextGroups);
- }
-
- $groupBy = $this->valueRetriever($groupBy);
-
- $results = [];
-
- foreach ($this->items as $key => $value) {
- $groupKeys = $groupBy($value, $key);
-
- if (! is_array($groupKeys)) {
- $groupKeys = [$groupKeys];
- }
-
- foreach ($groupKeys as $groupKey) {
- $groupKey = is_bool($groupKey) ? (int) $groupKey : $groupKey;
-
- if (! array_key_exists($groupKey, $results)) {
- $results[$groupKey] = new static;
- }
-
- $results[$groupKey]->offsetSet($preserveKeys ? $key : null, $value);
- }
- }
-
- $result = new static($results);
-
- if (! empty($nextGroups)) {
- return $result->map->groupBy($nextGroups, $preserveKeys);
- }
-
- return $result;
- }
-
- /**
- * Key an associative array by a field or using a callback.
- *
- * @param callable|string $keyBy
- * @return static
- */
- public function keyBy($keyBy)
- {
- $keyBy = $this->valueRetriever($keyBy);
-
- $results = [];
-
- foreach ($this->items as $key => $item) {
- $resolvedKey = $keyBy($item, $key);
-
- if (is_object($resolvedKey)) {
- $resolvedKey = (string) $resolvedKey;
- }
-
- $results[$resolvedKey] = $item;
- }
-
- return new static($results);
- }
-
- /**
- * Determine if an item exists in the collection by key.
- *
- * @param mixed $key
- * @return bool
- */
- public function has($key)
- {
- $keys = is_array($key) ? $key : func_get_args();
-
- foreach ($keys as $value) {
- if (! array_key_exists($value, $this->items)) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Determine if any of the keys exist in the collection.
- *
- * @param mixed $key
- * @return bool
- */
- public function hasAny($key)
- {
- if ($this->isEmpty()) {
- return false;
- }
-
- $keys = is_array($key) ? $key : func_get_args();
-
- foreach ($keys as $value) {
- if ($this->has($value)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Concatenate values of a given key as a string.
- *
- * @param string $value
- * @param string|null $glue
- * @return string
- */
- public function implode($value, $glue = null)
- {
- $first = $this->first();
-
- if (is_array($first) || (is_object($first) && ! $first instanceof \Illuminate\Support\Stringable)) {
- return implode($glue ?? '', $this->pluck($value)->all());
- }
-
- return implode($value ?? '', $this->items);
- }
-
- /**
- * Intersect the collection with the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function intersect($items)
- {
- return new static(array_intersect($this->items, $this->getArrayableItems($items)));
- }
-
- /**
- * Intersect the collection with the given items by key.
- *
- * @param mixed $items
- * @return static
- */
- public function intersectByKeys($items)
- {
- return new static(array_intersect_key(
- $this->items, $this->getArrayableItems($items)
- ));
- }
-
- /**
- * Determine if the collection is empty or not.
- *
- * @return bool
- */
- public function isEmpty()
- {
- return empty($this->items);
- }
-
- /**
- * Determine if the collection contains a single item.
- *
- * @return bool
- */
- public function containsOneItem()
- {
- return $this->count() === 1;
- }
-
- /**
- * Join all items from the collection using a string. The final items can use a separate glue string.
- *
- * @param string $glue
- * @param string $finalGlue
- * @return string
- */
- public function join($glue, $finalGlue = '')
- {
- if ($finalGlue === '') {
- return $this->implode($glue);
- }
-
- $count = $this->count();
-
- if ($count === 0) {
- return '';
- }
-
- if ($count === 1) {
- return $this->last();
- }
-
- $collection = new static($this->items);
-
- $finalItem = $collection->pop();
-
- return $collection->implode($glue).$finalGlue.$finalItem;
- }
-
- /**
- * Get the keys of the collection items.
- *
- * @return static
- */
- public function keys()
- {
- return new static(array_keys($this->items));
- }
-
- /**
- * Get the last item from the collection.
- *
- * @param callable|null $callback
- * @param mixed $default
- * @return mixed
- */
- public function last(callable $callback = null, $default = null)
- {
- return Arr::last($this->items, $callback, $default);
- }
-
- /**
- * Get the values of a given key.
- *
- * @param string|array|int|null $value
- * @param string|null $key
- * @return static
- */
- public function pluck($value, $key = null)
- {
- return new static(Arr::pluck($this->items, $value, $key));
- }
-
- /**
- * Run a map over each of the items.
- *
- * @param callable $callback
- * @return static
- */
- public function map(callable $callback)
- {
- $keys = array_keys($this->items);
-
- $items = array_map($callback, $this->items, $keys);
-
- return new static(array_combine($keys, $items));
- }
-
- /**
- * Run a dictionary map over the items.
- *
- * The callback should return an associative array with a single key/value pair.
- *
- * @param callable $callback
- * @return static
- */
- public function mapToDictionary(callable $callback)
- {
- $dictionary = [];
-
- foreach ($this->items as $key => $item) {
- $pair = $callback($item, $key);
-
- $key = key($pair);
-
- $value = reset($pair);
-
- if (! isset($dictionary[$key])) {
- $dictionary[$key] = [];
- }
-
- $dictionary[$key][] = $value;
- }
-
- return new static($dictionary);
- }
-
- /**
- * Run an associative map over each of the items.
- *
- * The callback should return an associative array with a single key/value pair.
- *
- * @param callable $callback
- * @return static
- */
- public function mapWithKeys(callable $callback)
- {
- $result = [];
-
- foreach ($this->items as $key => $value) {
- $assoc = $callback($value, $key);
-
- foreach ($assoc as $mapKey => $mapValue) {
- $result[$mapKey] = $mapValue;
- }
- }
-
- return new static($result);
- }
-
- /**
- * Merge the collection with the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function merge($items)
- {
- return new static(array_merge($this->items, $this->getArrayableItems($items)));
- }
-
- /**
- * Recursively merge the collection with the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function mergeRecursive($items)
- {
- return new static(array_merge_recursive($this->items, $this->getArrayableItems($items)));
- }
-
- /**
- * Create a collection by using this collection for keys and another for its values.
- *
- * @param mixed $values
- * @return static
- */
- public function combine($values)
- {
- return new static(array_combine($this->all(), $this->getArrayableItems($values)));
- }
-
- /**
- * Union the collection with the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function union($items)
- {
- return new static($this->items + $this->getArrayableItems($items));
- }
-
- /**
- * Create a new collection consisting of every n-th element.
- *
- * @param int $step
- * @param int $offset
- * @return static
- */
- public function nth($step, $offset = 0)
- {
- $new = [];
-
- $position = 0;
-
- foreach ($this->slice($offset)->items as $item) {
- if ($position % $step === 0) {
- $new[] = $item;
- }
-
- $position++;
- }
-
- return new static($new);
- }
-
- /**
- * Get the items with the specified keys.
- *
- * @param mixed $keys
- * @return static
- */
- public function only($keys)
- {
- if (is_null($keys)) {
- return new static($this->items);
- }
-
- if ($keys instanceof Enumerable) {
- $keys = $keys->all();
- }
-
- $keys = is_array($keys) ? $keys : func_get_args();
-
- return new static(Arr::only($this->items, $keys));
- }
-
- /**
- * Get and remove the last N items from the collection.
- *
- * @param int $count
- * @return mixed
- */
- public function pop($count = 1)
- {
- if ($count === 1) {
- return array_pop($this->items);
- }
-
- if ($this->isEmpty()) {
- return new static;
- }
-
- $results = [];
-
- $collectionCount = $this->count();
-
- foreach (range(1, min($count, $collectionCount)) as $item) {
- array_push($results, array_pop($this->items));
- }
-
- return new static($results);
- }
-
- /**
- * Push an item onto the beginning of the collection.
- *
- * @param mixed $value
- * @param mixed $key
- * @return $this
- */
- public function prepend($value, $key = null)
- {
- $this->items = Arr::prepend($this->items, ...func_get_args());
-
- return $this;
- }
-
- /**
- * Push one or more items onto the end of the collection.
- *
- * @param mixed $values
- * @return $this
- */
- public function push(...$values)
- {
- foreach ($values as $value) {
- $this->items[] = $value;
- }
-
- return $this;
- }
-
- /**
- * Push all of the given items onto the collection.
- *
- * @param iterable $source
- * @return static
- */
- public function concat($source)
- {
- $result = new static($this);
-
- foreach ($source as $item) {
- $result->push($item);
- }
-
- return $result;
- }
-
- /**
- * Get and remove an item from the collection.
- *
- * @param mixed $key
- * @param mixed $default
- * @return mixed
- */
- public function pull($key, $default = null)
- {
- return Arr::pull($this->items, $key, $default);
- }
-
- /**
- * Put an item in the collection by key.
- *
- * @param mixed $key
- * @param mixed $value
- * @return $this
- */
- public function put($key, $value)
- {
- $this->offsetSet($key, $value);
-
- return $this;
- }
-
- /**
- * Get one or a specified number of items randomly from the collection.
- *
- * @param int|null $number
- * @return static|mixed
- *
- * @throws \InvalidArgumentException
- */
- public function random($number = null)
- {
- if (is_null($number)) {
- return Arr::random($this->items);
- }
-
- return new static(Arr::random($this->items, $number));
- }
-
- /**
- * Replace the collection items with the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function replace($items)
- {
- return new static(array_replace($this->items, $this->getArrayableItems($items)));
- }
-
- /**
- * Recursively replace the collection items with the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function replaceRecursive($items)
- {
- return new static(array_replace_recursive($this->items, $this->getArrayableItems($items)));
- }
-
- /**
- * Reverse items order.
- *
- * @return static
- */
- public function reverse()
- {
- return new static(array_reverse($this->items, true));
- }
-
- /**
- * Search the collection for a given value and return the corresponding key if successful.
- *
- * @param mixed $value
- * @param bool $strict
- * @return mixed
- */
- public function search($value, $strict = false)
- {
- if (! $this->useAsCallable($value)) {
- return array_search($value, $this->items, $strict);
- }
-
- foreach ($this->items as $key => $item) {
- if ($value($item, $key)) {
- return $key;
- }
- }
-
- return false;
- }
-
- /**
- * Get and remove the first N items from the collection.
- *
- * @param int $count
- * @return mixed
- */
- public function shift($count = 1)
- {
- if ($count === 1) {
- return array_shift($this->items);
- }
-
- if ($this->isEmpty()) {
- return new static;
- }
-
- $results = [];
-
- $collectionCount = $this->count();
-
- foreach (range(1, min($count, $collectionCount)) as $item) {
- array_push($results, array_shift($this->items));
- }
-
- return new static($results);
- }
-
- /**
- * Shuffle the items in the collection.
- *
- * @param int|null $seed
- * @return static
- */
- public function shuffle($seed = null)
- {
- return new static(Arr::shuffle($this->items, $seed));
- }
-
- /**
- * Create chunks representing a "sliding window" view of the items in the collection.
- *
- * @param int $size
- * @param int $step
- * @return static
- */
- public function sliding($size = 2, $step = 1)
- {
- $chunks = floor(($this->count() - $size) / $step) + 1;
-
- return static::times($chunks, function ($number) use ($size, $step) {
- return $this->slice(($number - 1) * $step, $size);
- });
- }
-
- /**
- * Skip the first {$count} items.
- *
- * @param int $count
- * @return static
- */
- public function skip($count)
- {
- return $this->slice($count);
- }
-
- /**
- * Skip items in the collection until the given condition is met.
- *
- * @param mixed $value
- * @return static
- */
- public function skipUntil($value)
- {
- return new static($this->lazy()->skipUntil($value)->all());
- }
-
- /**
- * Skip items in the collection while the given condition is met.
- *
- * @param mixed $value
- * @return static
- */
- public function skipWhile($value)
- {
- return new static($this->lazy()->skipWhile($value)->all());
- }
-
- /**
- * Slice the underlying collection array.
- *
- * @param int $offset
- * @param int|null $length
- * @return static
- */
- public function slice($offset, $length = null)
- {
- return new static(array_slice($this->items, $offset, $length, true));
- }
-
- /**
- * Split a collection into a certain number of groups.
- *
- * @param int $numberOfGroups
- * @return static
- */
- public function split($numberOfGroups)
- {
- if ($this->isEmpty()) {
- return new static;
- }
-
- $groups = new static;
-
- $groupSize = floor($this->count() / $numberOfGroups);
-
- $remain = $this->count() % $numberOfGroups;
-
- $start = 0;
-
- for ($i = 0; $i < $numberOfGroups; $i++) {
- $size = $groupSize;
-
- if ($i < $remain) {
- $size++;
- }
-
- if ($size) {
- $groups->push(new static(array_slice($this->items, $start, $size)));
-
- $start += $size;
- }
- }
-
- return $groups;
- }
-
- /**
- * Split a collection into a certain number of groups, and fill the first groups completely.
- *
- * @param int $numberOfGroups
- * @return static
- */
- public function splitIn($numberOfGroups)
- {
- return $this->chunk(ceil($this->count() / $numberOfGroups));
- }
-
- /**
- * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception.
- *
- * @param mixed $key
- * @param mixed $operator
- * @param mixed $value
- * @return mixed
- *
- * @throws \Tightenco\Collect\Support\ItemNotFoundException
- * @throws \Tightenco\Collect\Support\MultipleItemsFoundException
- */
- public function sole($key = null, $operator = null, $value = null)
- {
- $filter = func_num_args() > 1
- ? $this->operatorForWhere(...func_get_args())
- : $key;
-
- $items = $this->when($filter)->filter($filter);
-
- if ($items->isEmpty()) {
- throw new ItemNotFoundException;
- }
-
- if ($items->count() > 1) {
- throw new MultipleItemsFoundException;
- }
-
- return $items->first();
- }
-
- /**
- * Get the first item in the collection but throw an exception if no matching items exist.
- *
- * @param mixed $key
- * @param mixed $operator
- * @param mixed $value
- * @return mixed
- *
- * @throws \Tightenco\Collect\Support\ItemNotFoundException
- */
- public function firstOrFail($key = null, $operator = null, $value = null)
- {
- $filter = func_num_args() > 1
- ? $this->operatorForWhere(...func_get_args())
- : $key;
-
- $placeholder = new stdClass();
-
- $item = $this->first($filter, $placeholder);
-
- if ($item === $placeholder) {
- throw new ItemNotFoundException;
- }
-
- return $item;
- }
-
- /**
- * Chunk the collection into chunks of the given size.
- *
- * @param int $size
- * @return static
- */
- public function chunk($size)
- {
- if ($size <= 0) {
- return new static;
- }
-
- $chunks = [];
-
- foreach (array_chunk($this->items, $size, true) as $chunk) {
- $chunks[] = new static($chunk);
- }
-
- return new static($chunks);
- }
-
- /**
- * Chunk the collection into chunks with a callback.
- *
- * @param callable $callback
- * @return static
- */
- public function chunkWhile(callable $callback)
- {
- return new static(
- $this->lazy()->chunkWhile($callback)->mapInto(static::class)
- );
- }
-
- /**
- * Sort through each item with a callback.
- *
- * @param callable|int|null $callback
- * @return static
- */
- public function sort($callback = null)
- {
- $items = $this->items;
-
- $callback && is_callable($callback)
- ? uasort($items, $callback)
- : asort($items, $callback ?? SORT_REGULAR);
-
- return new static($items);
- }
-
- /**
- * Sort items in descending order.
- *
- * @param int $options
- * @return static
- */
- public function sortDesc($options = SORT_REGULAR)
- {
- $items = $this->items;
-
- arsort($items, $options);
-
- return new static($items);
- }
-
- /**
- * Sort the collection using the given callback.
- *
- * @param callable|array|string $callback
- * @param int $options
- * @param bool $descending
- * @return static
- */
- public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
- {
- if (is_array($callback) && ! is_callable($callback)) {
- return $this->sortByMany($callback);
- }
-
- $results = [];
-
- $callback = $this->valueRetriever($callback);
-
- // First we will loop through the items and get the comparator from a callback
- // function which we were given. Then, we will sort the returned values and
- // grab all the corresponding values for the sorted keys from this array.
- foreach ($this->items as $key => $value) {
- $results[$key] = $callback($value, $key);
- }
-
- $descending ? arsort($results, $options)
- : asort($results, $options);
-
- // Once we have sorted all of the keys in the array, we will loop through them
- // and grab the corresponding model so we can set the underlying items list
- // to the sorted version. Then we'll just return the collection instance.
- foreach (array_keys($results) as $key) {
- $results[$key] = $this->items[$key];
- }
-
- return new static($results);
- }
-
- /**
- * Sort the collection using multiple comparisons.
- *
- * @param array $comparisons
- * @return static
- */
- protected function sortByMany(array $comparisons = [])
- {
- $items = $this->items;
-
- usort($items, function ($a, $b) use ($comparisons) {
- foreach ($comparisons as $comparison) {
- $comparison = Arr::wrap($comparison);
-
- $prop = $comparison[0];
-
- $ascending = Arr::get($comparison, 1, true) === true ||
- Arr::get($comparison, 1, true) === 'asc';
-
- $result = 0;
-
- if (! is_string($prop) && is_callable($prop)) {
- $result = $prop($a, $b);
- } else {
- $values = [data_get($a, $prop), data_get($b, $prop)];
-
- if (! $ascending) {
- $values = array_reverse($values);
- }
-
- $result = $values[0] <=> $values[1];
- }
-
- if ($result === 0) {
- continue;
- }
-
- return $result;
- }
- });
-
- return new static($items);
- }
-
- /**
- * Sort the collection in descending order using the given callback.
- *
- * @param callable|string $callback
- * @param int $options
- * @return static
- */
- public function sortByDesc($callback, $options = SORT_REGULAR)
- {
- return $this->sortBy($callback, $options, true);
- }
-
- /**
- * Sort the collection keys.
- *
- * @param int $options
- * @param bool $descending
- * @return static
- */
- public function sortKeys($options = SORT_REGULAR, $descending = false)
- {
- $items = $this->items;
-
- $descending ? krsort($items, $options) : ksort($items, $options);
-
- return new static($items);
- }
-
- /**
- * Sort the collection keys in descending order.
- *
- * @param int $options
- * @return static
- */
- public function sortKeysDesc($options = SORT_REGULAR)
- {
- return $this->sortKeys($options, true);
- }
-
- /**
- * Sort the collection keys using a callback.
- *
- * @param callable $callback
- * @return static
- */
- public function sortKeysUsing(callable $callback)
- {
- $items = $this->items;
-
- uksort($items, $callback);
-
- return new static($items);
- }
-
- /**
- * Splice a portion of the underlying collection array.
- *
- * @param int $offset
- * @param int|null $length
- * @param mixed $replacement
- * @return static
- */
- public function splice($offset, $length = null, $replacement = [])
- {
- if (func_num_args() === 1) {
- return new static(array_splice($this->items, $offset));
- }
-
- return new static(array_splice($this->items, $offset, $length, $this->getArrayableItems($replacement)));
- }
-
- /**
- * Take the first or last {$limit} items.
- *
- * @param int $limit
- * @return static
- */
- public function take($limit)
- {
- if ($limit < 0) {
- return $this->slice($limit, abs($limit));
- }
-
- return $this->slice(0, $limit);
- }
-
- /**
- * Take items in the collection until the given condition is met.
- *
- * @param mixed $value
- * @return static
- */
- public function takeUntil($value)
- {
- return new static($this->lazy()->takeUntil($value)->all());
- }
-
- /**
- * Take items in the collection while the given condition is met.
- *
- * @param mixed $value
- * @return static
- */
- public function takeWhile($value)
- {
- return new static($this->lazy()->takeWhile($value)->all());
- }
-
- /**
- * Transform each item in the collection using a callback.
- *
- * @param callable $callback
- * @return $this
- */
- public function transform(callable $callback)
- {
- $this->items = $this->map($callback)->all();
-
- return $this;
- }
-
- /**
- * Convert a flatten "dot" notation array into an expanded array.
- *
- * @return static
- */
- public function undot()
- {
- return new static(Arr::undot($this->all()));
- }
-
- /**
- * Return only unique items from the collection array.
- *
- * @param string|callable|null $key
- * @param bool $strict
- * @return static
- */
- public function unique($key = null, $strict = false)
- {
- if (is_null($key) && $strict === false) {
- return new static(array_unique($this->items, SORT_REGULAR));
- }
-
- $callback = $this->valueRetriever($key);
-
- $exists = [];
-
- return $this->reject(function ($item, $key) use ($callback, $strict, &$exists) {
- if (in_array($id = $callback($item, $key), $exists, $strict)) {
- return true;
- }
-
- $exists[] = $id;
- });
- }
-
- /**
- * Reset the keys on the underlying array.
- *
- * @return static
- */
- public function values()
- {
- return new static(array_values($this->items));
- }
-
- /**
- * Zip the collection together with one or more arrays.
- *
- * e.g. new Collection([1, 2, 3])->zip([4, 5, 6]);
- * => [[1, 4], [2, 5], [3, 6]]
- *
- * @param mixed ...$items
- * @return static
- */
- public function zip($items)
- {
- $arrayableItems = array_map(function ($items) {
- return $this->getArrayableItems($items);
- }, func_get_args());
-
- $params = array_merge([function () {
- return new static(func_get_args());
- }, $this->items], $arrayableItems);
-
- return new static(array_map(...$params));
- }
-
- /**
- * Pad collection to the specified length with a value.
- *
- * @param int $size
- * @param mixed $value
- * @return static
- */
- public function pad($size, $value)
- {
- return new static(array_pad($this->items, $size, $value));
- }
-
- /**
- * Get an iterator for the items.
- *
- * @return \ArrayIterator
- */
- #[\ReturnTypeWillChange]
- public function getIterator()
- {
- return new ArrayIterator($this->items);
- }
-
- /**
- * Count the number of items in the collection.
- *
- * @return int
- */
- #[\ReturnTypeWillChange]
- public function count()
- {
- return count($this->items);
- }
-
- /**
- * Count the number of items in the collection by a field or using a callback.
- *
- * @param callable|string $countBy
- * @return static
- */
- public function countBy($countBy = null)
- {
- return new static($this->lazy()->countBy($countBy)->all());
- }
-
- /**
- * Add an item to the collection.
- *
- * @param mixed $item
- * @return $this
- */
- public function add($item)
- {
- $this->items[] = $item;
-
- return $this;
- }
-
- /**
- * Get a base Support collection instance from this collection.
- *
- * @return \Tightenco\Collect\Support\Collection
- */
- public function toBase()
- {
- return new self($this);
- }
-
- /**
- * Determine if an item exists at an offset.
- *
- * @param mixed $key
- * @return bool
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($key)
- {
- return isset($this->items[$key]);
- }
-
- /**
- * Get an item at a given offset.
- *
- * @param mixed $key
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($key)
- {
- return $this->items[$key];
- }
-
- /**
- * Set the item at a given offset.
- *
- * @param mixed $key
- * @param mixed $value
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($key, $value)
- {
- if (is_null($key)) {
- $this->items[] = $value;
- } else {
- $this->items[$key] = $value;
- }
- }
-
- /**
- * Unset the item at a given offset.
- *
- * @param mixed $key
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($key)
- {
- unset($this->items[$key]);
- }
-}
diff --git a/vendor/tightenco/collect/src/Collect/Support/Enumerable.php b/vendor/tightenco/collect/src/Collect/Support/Enumerable.php
deleted file mode 100644
index 60af386..0000000
--- a/vendor/tightenco/collect/src/Collect/Support/Enumerable.php
+++ /dev/null
@@ -1,1027 +0,0 @@
-zip([4, 5, 6]);
- * => [[1, 4], [2, 5], [3, 6]]
- *
- * @param mixed ...$items
- * @return static
- */
- public function zip($items);
-
- /**
- * Collect the values into a collection.
- *
- * @return \Tightenco\Collect\Support\Collection
- */
- public function collect();
-
- /**
- * Convert the collection to its string representation.
- *
- * @return string
- */
- public function __toString();
-
- /**
- * Add a method to the list of proxied methods.
- *
- * @param string $method
- * @return void
- */
- public static function proxy($method);
-
- /**
- * Dynamically access collection proxies.
- *
- * @param string $key
- * @return mixed
- *
- * @throws \Exception
- */
- public function __get($key);
-}
diff --git a/vendor/tightenco/collect/src/Collect/Support/HigherOrderCollectionProxy.php b/vendor/tightenco/collect/src/Collect/Support/HigherOrderCollectionProxy.php
deleted file mode 100644
index 01ac43f..0000000
--- a/vendor/tightenco/collect/src/Collect/Support/HigherOrderCollectionProxy.php
+++ /dev/null
@@ -1,63 +0,0 @@
-method = $method;
- $this->collection = $collection;
- }
-
- /**
- * Proxy accessing an attribute onto the collection items.
- *
- * @param string $key
- * @return mixed
- */
- public function __get($key)
- {
- return $this->collection->{$this->method}(function ($value) use ($key) {
- return is_array($value) ? $value[$key] : $value->{$key};
- });
- }
-
- /**
- * Proxy a method call onto the collection items.
- *
- * @param string $method
- * @param array $parameters
- * @return mixed
- */
- public function __call($method, $parameters)
- {
- return $this->collection->{$this->method}(function ($value) use ($method, $parameters) {
- return $value->{$method}(...$parameters);
- });
- }
-}
diff --git a/vendor/tightenco/collect/src/Collect/Support/HigherOrderWhenProxy.php b/vendor/tightenco/collect/src/Collect/Support/HigherOrderWhenProxy.php
deleted file mode 100644
index ea48c7c..0000000
--- a/vendor/tightenco/collect/src/Collect/Support/HigherOrderWhenProxy.php
+++ /dev/null
@@ -1,63 +0,0 @@
-condition = $condition;
- $this->collection = $collection;
- }
-
- /**
- * Proxy accessing an attribute onto the collection.
- *
- * @param string $key
- * @return mixed
- */
- public function __get($key)
- {
- return $this->condition
- ? $this->collection->{$key}
- : $this->collection;
- }
-
- /**
- * Proxy a method call onto the collection.
- *
- * @param string $method
- * @param array $parameters
- * @return mixed
- */
- public function __call($method, $parameters)
- {
- return $this->condition
- ? $this->collection->{$method}(...$parameters)
- : $this->collection;
- }
-}
diff --git a/vendor/tightenco/collect/src/Collect/Support/LazyCollection.php b/vendor/tightenco/collect/src/Collect/Support/LazyCollection.php
deleted file mode 100644
index a54787d..0000000
--- a/vendor/tightenco/collect/src/Collect/Support/LazyCollection.php
+++ /dev/null
@@ -1,1585 +0,0 @@
-source = $source;
- } elseif (is_null($source)) {
- $this->source = static::empty();
- } else {
- $this->source = $this->getArrayableItems($source);
- }
- }
-
- /**
- * Create a collection with the given range.
- *
- * @param int $from
- * @param int $to
- * @return static
- */
- public static function range($from, $to)
- {
- return new static(function () use ($from, $to) {
- if ($from <= $to) {
- for (; $from <= $to; $from++) {
- yield $from;
- }
- } else {
- for (; $from >= $to; $from--) {
- yield $from;
- }
- }
- });
- }
-
- /**
- * Get all items in the enumerable.
- *
- * @return array
- */
- public function all()
- {
- if (is_array($this->source)) {
- return $this->source;
- }
-
- return iterator_to_array($this->getIterator());
- }
-
- /**
- * Eager load all items into a new lazy collection backed by an array.
- *
- * @return static
- */
- public function eager()
- {
- return new static($this->all());
- }
-
- /**
- * Cache values as they're enumerated.
- *
- * @return static
- */
- public function remember()
- {
- $iterator = $this->getIterator();
-
- $iteratorIndex = 0;
-
- $cache = [];
-
- return new static(function () use ($iterator, &$iteratorIndex, &$cache) {
- for ($index = 0; true; $index++) {
- if (array_key_exists($index, $cache)) {
- yield $cache[$index][0] => $cache[$index][1];
-
- continue;
- }
-
- if ($iteratorIndex < $index) {
- $iterator->next();
-
- $iteratorIndex++;
- }
-
- if (! $iterator->valid()) {
- break;
- }
-
- $cache[$index] = [$iterator->key(), $iterator->current()];
-
- yield $cache[$index][0] => $cache[$index][1];
- }
- });
- }
-
- /**
- * Get the average value of a given key.
- *
- * @param callable|string|null $callback
- * @return mixed
- */
- public function avg($callback = null)
- {
- return $this->collect()->avg($callback);
- }
-
- /**
- * Get the median of a given key.
- *
- * @param string|array|null $key
- * @return mixed
- */
- public function median($key = null)
- {
- return $this->collect()->median($key);
- }
-
- /**
- * Get the mode of a given key.
- *
- * @param string|array|null $key
- * @return array|null
- */
- public function mode($key = null)
- {
- return $this->collect()->mode($key);
- }
-
- /**
- * Collapse the collection of items into a single array.
- *
- * @return static
- */
- public function collapse()
- {
- return new static(function () {
- foreach ($this as $values) {
- if (is_array($values) || $values instanceof Enumerable) {
- foreach ($values as $value) {
- yield $value;
- }
- }
- }
- });
- }
-
- /**
- * Determine if an item exists in the enumerable.
- *
- * @param mixed $key
- * @param mixed $operator
- * @param mixed $value
- * @return bool
- */
- public function contains($key, $operator = null, $value = null)
- {
- if (func_num_args() === 1 && $this->useAsCallable($key)) {
- $placeholder = new stdClass;
-
- return $this->first($key, $placeholder) !== $placeholder;
- }
-
- if (func_num_args() === 1) {
- $needle = $key;
-
- foreach ($this as $value) {
- if ($value == $needle) {
- return true;
- }
- }
-
- return false;
- }
-
- return $this->contains($this->operatorForWhere(...func_get_args()));
- }
-
- /**
- * Determine if an item is not contained in the enumerable.
- *
- * @param mixed $key
- * @param mixed $operator
- * @param mixed $value
- * @return bool
- */
- public function doesntContain($key, $operator = null, $value = null)
- {
- return ! $this->contains(...func_get_args());
- }
-
- /**
- * Cross join the given iterables, returning all possible permutations.
- *
- * @param array ...$arrays
- * @return static
- */
- public function crossJoin(...$arrays)
- {
- return $this->passthru('crossJoin', func_get_args());
- }
-
- /**
- * Count the number of items in the collection by a field or using a callback.
- *
- * @param callable|string $countBy
- * @return static
- */
- public function countBy($countBy = null)
- {
- $countBy = is_null($countBy)
- ? $this->identity()
- : $this->valueRetriever($countBy);
-
- return new static(function () use ($countBy) {
- $counts = [];
-
- foreach ($this as $key => $value) {
- $group = $countBy($value, $key);
-
- if (empty($counts[$group])) {
- $counts[$group] = 0;
- }
-
- $counts[$group]++;
- }
-
- yield from $counts;
- });
- }
-
- /**
- * Get the items that are not present in the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function diff($items)
- {
- return $this->passthru('diff', func_get_args());
- }
-
- /**
- * Get the items that are not present in the given items, using the callback.
- *
- * @param mixed $items
- * @param callable $callback
- * @return static
- */
- public function diffUsing($items, callable $callback)
- {
- return $this->passthru('diffUsing', func_get_args());
- }
-
- /**
- * Get the items whose keys and values are not present in the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function diffAssoc($items)
- {
- return $this->passthru('diffAssoc', func_get_args());
- }
-
- /**
- * Get the items whose keys and values are not present in the given items, using the callback.
- *
- * @param mixed $items
- * @param callable $callback
- * @return static
- */
- public function diffAssocUsing($items, callable $callback)
- {
- return $this->passthru('diffAssocUsing', func_get_args());
- }
-
- /**
- * Get the items whose keys are not present in the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function diffKeys($items)
- {
- return $this->passthru('diffKeys', func_get_args());
- }
-
- /**
- * Get the items whose keys are not present in the given items, using the callback.
- *
- * @param mixed $items
- * @param callable $callback
- * @return static
- */
- public function diffKeysUsing($items, callable $callback)
- {
- return $this->passthru('diffKeysUsing', func_get_args());
- }
-
- /**
- * Retrieve duplicate items.
- *
- * @param callable|string|null $callback
- * @param bool $strict
- * @return static
- */
- public function duplicates($callback = null, $strict = false)
- {
- return $this->passthru('duplicates', func_get_args());
- }
-
- /**
- * Retrieve duplicate items using strict comparison.
- *
- * @param callable|string|null $callback
- * @return static
- */
- public function duplicatesStrict($callback = null)
- {
- return $this->passthru('duplicatesStrict', func_get_args());
- }
-
- /**
- * Get all items except for those with the specified keys.
- *
- * @param mixed $keys
- * @return static
- */
- public function except($keys)
- {
- return $this->passthru('except', func_get_args());
- }
-
- /**
- * Run a filter over each of the items.
- *
- * @param callable|null $callback
- * @return static
- */
- public function filter(callable $callback = null)
- {
- if (is_null($callback)) {
- $callback = function ($value) {
- return (bool) $value;
- };
- }
-
- return new static(function () use ($callback) {
- foreach ($this as $key => $value) {
- if ($callback($value, $key)) {
- yield $key => $value;
- }
- }
- });
- }
-
- /**
- * Get the first item from the enumerable passing the given truth test.
- *
- * @param callable|null $callback
- * @param mixed $default
- * @return mixed
- */
- public function first(callable $callback = null, $default = null)
- {
- $iterator = $this->getIterator();
-
- if (is_null($callback)) {
- if (! $iterator->valid()) {
- return value($default);
- }
-
- return $iterator->current();
- }
-
- foreach ($iterator as $key => $value) {
- if ($callback($value, $key)) {
- return $value;
- }
- }
-
- return value($default);
- }
-
- /**
- * Get a flattened list of the items in the collection.
- *
- * @param int $depth
- * @return static
- */
- public function flatten($depth = INF)
- {
- $instance = new static(function () use ($depth) {
- foreach ($this as $item) {
- if (! is_array($item) && ! $item instanceof Enumerable) {
- yield $item;
- } elseif ($depth === 1) {
- yield from $item;
- } else {
- yield from (new static($item))->flatten($depth - 1);
- }
- }
- });
-
- return $instance->values();
- }
-
- /**
- * Flip the items in the collection.
- *
- * @return static
- */
- public function flip()
- {
- return new static(function () {
- foreach ($this as $key => $value) {
- yield $value => $key;
- }
- });
- }
-
- /**
- * Get an item by key.
- *
- * @param mixed $key
- * @param mixed $default
- * @return mixed
- */
- public function get($key, $default = null)
- {
- if (is_null($key)) {
- return;
- }
-
- foreach ($this as $outerKey => $outerValue) {
- if ($outerKey == $key) {
- return $outerValue;
- }
- }
-
- return value($default);
- }
-
- /**
- * Group an associative array by a field or using a callback.
- *
- * @param array|callable|string $groupBy
- * @param bool $preserveKeys
- * @return static
- */
- public function groupBy($groupBy, $preserveKeys = false)
- {
- return $this->passthru('groupBy', func_get_args());
- }
-
- /**
- * Key an associative array by a field or using a callback.
- *
- * @param callable|string $keyBy
- * @return static
- */
- public function keyBy($keyBy)
- {
- return new static(function () use ($keyBy) {
- $keyBy = $this->valueRetriever($keyBy);
-
- foreach ($this as $key => $item) {
- $resolvedKey = $keyBy($item, $key);
-
- if (is_object($resolvedKey)) {
- $resolvedKey = (string) $resolvedKey;
- }
-
- yield $resolvedKey => $item;
- }
- });
- }
-
- /**
- * Determine if an item exists in the collection by key.
- *
- * @param mixed $key
- * @return bool
- */
- public function has($key)
- {
- $keys = array_flip(is_array($key) ? $key : func_get_args());
- $count = count($keys);
-
- foreach ($this as $key => $value) {
- if (array_key_exists($key, $keys) && --$count == 0) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Determine if any of the keys exist in the collection.
- *
- * @param mixed $key
- * @return bool
- */
- public function hasAny($key)
- {
- $keys = array_flip(is_array($key) ? $key : func_get_args());
-
- foreach ($this as $key => $value) {
- if (array_key_exists($key, $keys)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Concatenate values of a given key as a string.
- *
- * @param string $value
- * @param string|null $glue
- * @return string
- */
- public function implode($value, $glue = null)
- {
- return $this->collect()->implode(...func_get_args());
- }
-
- /**
- * Intersect the collection with the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function intersect($items)
- {
- return $this->passthru('intersect', func_get_args());
- }
-
- /**
- * Intersect the collection with the given items by key.
- *
- * @param mixed $items
- * @return static
- */
- public function intersectByKeys($items)
- {
- return $this->passthru('intersectByKeys', func_get_args());
- }
-
- /**
- * Determine if the items are empty or not.
- *
- * @return bool
- */
- public function isEmpty()
- {
- return ! $this->getIterator()->valid();
- }
-
- /**
- * Determine if the collection contains a single item.
- *
- * @return bool
- */
- public function containsOneItem()
- {
- return $this->take(2)->count() === 1;
- }
-
- /**
- * Join all items from the collection using a string. The final items can use a separate glue string.
- *
- * @param string $glue
- * @param string $finalGlue
- * @return string
- */
- public function join($glue, $finalGlue = '')
- {
- return $this->collect()->join(...func_get_args());
- }
-
- /**
- * Get the keys of the collection items.
- *
- * @return static
- */
- public function keys()
- {
- return new static(function () {
- foreach ($this as $key => $value) {
- yield $key;
- }
- });
- }
-
- /**
- * Get the last item from the collection.
- *
- * @param callable|null $callback
- * @param mixed $default
- * @return mixed
- */
- public function last(callable $callback = null, $default = null)
- {
- $needle = $placeholder = new stdClass;
-
- foreach ($this as $key => $value) {
- if (is_null($callback) || $callback($value, $key)) {
- $needle = $value;
- }
- }
-
- return $needle === $placeholder ? value($default) : $needle;
- }
-
- /**
- * Get the values of a given key.
- *
- * @param string|array $value
- * @param string|null $key
- * @return static
- */
- public function pluck($value, $key = null)
- {
- return new static(function () use ($value, $key) {
- [$value, $key] = $this->explodePluckParameters($value, $key);
-
- foreach ($this as $item) {
- $itemValue = data_get($item, $value);
-
- if (is_null($key)) {
- yield $itemValue;
- } else {
- $itemKey = data_get($item, $key);
-
- if (is_object($itemKey) && method_exists($itemKey, '__toString')) {
- $itemKey = (string) $itemKey;
- }
-
- yield $itemKey => $itemValue;
- }
- }
- });
- }
-
- /**
- * Run a map over each of the items.
- *
- * @param callable $callback
- * @return static
- */
- public function map(callable $callback)
- {
- return new static(function () use ($callback) {
- foreach ($this as $key => $value) {
- yield $key => $callback($value, $key);
- }
- });
- }
-
- /**
- * Run a dictionary map over the items.
- *
- * The callback should return an associative array with a single key/value pair.
- *
- * @param callable $callback
- * @return static
- */
- public function mapToDictionary(callable $callback)
- {
- return $this->passthru('mapToDictionary', func_get_args());
- }
-
- /**
- * Run an associative map over each of the items.
- *
- * The callback should return an associative array with a single key/value pair.
- *
- * @param callable $callback
- * @return static
- */
- public function mapWithKeys(callable $callback)
- {
- return new static(function () use ($callback) {
- foreach ($this as $key => $value) {
- yield from $callback($value, $key);
- }
- });
- }
-
- /**
- * Merge the collection with the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function merge($items)
- {
- return $this->passthru('merge', func_get_args());
- }
-
- /**
- * Recursively merge the collection with the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function mergeRecursive($items)
- {
- return $this->passthru('mergeRecursive', func_get_args());
- }
-
- /**
- * Create a collection by using this collection for keys and another for its values.
- *
- * @param mixed $values
- * @return static
- */
- public function combine($values)
- {
- return new static(function () use ($values) {
- $values = $this->makeIterator($values);
-
- $errorMessage = 'Both parameters should have an equal number of elements';
-
- foreach ($this as $key) {
- if (! $values->valid()) {
- trigger_error($errorMessage, E_USER_WARNING);
-
- break;
- }
-
- yield $key => $values->current();
-
- $values->next();
- }
-
- if ($values->valid()) {
- trigger_error($errorMessage, E_USER_WARNING);
- }
- });
- }
-
- /**
- * Union the collection with the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function union($items)
- {
- return $this->passthru('union', func_get_args());
- }
-
- /**
- * Create a new collection consisting of every n-th element.
- *
- * @param int $step
- * @param int $offset
- * @return static
- */
- public function nth($step, $offset = 0)
- {
- return new static(function () use ($step, $offset) {
- $position = 0;
-
- foreach ($this->slice($offset) as $item) {
- if ($position % $step === 0) {
- yield $item;
- }
-
- $position++;
- }
- });
- }
-
- /**
- * Get the items with the specified keys.
- *
- * @param mixed $keys
- * @return static
- */
- public function only($keys)
- {
- if ($keys instanceof Enumerable) {
- $keys = $keys->all();
- } elseif (! is_null($keys)) {
- $keys = is_array($keys) ? $keys : func_get_args();
- }
-
- return new static(function () use ($keys) {
- if (is_null($keys)) {
- yield from $this;
- } else {
- $keys = array_flip($keys);
-
- foreach ($this as $key => $value) {
- if (array_key_exists($key, $keys)) {
- yield $key => $value;
-
- unset($keys[$key]);
-
- if (empty($keys)) {
- break;
- }
- }
- }
- }
- });
- }
-
- /**
- * Push all of the given items onto the collection.
- *
- * @param iterable $source
- * @return static
- */
- public function concat($source)
- {
- return (new static(function () use ($source) {
- yield from $this;
- yield from $source;
- }))->values();
- }
-
- /**
- * Get one or a specified number of items randomly from the collection.
- *
- * @param int|null $number
- * @return static|mixed
- *
- * @throws \InvalidArgumentException
- */
- public function random($number = null)
- {
- $result = $this->collect()->random(...func_get_args());
-
- return is_null($number) ? $result : new static($result);
- }
-
- /**
- * Replace the collection items with the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function replace($items)
- {
- return new static(function () use ($items) {
- $items = $this->getArrayableItems($items);
-
- foreach ($this as $key => $value) {
- if (array_key_exists($key, $items)) {
- yield $key => $items[$key];
-
- unset($items[$key]);
- } else {
- yield $key => $value;
- }
- }
-
- foreach ($items as $key => $value) {
- yield $key => $value;
- }
- });
- }
-
- /**
- * Recursively replace the collection items with the given items.
- *
- * @param mixed $items
- * @return static
- */
- public function replaceRecursive($items)
- {
- return $this->passthru('replaceRecursive', func_get_args());
- }
-
- /**
- * Reverse items order.
- *
- * @return static
- */
- public function reverse()
- {
- return $this->passthru('reverse', func_get_args());
- }
-
- /**
- * Search the collection for a given value and return the corresponding key if successful.
- *
- * @param mixed $value
- * @param bool $strict
- * @return mixed
- */
- public function search($value, $strict = false)
- {
- $predicate = $this->useAsCallable($value)
- ? $value
- : function ($item) use ($value, $strict) {
- return $strict ? $item === $value : $item == $value;
- };
-
- foreach ($this as $key => $item) {
- if ($predicate($item, $key)) {
- return $key;
- }
- }
-
- return false;
- }
-
- /**
- * Shuffle the items in the collection.
- *
- * @param int|null $seed
- * @return static
- */
- public function shuffle($seed = null)
- {
- return $this->passthru('shuffle', func_get_args());
- }
-
- /**
- * Create chunks representing a "sliding window" view of the items in the collection.
- *
- * @param int $size
- * @param int $step
- * @return static
- */
- public function sliding($size = 2, $step = 1)
- {
- return new static(function () use ($size, $step) {
- $iterator = $this->getIterator();
-
- $chunk = [];
-
- while ($iterator->valid()) {
- $chunk[$iterator->key()] = $iterator->current();
-
- if (count($chunk) == $size) {
- yield tap(new static($chunk), function () use (&$chunk, $step) {
- $chunk = array_slice($chunk, $step, null, true);
- });
-
- // If the $step between chunks is bigger than each chunk's $size
- // we will skip the extra items (which should never be in any
- // chunk) before we continue to the next chunk in the loop.
- if ($step > $size) {
- $skip = $step - $size;
-
- for ($i = 0; $i < $skip && $iterator->valid(); $i++) {
- $iterator->next();
- }
- }
- }
-
- $iterator->next();
- }
- });
- }
-
- /**
- * Skip the first {$count} items.
- *
- * @param int $count
- * @return static
- */
- public function skip($count)
- {
- return new static(function () use ($count) {
- $iterator = $this->getIterator();
-
- while ($iterator->valid() && $count--) {
- $iterator->next();
- }
-
- while ($iterator->valid()) {
- yield $iterator->key() => $iterator->current();
-
- $iterator->next();
- }
- });
- }
-
- /**
- * Skip items in the collection until the given condition is met.
- *
- * @param mixed $value
- * @return static
- */
- public function skipUntil($value)
- {
- $callback = $this->useAsCallable($value) ? $value : $this->equality($value);
-
- return $this->skipWhile($this->negate($callback));
- }
-
- /**
- * Skip items in the collection while the given condition is met.
- *
- * @param mixed $value
- * @return static
- */
- public function skipWhile($value)
- {
- $callback = $this->useAsCallable($value) ? $value : $this->equality($value);
-
- return new static(function () use ($callback) {
- $iterator = $this->getIterator();
-
- while ($iterator->valid() && $callback($iterator->current(), $iterator->key())) {
- $iterator->next();
- }
-
- while ($iterator->valid()) {
- yield $iterator->key() => $iterator->current();
-
- $iterator->next();
- }
- });
- }
-
- /**
- * Get a slice of items from the enumerable.
- *
- * @param int $offset
- * @param int|null $length
- * @return static
- */
- public function slice($offset, $length = null)
- {
- if ($offset < 0 || $length < 0) {
- return $this->passthru('slice', func_get_args());
- }
-
- $instance = $this->skip($offset);
-
- return is_null($length) ? $instance : $instance->take($length);
- }
-
- /**
- * Split a collection into a certain number of groups.
- *
- * @param int $numberOfGroups
- * @return static
- */
- public function split($numberOfGroups)
- {
- return $this->passthru('split', func_get_args());
- }
-
- /**
- * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception.
- *
- * @param mixed $key
- * @param mixed $operator
- * @param mixed $value
- * @return mixed
- *
- * @throws \Tightenco\Collect\Support\ItemNotFoundException
- * @throws \Tightenco\Collect\Support\MultipleItemsFoundException
- */
- public function sole($key = null, $operator = null, $value = null)
- {
- $filter = func_num_args() > 1
- ? $this->operatorForWhere(...func_get_args())
- : $key;
-
- return $this
- ->when($filter)
- ->filter($filter)
- ->take(2)
- ->collect()
- ->sole();
- }
-
- /**
- * Get the first item in the collection but throw an exception if no matching items exist.
- *
- * @param mixed $key
- * @param mixed $operator
- * @param mixed $value
- * @return mixed
- *
- * @throws \Tightenco\Collect\Support\ItemNotFoundException
- */
- public function firstOrFail($key = null, $operator = null, $value = null)
- {
- $filter = func_num_args() > 1
- ? $this->operatorForWhere(...func_get_args())
- : $key;
-
- return $this
- ->when($filter)
- ->filter($filter)
- ->take(1)
- ->collect()
- ->firstOrFail();
- }
-
- /**
- * Chunk the collection into chunks of the given size.
- *
- * @param int $size
- * @return static
- */
- public function chunk($size)
- {
- if ($size <= 0) {
- return static::empty();
- }
-
- return new static(function () use ($size) {
- $iterator = $this->getIterator();
-
- while ($iterator->valid()) {
- $chunk = [];
-
- while (true) {
- $chunk[$iterator->key()] = $iterator->current();
-
- if (count($chunk) < $size) {
- $iterator->next();
-
- if (! $iterator->valid()) {
- break;
- }
- } else {
- break;
- }
- }
-
- yield new static($chunk);
-
- $iterator->next();
- }
- });
- }
-
- /**
- * Split a collection into a certain number of groups, and fill the first groups completely.
- *
- * @param int $numberOfGroups
- * @return static
- */
- public function splitIn($numberOfGroups)
- {
- return $this->chunk(ceil($this->count() / $numberOfGroups));
- }
-
- /**
- * Chunk the collection into chunks with a callback.
- *
- * @param callable $callback
- * @return static
- */
- public function chunkWhile(callable $callback)
- {
- return new static(function () use ($callback) {
- $iterator = $this->getIterator();
-
- $chunk = new Collection;
-
- if ($iterator->valid()) {
- $chunk[$iterator->key()] = $iterator->current();
-
- $iterator->next();
- }
-
- while ($iterator->valid()) {
- if (! $callback($iterator->current(), $iterator->key(), $chunk)) {
- yield new static($chunk);
-
- $chunk = new Collection;
- }
-
- $chunk[$iterator->key()] = $iterator->current();
-
- $iterator->next();
- }
-
- if ($chunk->isNotEmpty()) {
- yield new static($chunk);
- }
- });
- }
-
- /**
- * Sort through each item with a callback.
- *
- * @param callable|null|int $callback
- * @return static
- */
- public function sort($callback = null)
- {
- return $this->passthru('sort', func_get_args());
- }
-
- /**
- * Sort items in descending order.
- *
- * @param int $options
- * @return static
- */
- public function sortDesc($options = SORT_REGULAR)
- {
- return $this->passthru('sortDesc', func_get_args());
- }
-
- /**
- * Sort the collection using the given callback.
- *
- * @param callable|string $callback
- * @param int $options
- * @param bool $descending
- * @return static
- */
- public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
- {
- return $this->passthru('sortBy', func_get_args());
- }
-
- /**
- * Sort the collection in descending order using the given callback.
- *
- * @param callable|string $callback
- * @param int $options
- * @return static
- */
- public function sortByDesc($callback, $options = SORT_REGULAR)
- {
- return $this->passthru('sortByDesc', func_get_args());
- }
-
- /**
- * Sort the collection keys.
- *
- * @param int $options
- * @param bool $descending
- * @return static
- */
- public function sortKeys($options = SORT_REGULAR, $descending = false)
- {
- return $this->passthru('sortKeys', func_get_args());
- }
-
- /**
- * Sort the collection keys in descending order.
- *
- * @param int $options
- * @return static
- */
- public function sortKeysDesc($options = SORT_REGULAR)
- {
- return $this->passthru('sortKeysDesc', func_get_args());
- }
-
- /**
- * Sort the collection keys using a callback.
- *
- * @param callable $callback
- * @return static
- */
- public function sortKeysUsing(callable $callback)
- {
- return $this->passthru('sortKeysUsing', func_get_args());
- }
-
- /**
- * Take the first or last {$limit} items.
- *
- * @param int $limit
- * @return static
- */
- public function take($limit)
- {
- if ($limit < 0) {
- return $this->passthru('take', func_get_args());
- }
-
- return new static(function () use ($limit) {
- $iterator = $this->getIterator();
-
- while ($limit--) {
- if (! $iterator->valid()) {
- break;
- }
-
- yield $iterator->key() => $iterator->current();
-
- if ($limit) {
- $iterator->next();
- }
- }
- });
- }
-
- /**
- * Take items in the collection until the given condition is met.
- *
- * @param mixed $value
- * @return static
- */
- public function takeUntil($value)
- {
- $callback = $this->useAsCallable($value) ? $value : $this->equality($value);
-
- return new static(function () use ($callback) {
- foreach ($this as $key => $item) {
- if ($callback($item, $key)) {
- break;
- }
-
- yield $key => $item;
- }
- });
- }
-
- /**
- * Take items in the collection until a given point in time.
- *
- * @param \DateTimeInterface $timeout
- * @return static
- */
- public function takeUntilTimeout(DateTimeInterface $timeout)
- {
- $timeout = $timeout->getTimestamp();
-
- return $this->takeWhile(function () use ($timeout) {
- return $this->now() < $timeout;
- });
- }
-
- /**
- * Take items in the collection while the given condition is met.
- *
- * @param mixed $value
- * @return static
- */
- public function takeWhile($value)
- {
- $callback = $this->useAsCallable($value) ? $value : $this->equality($value);
-
- return $this->takeUntil(function ($item, $key) use ($callback) {
- return ! $callback($item, $key);
- });
- }
-
- /**
- * Pass each item in the collection to the given callback, lazily.
- *
- * @param callable $callback
- * @return static
- */
- public function tapEach(callable $callback)
- {
- return new static(function () use ($callback) {
- foreach ($this as $key => $value) {
- $callback($value, $key);
-
- yield $key => $value;
- }
- });
- }
-
- /**
- * Convert a flatten "dot" notation array into an expanded array.
- *
- * @return static
- */
- public function undot()
- {
- return $this->passthru('undot', []);
- }
-
- /**
- * Return only unique items from the collection array.
- *
- * @param string|callable|null $key
- * @param bool $strict
- * @return static
- */
- public function unique($key = null, $strict = false)
- {
- $callback = $this->valueRetriever($key);
-
- return new static(function () use ($callback, $strict) {
- $exists = [];
-
- foreach ($this as $key => $item) {
- if (! in_array($id = $callback($item, $key), $exists, $strict)) {
- yield $key => $item;
-
- $exists[] = $id;
- }
- }
- });
- }
-
- /**
- * Reset the keys on the underlying array.
- *
- * @return static
- */
- public function values()
- {
- return new static(function () {
- foreach ($this as $item) {
- yield $item;
- }
- });
- }
-
- /**
- * Zip the collection together with one or more arrays.
- *
- * e.g. new LazyCollection([1, 2, 3])->zip([4, 5, 6]);
- * => [[1, 4], [2, 5], [3, 6]]
- *
- * @param mixed ...$items
- * @return static
- */
- public function zip($items)
- {
- $iterables = func_get_args();
-
- return new static(function () use ($iterables) {
- $iterators = Collection::make($iterables)->map(function ($iterable) {
- return $this->makeIterator($iterable);
- })->prepend($this->getIterator());
-
- while ($iterators->contains->valid()) {
- yield new static($iterators->map->current());
-
- $iterators->each->next();
- }
- });
- }
-
- /**
- * Pad collection to the specified length with a value.
- *
- * @param int $size
- * @param mixed $value
- * @return static
- */
- public function pad($size, $value)
- {
- if ($size < 0) {
- return $this->passthru('pad', func_get_args());
- }
-
- return new static(function () use ($size, $value) {
- $yielded = 0;
-
- foreach ($this as $index => $item) {
- yield $index => $item;
-
- $yielded++;
- }
-
- while ($yielded++ < $size) {
- yield $value;
- }
- });
- }
-
- /**
- * Get the values iterator.
- *
- * @return \Traversable
- */
- #[\ReturnTypeWillChange]
- public function getIterator()
- {
- return $this->makeIterator($this->source);
- }
-
- /**
- * Count the number of items in the collection.
- *
- * @return int
- */
- #[\ReturnTypeWillChange]
- public function count()
- {
- if (is_array($this->source)) {
- return count($this->source);
- }
-
- return iterator_count($this->getIterator());
- }
-
- /**
- * Make an iterator from the given source.
- *
- * @param mixed $source
- * @return \Traversable
- */
- protected function makeIterator($source)
- {
- if ($source instanceof IteratorAggregate) {
- return $source->getIterator();
- }
-
- if (is_array($source)) {
- return new ArrayIterator($source);
- }
-
- return $source();
- }
-
- /**
- * Explode the "value" and "key" arguments passed to "pluck".
- *
- * @param string|array $value
- * @param string|array|null $key
- * @return array
- */
- protected function explodePluckParameters($value, $key)
- {
- $value = is_string($value) ? explode('.', $value) : $value;
-
- $key = is_null($key) || is_array($key) ? $key : explode('.', $key);
-
- return [$value, $key];
- }
-
- /**
- * Pass this lazy collection through a method on the collection class.
- *
- * @param string $method
- * @param array $params
- * @return static
- */
- protected function passthru($method, array $params)
- {
- return new static(function () use ($method, $params) {
- yield from $this->collect()->$method(...$params);
- });
- }
-
- /**
- * Get the current time.
- *
- * @return int
- */
- protected function now()
- {
- return time();
- }
-}
diff --git a/vendor/tightenco/collect/src/Collect/Support/Traits/EnumeratesValues.php b/vendor/tightenco/collect/src/Collect/Support/Traits/EnumeratesValues.php
deleted file mode 100644
index 2f1187f..0000000
--- a/vendor/tightenco/collect/src/Collect/Support/Traits/EnumeratesValues.php
+++ /dev/null
@@ -1,1116 +0,0 @@
-all() : $value;
- }
-
- /**
- * Create a new instance with no items.
- *
- * @return static
- */
- public static function empty()
- {
- return new static([]);
- }
-
- /**
- * Create a new collection by invoking the callback a given amount of times.
- *
- * @param int $number
- * @param callable|null $callback
- * @return static
- */
- public static function times($number, callable $callback = null)
- {
- if ($number < 1) {
- return new static;
- }
-
- return static::range(1, $number)
- ->when($callback)
- ->map($callback);
- }
-
- /**
- * Alias for the "avg" method.
- *
- * @param callable|string|null $callback
- * @return mixed
- */
- public function average($callback = null)
- {
- return $this->avg($callback);
- }
-
- /**
- * Alias for the "contains" method.
- *
- * @param mixed $key
- * @param mixed $operator
- * @param mixed $value
- * @return bool
- */
- public function some($key, $operator = null, $value = null)
- {
- return $this->contains(...func_get_args());
- }
-
- /**
- * Determine if an item exists, using strict comparison.
- *
- * @param mixed $key
- * @param mixed $value
- * @return bool
- */
- public function containsStrict($key, $value = null)
- {
- if (func_num_args() === 2) {
- return $this->contains(function ($item) use ($key, $value) {
- return data_get($item, $key) === $value;
- });
- }
-
- if ($this->useAsCallable($key)) {
- return ! is_null($this->first($key));
- }
-
- foreach ($this as $item) {
- if ($item === $key) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Dump the items and end the script.
- *
- * @param mixed ...$args
- * @return void
- */
- public function dd(...$args)
- {
- $this->dump(...$args);
-
- exit(1);
- }
-
- /**
- * Dump the items.
- *
- * @return $this
- */
- public function dump()
- {
- (new Collection(func_get_args()))
- ->push($this->all())
- ->each(function ($item) {
- VarDumper::dump($item);
- });
-
- return $this;
- }
-
- /**
- * Execute a callback over each item.
- *
- * @param callable $callback
- * @return $this
- */
- public function each(callable $callback)
- {
- foreach ($this as $key => $item) {
- if ($callback($item, $key) === false) {
- break;
- }
- }
-
- return $this;
- }
-
- /**
- * Execute a callback over each nested chunk of items.
- *
- * @param callable $callback
- * @return static
- */
- public function eachSpread(callable $callback)
- {
- return $this->each(function ($chunk, $key) use ($callback) {
- $chunk[] = $key;
-
- return $callback(...$chunk);
- });
- }
-
- /**
- * Determine if all items pass the given truth test.
- *
- * @param string|callable $key
- * @param mixed $operator
- * @param mixed $value
- * @return bool
- */
- public function every($key, $operator = null, $value = null)
- {
- if (func_num_args() === 1) {
- $callback = $this->valueRetriever($key);
-
- foreach ($this as $k => $v) {
- if (! $callback($v, $k)) {
- return false;
- }
- }
-
- return true;
- }
-
- return $this->every($this->operatorForWhere(...func_get_args()));
- }
-
- /**
- * Get the first item by the given key value pair.
- *
- * @param string $key
- * @param mixed $operator
- * @param mixed $value
- * @return mixed
- */
- public function firstWhere($key, $operator = null, $value = null)
- {
- return $this->first($this->operatorForWhere(...func_get_args()));
- }
-
- /**
- * Determine if the collection is not empty.
- *
- * @return bool
- */
- public function isNotEmpty()
- {
- return ! $this->isEmpty();
- }
-
- /**
- * Run a map over each nested chunk of items.
- *
- * @param callable $callback
- * @return static
- */
- public function mapSpread(callable $callback)
- {
- return $this->map(function ($chunk, $key) use ($callback) {
- $chunk[] = $key;
-
- return $callback(...$chunk);
- });
- }
-
- /**
- * Run a grouping map over the items.
- *
- * The callback should return an associative array with a single key/value pair.
- *
- * @param callable $callback
- * @return static
- */
- public function mapToGroups(callable $callback)
- {
- $groups = $this->mapToDictionary($callback);
-
- return $groups->map([$this, 'make']);
- }
-
- /**
- * Map a collection and flatten the result by a single level.
- *
- * @param callable $callback
- * @return static
- */
- public function flatMap(callable $callback)
- {
- return $this->map($callback)->collapse();
- }
-
- /**
- * Map the values into a new class.
- *
- * @param string $class
- * @return static
- */
- public function mapInto($class)
- {
- return $this->map(function ($value, $key) use ($class) {
- return new $class($value, $key);
- });
- }
-
- /**
- * Get the min value of a given key.
- *
- * @param callable|string|null $callback
- * @return mixed
- */
- public function min($callback = null)
- {
- $callback = $this->valueRetriever($callback);
-
- return $this->map(function ($value) use ($callback) {
- return $callback($value);
- })->filter(function ($value) {
- return ! is_null($value);
- })->reduce(function ($result, $value) {
- return is_null($result) || $value < $result ? $value : $result;
- });
- }
-
- /**
- * Get the max value of a given key.
- *
- * @param callable|string|null $callback
- * @return mixed
- */
- public function max($callback = null)
- {
- $callback = $this->valueRetriever($callback);
-
- return $this->filter(function ($value) {
- return ! is_null($value);
- })->reduce(function ($result, $item) use ($callback) {
- $value = $callback($item);
-
- return is_null($result) || $value > $result ? $value : $result;
- });
- }
-
- /**
- * "Paginate" the collection by slicing it into a smaller collection.
- *
- * @param int $page
- * @param int $perPage
- * @return static
- */
- public function forPage($page, $perPage)
- {
- $offset = max(0, ($page - 1) * $perPage);
-
- return $this->slice($offset, $perPage);
- }
-
- /**
- * Partition the collection into two arrays using the given callback or key.
- *
- * @param callable|string $key
- * @param mixed $operator
- * @param mixed $value
- * @return static
- */
- public function partition($key, $operator = null, $value = null)
- {
- $passed = [];
- $failed = [];
-
- $callback = func_num_args() === 1
- ? $this->valueRetriever($key)
- : $this->operatorForWhere(...func_get_args());
-
- foreach ($this as $key => $item) {
- if ($callback($item, $key)) {
- $passed[$key] = $item;
- } else {
- $failed[$key] = $item;
- }
- }
-
- return new static([new static($passed), new static($failed)]);
- }
-
- /**
- * Get the sum of the given values.
- *
- * @param callable|string|null $callback
- * @return mixed
- */
- public function sum($callback = null)
- {
- $callback = is_null($callback)
- ? $this->identity()
- : $this->valueRetriever($callback);
-
- return $this->reduce(function ($result, $item) use ($callback) {
- return $result + $callback($item);
- }, 0);
- }
-
- /**
- * Apply the callback if the value is truthy.
- *
- * @param bool|mixed $value
- * @param callable|null $callback
- * @param callable|null $default
- * @return static|mixed
- */
- public function when($value, callable $callback = null, callable $default = null)
- {
- if (! $callback) {
- return new HigherOrderWhenProxy($this, $value);
- }
-
- if ($value) {
- return $callback($this, $value);
- } elseif ($default) {
- return $default($this, $value);
- }
-
- return $this;
- }
-
- /**
- * Apply the callback if the collection is empty.
- *
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
- */
- public function whenEmpty(callable $callback, callable $default = null)
- {
- return $this->when($this->isEmpty(), $callback, $default);
- }
-
- /**
- * Apply the callback if the collection is not empty.
- *
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
- */
- public function whenNotEmpty(callable $callback, callable $default = null)
- {
- return $this->when($this->isNotEmpty(), $callback, $default);
- }
-
- /**
- * Apply the callback if the value is falsy.
- *
- * @param bool $value
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
- */
- public function unless($value, callable $callback, callable $default = null)
- {
- return $this->when(! $value, $callback, $default);
- }
-
- /**
- * Apply the callback unless the collection is empty.
- *
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
- */
- public function unlessEmpty(callable $callback, callable $default = null)
- {
- return $this->whenNotEmpty($callback, $default);
- }
-
- /**
- * Apply the callback unless the collection is not empty.
- *
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
- */
- public function unlessNotEmpty(callable $callback, callable $default = null)
- {
- return $this->whenEmpty($callback, $default);
- }
-
- /**
- * Filter items by the given key value pair.
- *
- * @param string $key
- * @param mixed $operator
- * @param mixed $value
- * @return static
- */
- public function where($key, $operator = null, $value = null)
- {
- return $this->filter($this->operatorForWhere(...func_get_args()));
- }
-
- /**
- * Filter items where the value for the given key is null.
- *
- * @param string|null $key
- * @return static
- */
- public function whereNull($key = null)
- {
- return $this->whereStrict($key, null);
- }
-
- /**
- * Filter items where the value for the given key is not null.
- *
- * @param string|null $key
- * @return static
- */
- public function whereNotNull($key = null)
- {
- return $this->where($key, '!==', null);
- }
-
- /**
- * Filter items by the given key value pair using strict comparison.
- *
- * @param string $key
- * @param mixed $value
- * @return static
- */
- public function whereStrict($key, $value)
- {
- return $this->where($key, '===', $value);
- }
-
- /**
- * Filter items by the given key value pair.
- *
- * @param string $key
- * @param mixed $values
- * @param bool $strict
- * @return static
- */
- public function whereIn($key, $values, $strict = false)
- {
- $values = $this->getArrayableItems($values);
-
- return $this->filter(function ($item) use ($key, $values, $strict) {
- return in_array(data_get($item, $key), $values, $strict);
- });
- }
-
- /**
- * Filter items by the given key value pair using strict comparison.
- *
- * @param string $key
- * @param mixed $values
- * @return static
- */
- public function whereInStrict($key, $values)
- {
- return $this->whereIn($key, $values, true);
- }
-
- /**
- * Filter items such that the value of the given key is between the given values.
- *
- * @param string $key
- * @param array $values
- * @return static
- */
- public function whereBetween($key, $values)
- {
- return $this->where($key, '>=', reset($values))->where($key, '<=', end($values));
- }
-
- /**
- * Filter items such that the value of the given key is not between the given values.
- *
- * @param string $key
- * @param array $values
- * @return static
- */
- public function whereNotBetween($key, $values)
- {
- return $this->filter(function ($item) use ($key, $values) {
- return data_get($item, $key) < reset($values) || data_get($item, $key) > end($values);
- });
- }
-
- /**
- * Filter items by the given key value pair.
- *
- * @param string $key
- * @param mixed $values
- * @param bool $strict
- * @return static
- */
- public function whereNotIn($key, $values, $strict = false)
- {
- $values = $this->getArrayableItems($values);
-
- return $this->reject(function ($item) use ($key, $values, $strict) {
- return in_array(data_get($item, $key), $values, $strict);
- });
- }
-
- /**
- * Filter items by the given key value pair using strict comparison.
- *
- * @param string $key
- * @param mixed $values
- * @return static
- */
- public function whereNotInStrict($key, $values)
- {
- return $this->whereNotIn($key, $values, true);
- }
-
- /**
- * Filter the items, removing any items that don't match the given type(s).
- *
- * @param string|string[] $type
- * @return static
- */
- public function whereInstanceOf($type)
- {
- return $this->filter(function ($value) use ($type) {
- if (is_array($type)) {
- foreach ($type as $classType) {
- if ($value instanceof $classType) {
- return true;
- }
- }
-
- return false;
- }
-
- return $value instanceof $type;
- });
- }
-
- /**
- * Pass the collection to the given callback and return the result.
- *
- * @param callable $callback
- * @return mixed
- */
- public function pipe(callable $callback)
- {
- return $callback($this);
- }
-
- /**
- * Pass the collection into a new class.
- *
- * @param string $class
- * @return mixed
- */
- public function pipeInto($class)
- {
- return new $class($this);
- }
-
- /**
- * Pass the collection through a series of callable pipes and return the result.
- *
- * @param array $pipes
- * @return mixed
- */
- public function pipeThrough($pipes)
- {
- return static::make($pipes)->reduce(
- function ($carry, $pipe) {
- return $pipe($carry);
- },
- $this,
- );
- }
-
- /**
- * Pass the collection to the given callback and then return it.
- *
- * @param callable $callback
- * @return $this
- */
- public function tap(callable $callback)
- {
- $callback(clone $this);
-
- return $this;
- }
-
- /**
- * Reduce the collection to a single value.
- *
- * @param callable $callback
- * @param mixed $initial
- * @return mixed
- */
- public function reduce(callable $callback, $initial = null)
- {
- $result = $initial;
-
- foreach ($this as $key => $value) {
- $result = $callback($result, $value, $key);
- }
-
- return $result;
- }
-
- /**
- * Reduce the collection to multiple aggregate values.
- *
- * @param callable $callback
- * @param mixed ...$initial
- * @return array
- *
- * @deprecated Use "reduceSpread" instead
- *
- * @throws \UnexpectedValueException
- */
- public function reduceMany(callable $callback, ...$initial)
- {
- return $this->reduceSpread($callback, ...$initial);
- }
-
- /**
- * Reduce the collection to multiple aggregate values.
- *
- * @param callable $callback
- * @param mixed ...$initial
- * @return array
- *
- * @throws \UnexpectedValueException
- */
- public function reduceSpread(callable $callback, ...$initial)
- {
- $result = $initial;
-
- foreach ($this as $key => $value) {
- $result = call_user_func_array($callback, array_merge($result, [$value, $key]));
-
- if (! is_array($result)) {
- throw new UnexpectedValueException(sprintf(
- "%s::reduceMany expects reducer to return an array, but got a '%s' instead.",
- class_basename(static::class), gettype($result)
- ));
- }
- }
-
- return $result;
- }
-
- /**
- * Reduce an associative collection to a single value.
- *
- * @param callable $callback
- * @param mixed $initial
- * @return mixed
- */
- public function reduceWithKeys(callable $callback, $initial = null)
- {
- return $this->reduce($callback, $initial);
- }
-
- /**
- * Create a collection of all elements that do not pass a given truth test.
- *
- * @param callable|mixed $callback
- * @return static
- */
- public function reject($callback = true)
- {
- $useAsCallable = $this->useAsCallable($callback);
-
- return $this->filter(function ($value, $key) use ($callback, $useAsCallable) {
- return $useAsCallable
- ? ! $callback($value, $key)
- : $value != $callback;
- });
- }
-
- /**
- * Return only unique items from the collection array using strict comparison.
- *
- * @param string|callable|null $key
- * @return static
- */
- public function uniqueStrict($key = null)
- {
- return $this->unique($key, true);
- }
-
- /**
- * Collect the values into a collection.
- *
- * @return \Tightenco\Collect\Support\Collection
- */
- public function collect()
- {
- return new Collection($this->all());
- }
-
- /**
- * Get the collection of items as a plain array.
- *
- * @return array
- */
- public function toArray()
- {
- return $this->map(function ($value) {
- return $value instanceof Arrayable ? $value->toArray() : $value;
- })->all();
- }
-
- /**
- * Convert the object into something JSON serializable.
- *
- * @return array
- */
- #[\ReturnTypeWillChange]
- public function jsonSerialize()
- {
- return array_map(function ($value) {
- if ($value instanceof JsonSerializable) {
- return $value->jsonSerialize();
- } elseif ($value instanceof Jsonable) {
- return json_decode($value->toJson(), true);
- } elseif ($value instanceof Arrayable) {
- return $value->toArray();
- }
-
- return $value;
- }, $this->all());
- }
-
- /**
- * Get the collection of items as JSON.
- *
- * @param int $options
- * @return string
- */
- public function toJson($options = 0)
- {
- return json_encode($this->jsonSerialize(), $options);
- }
-
- /**
- * Get a CachingIterator instance.
- *
- * @param int $flags
- * @return \CachingIterator
- */
- public function getCachingIterator($flags = CachingIterator::CALL_TOSTRING)
- {
- return new CachingIterator($this->getIterator(), $flags);
- }
-
- /**
- * Convert the collection to its string representation.
- *
- * @return string
- */
- public function __toString()
- {
- return $this->escapeWhenCastingToString
- ? e($this->toJson())
- : $this->toJson();
- }
-
- /**
- * Indicate that the model's string representation should be escaped when __toString is invoked.
- *
- * @param bool $escape
- * @return $this
- */
- public function escapeWhenCastingToString($escape = true)
- {
- $this->escapeWhenCastingToString = $escape;
-
- return $this;
- }
-
- /**
- * Add a method to the list of proxied methods.
- *
- * @param string $method
- * @return void
- */
- public static function proxy($method)
- {
- static::$proxies[] = $method;
- }
-
- /**
- * Dynamically access collection proxies.
- *
- * @param string $key
- * @return mixed
- *
- * @throws \Exception
- */
- public function __get($key)
- {
- if (! in_array($key, static::$proxies)) {
- throw new Exception("Property [{$key}] does not exist on this collection instance.");
- }
-
- return new HigherOrderCollectionProxy($this, $key);
- }
-
- /**
- * Results array of items from Collection or Arrayable.
- *
- * @param mixed $items
- * @return array
- */
- protected function getArrayableItems($items)
- {
- if (is_array($items)) {
- return $items;
- } elseif ($items instanceof Enumerable) {
- return $items->all();
- } elseif ($items instanceof Arrayable) {
- return $items->toArray();
- } elseif ($items instanceof Jsonable) {
- return json_decode($items->toJson(), true);
- } elseif ($items instanceof JsonSerializable) {
- return (array) $items->jsonSerialize();
- } elseif ($items instanceof Traversable) {
- return iterator_to_array($items);
- } elseif ($items instanceof UnitEnum) {
- return [$items];
- }
-
- return (array) $items;
- }
-
- /**
- * Get an operator checker callback.
- *
- * @param string $key
- * @param string|null $operator
- * @param mixed $value
- * @return \Closure
- */
- protected function operatorForWhere($key, $operator = null, $value = null)
- {
- if (func_num_args() === 1) {
- $value = true;
-
- $operator = '=';
- }
-
- if (func_num_args() === 2) {
- $value = $operator;
-
- $operator = '=';
- }
-
- return function ($item) use ($key, $operator, $value) {
- $retrieved = data_get($item, $key);
-
- $strings = array_filter([$retrieved, $value], function ($value) {
- return is_string($value) || (is_object($value) && method_exists($value, '__toString'));
- });
-
- if (count($strings) < 2 && count(array_filter([$retrieved, $value], 'is_object')) == 1) {
- return in_array($operator, ['!=', '<>', '!==']);
- }
-
- switch ($operator) {
- default:
- case '=':
- case '==': return $retrieved == $value;
- case '!=':
- case '<>': return $retrieved != $value;
- case '<': return $retrieved < $value;
- case '>': return $retrieved > $value;
- case '<=': return $retrieved <= $value;
- case '>=': return $retrieved >= $value;
- case '===': return $retrieved === $value;
- case '!==': return $retrieved !== $value;
- }
- };
- }
-
- /**
- * Determine if the given value is callable, but not a string.
- *
- * @param mixed $value
- * @return bool
- */
- protected function useAsCallable($value)
- {
- return ! is_string($value) && is_callable($value);
- }
-
- /**
- * Get a value retrieving callback.
- *
- * @param callable|string|null $value
- * @return callable
- */
- protected function valueRetriever($value)
- {
- if ($this->useAsCallable($value)) {
- return $value;
- }
-
- return function ($item) use ($value) {
- return data_get($item, $value);
- };
- }
-
- /**
- * Make a function to check an item's equality.
- *
- * @param mixed $value
- * @return \Closure
- */
- protected function equality($value)
- {
- return function ($item) use ($value) {
- return $item === $value;
- };
- }
-
- /**
- * Make a function using another function, by negating its result.
- *
- * @param \Closure $callback
- * @return \Closure
- */
- protected function negate(Closure $callback)
- {
- return function (...$params) use ($callback) {
- return ! $callback(...$params);
- };
- }
-
- /**
- * Make a function that returns what's passed to it.
- *
- * @return \Closure
- */
- protected function identity()
- {
- return function ($value) {
- return $value;
- };
- }
-}
diff --git a/vendor/tightenco/collect/src/Collect/Support/Traits/Macroable.php b/vendor/tightenco/collect/src/Collect/Support/Traits/Macroable.php
deleted file mode 100644
index 7e9fbd5..0000000
--- a/vendor/tightenco/collect/src/Collect/Support/Traits/Macroable.php
+++ /dev/null
@@ -1,126 +0,0 @@
-getMethods(
- ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED
- );
-
- foreach ($methods as $method) {
- if ($replace || ! static::hasMacro($method->name)) {
- $method->setAccessible(true);
- static::macro($method->name, $method->invoke($mixin));
- }
- }
- }
-
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- */
- public static function hasMacro($name)
- {
- return isset(static::$macros[$name]);
- }
-
- /**
- * Flush the existing macros.
- *
- * @return void
- */
- public static function flushMacros()
- {
- static::$macros = [];
- }
-
- /**
- * Dynamically handle calls to the class.
- *
- * @param string $method
- * @param array $parameters
- * @return mixed
- *
- * @throws \BadMethodCallException
- */
- public static function __callStatic($method, $parameters)
- {
- if (! static::hasMacro($method)) {
- throw new BadMethodCallException(sprintf(
- 'Method %s::%s does not exist.', static::class, $method
- ));
- }
-
- $macro = static::$macros[$method];
-
- if ($macro instanceof Closure) {
- $macro = $macro->bindTo(null, static::class);
- }
-
- return $macro(...$parameters);
- }
-
- /**
- * Dynamically handle calls to the class.
- *
- * @param string $method
- * @param array $parameters
- * @return mixed
- *
- * @throws \BadMethodCallException
- */
- public function __call($method, $parameters)
- {
- if (! static::hasMacro($method)) {
- throw new BadMethodCallException(sprintf(
- 'Method %s::%s does not exist.', static::class, $method
- ));
- }
-
- $macro = static::$macros[$method];
-
- if ($macro instanceof Closure) {
- $macro = $macro->bindTo($this, static::class);
- }
-
- return $macro(...$parameters);
- }
-}
diff --git a/vendor/tightenco/collect/src/Collect/Support/Traits/Tappable.php b/vendor/tightenco/collect/src/Collect/Support/Traits/Tappable.php
deleted file mode 100644
index 9d75d26..0000000
--- a/vendor/tightenco/collect/src/Collect/Support/Traits/Tappable.php
+++ /dev/null
@@ -1,17 +0,0 @@
- Illuminate\Contracts\Support\Arrayable::class,
- Tightenco\Collect\Contracts\Support\Jsonable::class => Illuminate\Contracts\Support\Jsonable::class,
- Tightenco\Collect\Contracts\Support\Htmlable::class => Illuminate\Contracts\Support\Htmlable::class,
- Tightenco\Collect\Contracts\Support\CanBeEscapedWhenCastToString::class => Illuminate\Contracts\Support\CanBeEscapedWhenCastToString::class,
- Tightenco\Collect\Support\Arr::class => Illuminate\Support\Arr::class,
- Tightenco\Collect\Support\Collection::class => Illuminate\Support\Collection::class,
- Tightenco\Collect\Support\Enumerable::class => Illuminate\Support\Enumerable::class,
- Tightenco\Collect\Support\HigherOrderCollectionProxy::class => Illuminate\Support\HigherOrderCollectionProxy::class,
- Tightenco\Collect\Support\HigherOrderWhenProxy::class => Illuminate\Support\HigherOrderWhenProxy::class,
- Tightenco\Collect\Support\LazyCollection::class => Illuminate\Support\LazyCollection::class,
- Tightenco\Collect\Support\Traits\EnumeratesValues::class => Illuminate\Support\Traits\EnumeratesValues::class,
-];
-
-# echo "\n\n-- Aliasing....\n---------------------------------------------\n\n";
-
-foreach ($aliases as $tighten => $illuminate) {
- if (! class_exists($illuminate) && ! interface_exists($illuminate) && ! trait_exists($illuminate)) {
- # echo "Aliasing {$tighten} to {$illuminate}.\n";
- class_alias($tighten, $illuminate);
- }
-}
diff --git a/vendor/tightenco/collect/src/Collect/Support/helpers.php b/vendor/tightenco/collect/src/Collect/Support/helpers.php
deleted file mode 100644
index 886a141..0000000
--- a/vendor/tightenco/collect/src/Collect/Support/helpers.php
+++ /dev/null
@@ -1,122 +0,0 @@
- $segment) {
- unset($key[$i]);
-
- if (is_null($segment)) {
- return $target;
- }
-
- if ($segment === '*') {
- if ($target instanceof Collection) {
- $target = $target->all();
- } elseif (! is_array($target)) {
- return value($default);
- }
-
- $result = [];
-
- foreach ($target as $item) {
- $result[] = data_get($item, $key);
- }
-
- return in_array('*', $key) ? Arr::collapse($result) : $result;
- }
-
- if (Arr::accessible($target) && Arr::exists($target, $segment)) {
- $target = $target[$segment];
- } elseif (is_object($target) && isset($target->{$segment})) {
- $target = $target->{$segment};
- } else {
- return value($default);
- }
- }
-
- return $target;
- }
- }
-
- if (! function_exists('tap')) {
- /**
- * Call the given Closure with the given value then return the value.
- *
- * @param mixed $value
- * @param callable|null $callback
- * @return mixed
- */
- function tap($value, $callback = null)
- {
- if (is_null($callback)) {
- return new HigherOrderTapProxy($value);
- }
-
- $callback($value);
-
- return $value;
- }
- }
-
- if (! function_exists('class_basename')) {
- /**
- * Get the class "basename" of the given object / class.
- *
- * @param string|object $class
- * @return string
- */
- function class_basename($class)
- {
- $class = is_object($class) ? get_class($class) : $class;
-
- return basename(str_replace('\\', '/', $class));
- }
- }
-}
diff --git a/vendor/topthink/framework/.github/workflows/build.yml b/vendor/topthink/framework/.github/workflows/build.yml
new file mode 100644
index 0000000..f2f5537
--- /dev/null
+++ b/vendor/topthink/framework/.github/workflows/build.yml
@@ -0,0 +1,48 @@
+name: build
+
+on:
+ push:
+ branches:
+ - "8.0"
+ pull_request:
+ schedule:
+ - cron: "0 0 * * *"
+
+jobs:
+ tests:
+ runs-on: ubuntu-22.04
+
+ strategy:
+ fail-fast: true
+ matrix:
+ php: [8.0, 8.1, 8.2]
+
+ name: PHP ${{ matrix.php }}
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 10
+
+ - name: Setup PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php }}
+ tools: composer:v2
+ coverage: xdebug
+
+ - name: Install dependencies
+ uses: nick-fields/retry@v2
+ with:
+ timeout_minutes: 5
+ max_attempts: 5
+ command: composer update --prefer-dist --no-interaction --prefer-stable --no-suggest
+
+ - name: Execute tests
+ run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml
+
+ - name: Upload Scrutinizer coverage
+ uses: sudo-bot/action-scrutinizer@latest
+ with:
+ cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
diff --git a/vendor/topthink/framework/.gitignore b/vendor/topthink/framework/.gitignore
index b2fd3b9..1accf15 100644
--- a/vendor/topthink/framework/.gitignore
+++ b/vendor/topthink/framework/.gitignore
@@ -7,4 +7,5 @@ Thumbs.db
/.vscode
/.settings
/.buildpath
-/.project
\ No newline at end of file
+/.project
+.phpunit.result.cache
diff --git a/vendor/topthink/framework/.travis.yml b/vendor/topthink/framework/.travis.yml
deleted file mode 100644
index abaa271..0000000
--- a/vendor/topthink/framework/.travis.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-dist: xenial
-language: php
-
-matrix:
- fast_finish: true
- include:
- - php: 7.2
- - php: 7.3
- - php: 8.0
-
-cache:
- directories:
- - $HOME/.composer/cache
-
-services:
- - memcached
- - redis-server
- - mysql
-
-before_install:
- - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- - echo 'xdebug.mode = coverage' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- - printf "\n" | pecl install -f redis
- - travis_retry composer self-update
- - mysql -e 'CREATE DATABASE test;'
-
-install:
- - travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest
-
-script:
- - vendor/bin/phpunit --coverage-clover build/logs/coverage.xml
-
-after_script:
- - travis_retry wget https://scrutinizer-ci.com/ocular.phar
- - php ocular.phar code-coverage:upload --format=php-clover build/logs/coverage.xml
diff --git a/vendor/topthink/framework/LICENSE.txt b/vendor/topthink/framework/LICENSE.txt
index 4e910bb..3dcd79f 100644
--- a/vendor/topthink/framework/LICENSE.txt
+++ b/vendor/topthink/framework/LICENSE.txt
@@ -1,6 +1,6 @@
ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
-版权所有Copyright © 2006-2019 by ThinkPHP (http://thinkphp.cn)
+版权所有Copyright © 2006-2023 by ThinkPHP (http://thinkphp.cn)
All rights reserved。
ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
diff --git a/vendor/topthink/framework/README.md b/vendor/topthink/framework/README.md
index dd38e34..906d042 100644
--- a/vendor/topthink/framework/README.md
+++ b/vendor/topthink/framework/README.md
@@ -1,39 +1,44 @@
-
+
-ThinkPHP 6.1
+ThinkPHP 8.0
===============
-[](https://travis-ci.org/top-think/framework)
-[](https://scrutinizer-ci.com/g/top-think/framework/?branch=6.0)
-[](https://scrutinizer-ci.com/g/top-think/framework/?branch=6.0)
+[](https://github.com/top-think/framework/actions)
+[](https://scrutinizer-ci.com/g/top-think/framework/?branch=8.0)
+[](https://scrutinizer-ci.com/g/top-think/framework/?branch=8.0)
[](https://packagist.org/packages/topthink/framework)
[](https://packagist.org/packages/topthink/framework)
-[](http://www.php.net/)
+[](http://www.php.net/)
[](https://packagist.org/packages/topthink/framework)
+## 主要特性
-[官方服务](https://www.topthink.com) | [`ThinkAPI`——官方统一API](https://doc.topthink.com/think-api)
-
-## 主要新特性
-
-* 采用`PHP7`强类型(严格模式)
-* 支持更多的`PSR`规范
-* 原生多应用支持
-* 系统服务注入支持
-* ORM作为独立组件使用
-* 全新的事件系统
-* 模板引擎分离出核心
-* 内部功能中间件化
-* SESSION机制改进
-* 日志多通道支持
-* 规范扩展接口
-* 更强大的控制台
-* 对Swoole以及协程支持改进
-* 对IDE更加友好
-* 统一和精简大量用法
+* 基于PHP`8.0+`重构
+* 升级`PSR`依赖
+* 依赖`think-orm`3.0版本
+* `6.0`/`6.1`无缝升级
-> ThinkPHP6.1的运行环境要求PHP7.2.5+,最高兼容PHP8.2
+> ThinkPHP8.0的运行环境要求PHP8.0.0+
+
+现在开始,你可以使用官方提供的[ThinkChat](https://chat.topthink.com/),让你在学习ThinkPHP的旅途中享受私人AI助理服务!
+
+[](https://chat.topthink.com/)
+
+ThinkPHP生态服务由[顶想云](https://www.topthink.com)(TOPThink Cloud)提供,为生态提供专业的开发者服务和价值之选。
+
+## 文档
+
+[完全开发手册](https://doc.thinkphp.cn)
+
+
+## 赞助商
+
+全新的[赞助计划](https://www.thinkphp.cn/sponsor)可以让你通过我们的网站、手册、欢迎页及GIT仓库获得巨大曝光,同时提升企业的品牌声誉,也更好保障ThinkPHP的可持续发展。
+
+[](https://www.thinkphp.cn/sponsor/special)
+
+[](https://www.thinkphp.cn/sponsor)
## 安装
@@ -59,13 +64,9 @@ http://localhost:8000
composer update topthink/framework
~~~
-## 文档
-
-[完全开发手册](https://www.kancloud.cn/manual/thinkphp6_0/content)
-
## 命名规范
-`ThinkPHP6`遵循PSR-2命名规范和PSR-4自动加载规范。
+`ThinkPHP`遵循PSR-2命名规范和PSR-4自动加载规范。
## 参与开发
@@ -77,7 +78,7 @@ ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
本项目包含的第三方源码和二进制文件之版权信息另行标注。
-版权所有Copyright © 2006-2021 by ThinkPHP (http://thinkphp.cn) All rights reserved。
+版权所有Copyright © 2006-2023 by ThinkPHP (http://thinkphp.cn) All rights reserved。
ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
diff --git a/vendor/topthink/framework/composer.json b/vendor/topthink/framework/composer.json
index 2d9685e..53c7d80 100644
--- a/vendor/topthink/framework/composer.json
+++ b/vendor/topthink/framework/composer.json
@@ -19,20 +19,20 @@
}
],
"require": {
- "php": ">=7.2.5",
+ "php": ">=8.0.0",
"ext-json": "*",
"ext-mbstring": "*",
- "psr/log": "~1.0",
- "psr/container": "~1.0",
- "psr/simple-cache": "^1.0",
+ "psr/log": "^3.0",
+ "psr/container": "^2.0",
+ "psr/simple-cache": "^3.0",
"psr/http-message": "^1.0",
- "topthink/think-orm": "^2.0|^3.0",
- "topthink/think-helper": "^3.1.1"
+ "topthink/think-orm": "^3.0",
+ "topthink/think-helper": "^3.1"
},
"require-dev": {
"mikey179/vfsstream": "^1.6",
"mockery/mockery": "^1.2",
- "phpunit/phpunit": "^7.0",
+ "phpunit/phpunit": "^9.5",
"guzzlehttp/psr7": "^2.1.0"
},
"autoload": {
diff --git a/vendor/topthink/framework/phpunit.xml.dist b/vendor/topthink/framework/phpunit.xml.dist
index e20a133..4966885 100644
--- a/vendor/topthink/framework/phpunit.xml.dist
+++ b/vendor/topthink/framework/phpunit.xml.dist
@@ -1,5 +1,6 @@
-
+
+
+ ./src/think
+
+
./tests
-
-
- ./src/think
-
-
diff --git a/vendor/topthink/framework/src/helper.php b/vendor/topthink/framework/src/helper.php
index caba0ae..a8f9ff9 100644
--- a/vendor/topthink/framework/src/helper.php
+++ b/vendor/topthink/framework/src/helper.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
//------------------------
// ThinkPHP 助手函数
@@ -100,7 +100,7 @@ if (!function_exists('cache')) {
if ('' === $value) {
// 获取缓存
- return 0 === strpos($name, '?') ? Cache::has(substr($name, 1)) : Cache::get($name);
+ return str_starts_with($name, '?') ? Cache::has(substr($name, 1)) : Cache::get($name);
} elseif (is_null($value)) {
// 删除缓存
return Cache::delete($name);
@@ -134,7 +134,7 @@ if (!function_exists('config')) {
return Config::set($name, $value);
}
- return 0 === strpos($name, '?') ? Config::has(substr($name, 1)) : Config::get($name, $value);
+ return str_starts_with($name, '?') ? Config::has(substr($name, 1)) : Config::get($name, $value);
}
}
@@ -153,7 +153,7 @@ if (!function_exists('cookie')) {
Cookie::delete($name, $option ?: []);
} elseif ('' === $value) {
// 获取
- return 0 === strpos($name, '?') ? Cookie::has(substr($name, 1)) : Cookie::get($name);
+ return str_starts_with($name, '?') ? Cookie::has(substr($name, 1)) : Cookie::get($name);
} else {
// 设置
return Cookie::set($name, $value, $option);
@@ -253,7 +253,7 @@ if (!function_exists('input')) {
*/
function input(string $key = '', $default = null, $filter = '')
{
- if (0 === strpos($key, '?')) {
+ if (str_starts_with($key, '?')) {
$key = substr($key, 1);
$has = true;
}
@@ -275,8 +275,8 @@ if (!function_exists('input')) {
}
return isset($has) ?
- request()->has($key, $method) :
- request()->$method($key, $default, $filter);
+ request()->has($key, $method) :
+ request()->$method($key, $default, $filter);
}
}
@@ -422,7 +422,7 @@ if (!function_exists('session')) {
Session::delete($name);
} elseif ('' === $value) {
// 判断或获取
- return 0 === strpos($name, '?') ? Session::has(substr($name, 1)) : Session::get($name);
+ return str_starts_with($name, '?') ? Session::has(substr($name, 1)) : Session::get($name);
} else {
// 设置
Session::set($name, $value);
@@ -522,12 +522,12 @@ if (!function_exists('validate')) {
$v->rule($validate);
}
} else {
- if (strpos($validate, '.')) {
+ if (str_contains($validate, '.')) {
// 支持场景
[$validate, $scene] = explode('.', $validate);
}
- $class = false !== strpos($validate, '\\') ? $validate : app()->parseClass('validate', $validate);
+ $class = str_contains($validate, '\\') ? $validate : app()->parseClass('validate', $validate);
$v = new $class();
diff --git a/vendor/topthink/framework/src/lang/zh-cn.php b/vendor/topthink/framework/src/lang/zh-cn.php
index a546330..9bfb60b 100644
--- a/vendor/topthink/framework/src/lang/zh-cn.php
+++ b/vendor/topthink/framework/src/lang/zh-cn.php
@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
@@ -100,6 +100,10 @@ return [
':attribute must be numeric' => ':attribute必须是数字',
':attribute must be integer' => ':attribute必须是整数',
':attribute must be float' => ':attribute必须是浮点数',
+ ':attribute must be string' => ':attribute必须是字符串',
+ ':attribute must start with :rule' => ':attribute必须以 :rule 开头',
+ ':attribute must end with :rule' => ':attribute必须以 :rule 结尾',
+ ':attribute must contain :rule' => ':attribute必须包含 :rule',
':attribute must be bool' => ':attribute必须是布尔值',
':attribute not a valid email address' => ':attribute格式不符',
':attribute not a valid mobile' => ':attribute格式不符',
diff --git a/vendor/topthink/framework/src/think/App.php b/vendor/topthink/framework/src/think/App.php
index 5aa4a87..f4cd3ee 100644
--- a/vendor/topthink/framework/src/think/App.php
+++ b/vendor/topthink/framework/src/think/App.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -38,7 +38,7 @@ use think\initializer\RegisterService;
*/
class App extends Container
{
- const VERSION = '6.1.3';
+ const VERSION = '8.0.0';
/**
* 应用调试模式
@@ -188,7 +188,7 @@ class App extends Container
* @param bool $force 强制重新注册
* @return Service|null
*/
- public function register($service, bool $force = false)
+ public function register(Service|string $service, bool $force = false)
{
$registered = $this->getService($service);
@@ -217,7 +217,7 @@ class App extends Container
* @param Service $service 服务
* @return mixed
*/
- public function bootService($service)
+ public function bootService(Service $service)
{
if (method_exists($service, 'boot')) {
return $this->invoke([$service, 'boot']);
@@ -229,9 +229,9 @@ class App extends Container
* @param string|Service $service
* @return Service|null
*/
- public function getService($service)
+ public function getService(Service|string $service): ?Service
{
- $name = is_string($service) ? $service : get_class($service);
+ $name = is_string($service) ? $service : $service::class;
return array_values(array_filter($this->services, function ($value) use ($name) {
return $value instanceof $name;
}, ARRAY_FILTER_USE_BOTH))[0] ?? null;
@@ -477,7 +477,7 @@ class App extends Container
* 加载语言包
* @return void
*/
- public function loadLangPack()
+ public function loadLangPack(): void
{
// 加载默认语言包
$langSet = $this->lang->defaultLangSet();
@@ -616,5 +616,4 @@ class App extends Container
{
return dirname($this->thinkPath, 4) . DIRECTORY_SEPARATOR;
}
-
}
diff --git a/vendor/topthink/framework/src/think/Cache.php b/vendor/topthink/framework/src/think/Cache.php
index f802b55..822fbe0 100644
--- a/vendor/topthink/framework/src/think/Cache.php
+++ b/vendor/topthink/framework/src/think/Cache.php
@@ -2,16 +2,17 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types = 1);
namespace think;
+use DateInterval;
use Psr\SimpleCache\CacheInterface;
use think\cache\Driver;
use think\cache\TagSet;
@@ -32,7 +33,7 @@ class Cache extends Manager implements CacheInterface
* 默认驱动
* @return string|null
*/
- public function getDefaultDriver()
+ public function getDefaultDriver(): ?string
{
return $this->getConfig('default');
}
@@ -57,7 +58,7 @@ class Cache extends Manager implements CacheInterface
* 获取驱动配置
* @param string $store
* @param string $name
- * @param null $default
+ * @param mixed $default
* @return array
*/
public function getStoreConfig(string $store, string $name = null, $default = null)
@@ -82,7 +83,7 @@ class Cache extends Manager implements CacheInterface
/**
* 连接或者切换缓存
* @access public
- * @param string $name 连接配置名
+ * @param string|null $name 连接配置名
* @return Driver
*/
public function store(string $name = null)
@@ -107,7 +108,7 @@ class Cache extends Manager implements CacheInterface
* @param mixed $default 默认值
* @return mixed
*/
- public function get($key, $default = null)
+ public function get(string $key, mixed $default = null): mixed
{
return $this->store()->get($key, $default);
}
@@ -120,7 +121,7 @@ class Cache extends Manager implements CacheInterface
* @param int|\DateTime $ttl 有效时间 0为永久
* @return bool
*/
- public function set($key, $value, $ttl = null): bool
+ public function set(string $key, mixed $value, int|DateInterval $ttl = null): bool
{
return $this->store()->set($key, $value, $ttl);
}
@@ -131,7 +132,7 @@ class Cache extends Manager implements CacheInterface
* @param string $key 缓存变量名
* @return bool
*/
- public function delete($key): bool
+ public function delete(string $key): bool
{
return $this->store()->delete($key);
}
@@ -144,7 +145,7 @@ class Cache extends Manager implements CacheInterface
* @return iterable
* @throws InvalidArgumentException
*/
- public function getMultiple($keys, $default = null): iterable
+ public function getMultiple(iterable $keys, mixed $default = null): iterable
{
return $this->store()->getMultiple($keys, $default);
}
@@ -156,7 +157,7 @@ class Cache extends Manager implements CacheInterface
* @param null|int|\DateInterval $ttl 有效时间 0为永久
* @return bool
*/
- public function setMultiple($values, $ttl = null): bool
+ public function setMultiple(iterable $values, int|DateInterval $ttl = null): bool
{
return $this->store()->setMultiple($values, $ttl);
}
@@ -168,7 +169,7 @@ class Cache extends Manager implements CacheInterface
* @return bool
* @throws InvalidArgumentException
*/
- public function deleteMultiple($keys): bool
+ public function deleteMultiple(iterable $keys): bool
{
return $this->store()->deleteMultiple($keys);
}
@@ -179,7 +180,7 @@ class Cache extends Manager implements CacheInterface
* @param string $key 缓存变量名
* @return bool
*/
- public function has($key): bool
+ public function has(string $key): bool
{
return $this->store()->has($key);
}
@@ -190,7 +191,7 @@ class Cache extends Manager implements CacheInterface
* @param string|array $name 标签名
* @return TagSet
*/
- public function tag($name): TagSet
+ public function tag(string|array $name): TagSet
{
return $this->store()->tag($name);
}
diff --git a/vendor/topthink/framework/src/think/Config.php b/vendor/topthink/framework/src/think/Config.php
index 9162e82..b0288c7 100644
--- a/vendor/topthink/framework/src/think/Config.php
+++ b/vendor/topthink/framework/src/think/Config.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -24,26 +24,12 @@ class Config
*/
protected $config = [];
- /**
- * 配置文件目录
- * @var string
- */
- protected $path;
-
- /**
- * 配置文件后缀
- * @var string
- */
- protected $ext;
-
/**
* 构造方法
* @access public
*/
- public function __construct(string $path = null, string $ext = '.php')
+ public function __construct(protected string $path = '', protected string $ext = '.php')
{
- $this->path = $path ?: '';
- $this->ext = $ext;
}
public static function __make(App $app)
@@ -87,23 +73,13 @@ class Config
{
$type = pathinfo($file, PATHINFO_EXTENSION);
$config = [];
- switch ($type) {
- case 'php':
- $config = include $file;
- break;
- case 'yml':
- case 'yaml':
- if (function_exists('yaml_parse_file')) {
- $config = yaml_parse_file($file);
- }
- break;
- case 'ini':
- $config = parse_ini_file($file, true, INI_SCANNER_TYPED) ?: [];
- break;
- case 'json':
- $config = json_decode(file_get_contents($file), true);
- break;
- }
+ $config = match ($type) {
+ 'php' => include $file,
+ 'yml','yaml' => function_exists('yaml_parse_file') ? yaml_parse_file($file) : [],
+ 'ini' => parse_ini_file($file, true, INI_SCANNER_TYPED) ?: [],
+ 'json' => json_decode(file_get_contents($file), true),
+ default => [],
+ };
return is_array($config) ? $this->set($config, strtolower($name)) : [];
}
@@ -116,7 +92,7 @@ class Config
*/
public function has(string $name): bool
{
- if (false === strpos($name, '.') && !isset($this->config[strtolower($name)])) {
+ if (!str_contains($name, '.') && !isset($this->config[strtolower($name)])) {
return false;
}
@@ -150,7 +126,7 @@ class Config
return $this->config;
}
- if (false === strpos($name, '.')) {
+ if (!str_contains($name, '.')) {
return $this->pull($name);
}
@@ -179,19 +155,19 @@ class Config
*/
public function set(array $config, string $name = null): array
{
- if (!empty($name)) {
- if (isset($this->config[$name])) {
- $result = array_merge($this->config[$name], $config);
- } else {
- $result = $config;
- }
-
- $this->config[$name] = $result;
- } else {
- $result = $this->config = array_merge($this->config, array_change_key_case($config));
+ if (empty($name)) {
+ $this->config = array_merge($this->config, array_change_key_case($config));
+ return $this->config;
}
+ if (isset($this->config[$name])) {
+ $result = array_merge($this->config[$name], $config);
+ } else {
+ $result = $config;
+ }
+
+ $this->config[$name] = $result;
+
return $result;
}
-
}
diff --git a/vendor/topthink/framework/src/think/Console.php b/vendor/topthink/framework/src/think/Console.php
index 27f12ba..91af08b 100644
--- a/vendor/topthink/framework/src/think/Console.php
+++ b/vendor/topthink/framework/src/think/Console.php
@@ -46,9 +46,6 @@ use think\console\output\driver\Buffer;
*/
class Console
{
-
- protected $app;
-
/** @var Command[] */
protected $commands = [];
@@ -87,10 +84,8 @@ class Console
*/
protected static $startCallbacks = [];
- public function __construct(App $app)
+ public function __construct(protected App $app)
{
- $this->app = $app;
-
$this->initialize();
$this->definition = $this->getDefaultInputDefinition();
@@ -104,7 +99,7 @@ class Console
/**
* 初始化
*/
- protected function initialize()
+ protected function initialize():void
{
if (!$this->app->initialized()) {
$this->app->initialize();
@@ -115,7 +110,7 @@ class Console
/**
* 构造request
*/
- protected function makeRequest()
+ protected function makeRequest():void
{
$url = $this->app->config->get('app.url', 'http://localhost');
@@ -401,7 +396,7 @@ class Console
* @param string $name 指令名 留空则自动获取
* @return Command|void
*/
- public function addCommand($command, string $name = '')
+ public function addCommand(string|Command $command, string $name = '')
{
if ($name) {
$this->commands[$name] = $command;
@@ -422,7 +417,7 @@ class Console
$command->setApp($this->app);
if (null === $command->getDefinition()) {
- throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', get_class($command)));
+ throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', $command::class));
}
$this->commands[$command->getName()] = $command;
@@ -717,7 +712,7 @@ class Console
* @param array|\Traversable $collection
* @return array
*/
- private function findAlternatives(string $name, $collection): array
+ private function findAlternatives(string $name, array|\Traversable $collection): array
{
$threshold = 1e3;
$alternatives = [];
@@ -738,7 +733,7 @@ class Console
}
$lev = levenshtein($subname, $parts[$i]);
- if ($lev <= strlen($subname) / 3 || '' !== $subname && false !== strpos($parts[$i], $subname)) {
+ if ($lev <= strlen($subname) / 3 || '' !== $subname && str_contains($parts[$i], $subname)) {
$alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev;
} elseif ($exists) {
$alternatives[$collectionName] += $threshold;
@@ -748,7 +743,7 @@ class Console
foreach ($collection as $item) {
$lev = levenshtein($name, $item);
- if ($lev <= strlen($name) / 3 || false !== strpos($item, $name)) {
+ if ($lev <= strlen($name) / 3 || str_contains($item, $name)) {
$alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev;
}
}
diff --git a/vendor/topthink/framework/src/think/Container.php b/vendor/topthink/framework/src/think/Container.php
index f286c73..e6a365e 100644
--- a/vendor/topthink/framework/src/think/Container.php
+++ b/vendor/topthink/framework/src/think/Container.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -21,6 +21,7 @@ use IteratorAggregate;
use Psr\Container\ContainerInterface;
use ReflectionClass;
use ReflectionException;
+use ReflectionNamedType;
use ReflectionFunction;
use ReflectionFunctionAbstract;
use ReflectionMethod;
@@ -94,7 +95,7 @@ class Container implements ContainerInterface, ArrayAccess, IteratorAggregate, C
* @param Closure|null $callback
* @return void
*/
- public function resolving($abstract, Closure $callback = null): void
+ public function resolving(string|Closure $abstract, Closure $callback = null): void
{
if ($abstract instanceof Closure) {
$this->invokeCallback['*'][] = $abstract;
@@ -125,7 +126,7 @@ class Container implements ContainerInterface, ArrayAccess, IteratorAggregate, C
* @param string|class-string $abstract 类名或者标识
* @return T|object
*/
- public function get($abstract)
+ public function get(string $abstract)
{
if ($this->has($abstract)) {
return $this->make($abstract);
@@ -141,7 +142,7 @@ class Container implements ContainerInterface, ArrayAccess, IteratorAggregate, C
* @param mixed $concrete 要绑定的类、闭包或者实例
* @return $this
*/
- public function bind($abstract, $concrete = null)
+ public function bind(string|array $abstract, $concrete = null)
{
if (is_array($abstract)) {
foreach ($abstract as $key => $val) {
@@ -212,7 +213,7 @@ class Container implements ContainerInterface, ArrayAccess, IteratorAggregate, C
* @param string $name 类名或者标识
* @return bool
*/
- public function has($name): bool
+ public function has(string $name): bool
{
return $this->bound($name);
}
@@ -265,7 +266,7 @@ class Container implements ContainerInterface, ArrayAccess, IteratorAggregate, C
* @param string $name 类名或者标识
* @return void
*/
- public function delete($name)
+ public function delete(string $name)
{
$name = $this->getAlias($name);
@@ -281,7 +282,7 @@ class Container implements ContainerInterface, ArrayAccess, IteratorAggregate, C
* @param array $vars 参数
* @return mixed
*/
- public function invokeFunction($function, array $vars = [])
+ public function invokeFunction(string|Closure $function, array $vars = [])
{
try {
$reflect = new ReflectionFunction($function);
@@ -316,7 +317,7 @@ class Container implements ContainerInterface, ArrayAccess, IteratorAggregate, C
try {
$reflect = new ReflectionMethod($class, $method);
} catch (ReflectionException $e) {
- $class = is_object($class) ? get_class($class) : $class;
+ $class = is_object($class) ? $class::class : $class;
throw new FuncNotFoundException('method not exists: ' . $class . '::' . $method . '()', "{$class}::{$method}", $e);
}
@@ -356,7 +357,7 @@ class Container implements ContainerInterface, ArrayAccess, IteratorAggregate, C
{
if ($callable instanceof Closure) {
return $this->invokeFunction($callable, $vars);
- } elseif (is_string($callable) && false === strpos($callable, '::')) {
+ } elseif (is_string($callable) && !str_contains($callable, '::')) {
return $this->invokeFunction($callable, $vars);
} else {
return $this->invokeMethod($callable, $vars, $accessible);
@@ -447,7 +448,7 @@ class Container implements ContainerInterface, ArrayAccess, IteratorAggregate, C
if ($param->isVariadic()) {
return array_merge($args, array_values($vars));
- } elseif ($reflectionType && $reflectionType instanceof \ReflectionNamedType && $reflectionType->isBuiltin() === false) {
+ } elseif ($reflectionType && $reflectionType instanceof ReflectionNamedType && $reflectionType->isBuiltin() === false) {
$args[] = $this->getObjectParam($reflectionType->getName(), $vars);
} elseif (1 == $type && !empty($vars)) {
$args[] = array_shift($vars);
@@ -476,7 +477,7 @@ class Container implements ContainerInterface, ArrayAccess, IteratorAggregate, C
*/
public static function factory(string $name, string $namespace = '', ...$args)
{
- $class = false !== strpos($name, '\\') ? $name : $namespace . ucwords($name);
+ $class = str_contains($name, '\\') ? $name : $namespace . ucwords($name);
return Container::getInstance()->invokeClass($class, $args);
}
@@ -523,26 +524,22 @@ class Container implements ContainerInterface, ArrayAccess, IteratorAggregate, C
$this->delete($name);
}
- #[\ReturnTypeWillChange]
- public function offsetExists($key): bool
+ public function offsetExists(mixed $key): bool
{
return $this->exists($key);
}
- #[\ReturnTypeWillChange]
- public function offsetGet($key)
+ public function offsetGet(mixed $key): mixed
{
return $this->make($key);
}
- #[\ReturnTypeWillChange]
- public function offsetSet($key, $value)
+ public function offsetSet(mixed $key, mixed $value): void
{
$this->bind($key, $value);
}
- #[\ReturnTypeWillChange]
- public function offsetUnset($key)
+ public function offsetUnset(mixed $key): void
{
$this->delete($key);
}
diff --git a/vendor/topthink/framework/src/think/Cookie.php b/vendor/topthink/framework/src/think/Cookie.php
index 04774a6..41eeac3 100644
--- a/vendor/topthink/framework/src/think/Cookie.php
+++ b/vendor/topthink/framework/src/think/Cookie.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -45,19 +45,12 @@ class Cookie
*/
protected $cookie = [];
- /**
- * 当前Request对象
- * @var Request
- */
- protected $request;
-
/**
* 构造方法
* @access public
*/
- public function __construct(Request $request, array $config = [])
+ public function __construct(protected Request $request, array $config = [])
{
- $this->request = $request;
$this->config = array_merge($this->config, array_change_key_case($config));
}
@@ -215,18 +208,13 @@ class Cookie
*/
protected function saveCookie(string $name, string $value, int $expire, string $path, string $domain, bool $secure, bool $httponly, string $samesite): void
{
- if (version_compare(PHP_VERSION, '7.3.0', '>=')) {
- setcookie($name, $value, [
- 'expires' => $expire,
- 'path' => $path,
- 'domain' => $domain,
- 'secure' => $secure,
- 'httponly' => $httponly,
- 'samesite' => $samesite,
- ]);
- } else {
- setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
- }
+ setcookie($name, $value, [
+ 'expires' => $expire,
+ 'path' => $path,
+ 'domain' => $domain,
+ 'secure' => $secure,
+ 'httponly' => $httponly,
+ 'samesite' => $samesite,
+ ]);
}
-
}
diff --git a/vendor/topthink/framework/src/think/Db.php b/vendor/topthink/framework/src/think/Db.php
index 0048874..809e04f 100644
--- a/vendor/topthink/framework/src/think/Db.php
+++ b/vendor/topthink/framework/src/think/Db.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -46,7 +46,7 @@ class Db extends DbManager
* @access public
* @return void
*/
- protected function modelMaker()
+ protected function modelMaker(): void
{
}
diff --git a/vendor/topthink/framework/src/think/Env.php b/vendor/topthink/framework/src/think/Env.php
index 9e1b7f4..f1772ea 100644
--- a/vendor/topthink/framework/src/think/Env.php
+++ b/vendor/topthink/framework/src/think/Env.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -89,10 +89,8 @@ class Env implements ArrayAccess
return $default;
}
- if ('false' === $result) {
- $result = false;
- } elseif ('true' === $result) {
- $result = true;
+ if (isset($this->convert[$result])) {
+ $result = $this->convert[$result];
}
if (!isset($this->data[$name])) {
@@ -175,26 +173,22 @@ class Env implements ArrayAccess
}
// ArrayAccess
- #[\ReturnTypeWillChange]
- public function offsetSet($name, $value): void
+ public function offsetSet(mixed $name, mixed $value): void
{
$this->set($name, $value);
}
- #[\ReturnTypeWillChange]
- public function offsetExists($name): bool
+ public function offsetExists(mixed $name): bool
{
return $this->__isset($name);
}
- #[\ReturnTypeWillChange]
- public function offsetUnset($name): void
+ public function offsetUnset(mixed $name): void
{
throw new Exception('not support: unset');
}
- #[\ReturnTypeWillChange]
- public function offsetGet($name)
+ public function offsetGet(mixed $name): mixed
{
return $this->get($name);
}
diff --git a/vendor/topthink/framework/src/think/Event.php b/vendor/topthink/framework/src/think/Event.php
index 3c70aad..c806cf7 100644
--- a/vendor/topthink/framework/src/think/Event.php
+++ b/vendor/topthink/framework/src/think/Event.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -187,7 +187,7 @@ class Event
foreach ($methods as $method) {
$name = $method->getName();
- if (0 === strpos($name, 'on')) {
+ if (str_starts_with($name, 'on')) {
$this->listen($prefix . substr($name, 2), [$observer, $name]);
}
}
@@ -207,7 +207,7 @@ class Event
{
if (is_object($event)) {
$params = $event;
- $event = get_class($event);
+ $event = $event::class;
}
if (isset($this->bind[$event])) {
@@ -217,7 +217,7 @@ class Event
$result = [];
$listeners = $this->listener[$event] ?? [];
- if (strpos($event, '.')) {
+ if (str_contains($event, '.')) {
[$prefix, $event] = explode('.', $event, 2);
if (isset($this->listener[$prefix . '.*'])) {
$listeners = array_merge($listeners, $this->listener[$prefix . '.*']);
@@ -259,7 +259,7 @@ class Event
{
if (!is_string($event)) {
$call = $event;
- } elseif (strpos($event, '::')) {
+ } elseif (str_contains($event, '::')) {
$call = $event;
} else {
$obj = $this->app->make($event);
@@ -268,5 +268,4 @@ class Event
return $this->app->invoke($call, [$params]);
}
-
}
diff --git a/vendor/topthink/framework/src/think/Exception.php b/vendor/topthink/framework/src/think/Exception.php
index 5cf7954..4eb6d5c 100644
--- a/vendor/topthink/framework/src/think/Exception.php
+++ b/vendor/topthink/framework/src/think/Exception.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 麦当苗儿
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -52,9 +52,8 @@ class Exception extends \Exception
* @access public
* @return array 由setData设置的Debug数据
*/
- final public function getData()
+ final public function getData(): array
{
return $this->data;
}
-
}
diff --git a/vendor/topthink/framework/src/think/Facade.php b/vendor/topthink/framework/src/think/Facade.php
index 9a0e333..51378da 100644
--- a/vendor/topthink/framework/src/think/Facade.php
+++ b/vendor/topthink/framework/src/think/Facade.php
@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
@@ -53,7 +53,8 @@ class Facade
* @return string
*/
protected static function getFacadeClass()
- {}
+ {
+ }
/**
* 带参数实例化当前Facade类
diff --git a/vendor/topthink/framework/src/think/File.php b/vendor/topthink/framework/src/think/File.php
index 59230b5..bc67971 100644
--- a/vendor/topthink/framework/src/think/File.php
+++ b/vendor/topthink/framework/src/think/File.php
@@ -2,17 +2,18 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
use SplFileInfo;
+use Closure;
use think\exception\FileException;
/**
@@ -174,27 +175,20 @@ class File extends SplFileInfo
/**
* 自动生成文件名
* @access public
- * @param string|\Closure $rule
+ * @param string|Closure|null $rule
* @return string
*/
- public function hashName($rule = ''): string
+ public function hashName(string|Closure|null $rule = null): string
{
if (!$this->hashName) {
- if ($rule instanceof \Closure) {
+ if ($rule instanceof Closure) {
$this->hashName = call_user_func_array($rule, [$this]);
} else {
- switch (true) {
- case in_array($rule, hash_algos()):
- $hash = $this->hash($rule);
- $this->hashName = substr($hash, 0, 2) . DIRECTORY_SEPARATOR . substr($hash, 2);
- break;
- case is_callable($rule):
- $this->hashName = call_user_func($rule);
- break;
- default:
- $this->hashName = date('Ymd') . DIRECTORY_SEPARATOR . md5(microtime(true) . $this->getPathname());
- break;
- }
+ $this->hashName = match (true) {
+ in_array($rule, hash_algos()) && $hash = $this->hash($rule) => substr($hash, 0, 2) . DIRECTORY_SEPARATOR . substr($hash, 2),
+ is_callable($rule) => call_user_func($rule),
+ default => date('Ymd') . DIRECTORY_SEPARATOR . md5(microtime(true) . $this->getPathname()),
+ };
}
}
diff --git a/vendor/topthink/framework/src/think/Filesystem.php b/vendor/topthink/framework/src/think/Filesystem.php
deleted file mode 100644
index 0aee929..0000000
--- a/vendor/topthink/framework/src/think/Filesystem.php
+++ /dev/null
@@ -1,89 +0,0 @@
-
-// +----------------------------------------------------------------------
-declare (strict_types = 1);
-
-namespace think;
-
-use InvalidArgumentException;
-use think\filesystem\Driver;
-use think\filesystem\driver\Local;
-use think\helper\Arr;
-
-/**
- * Class Filesystem
- * @package think
- * @mixin Driver
- * @mixin Local
- */
-class Filesystem extends Manager
-{
- protected $namespace = '\\think\\filesystem\\driver\\';
-
- /**
- * @param null|string $name
- * @return Driver
- */
- public function disk(string $name = null): Driver
- {
- return $this->driver($name);
- }
-
- protected function resolveType(string $name)
- {
- return $this->getDiskConfig($name, 'type', 'local');
- }
-
- protected function resolveConfig(string $name)
- {
- return $this->getDiskConfig($name);
- }
-
- /**
- * 获取缓存配置
- * @access public
- * @param null|string $name 名称
- * @param mixed $default 默认值
- * @return mixed
- */
- public function getConfig(string $name = null, $default = null)
- {
- if (!is_null($name)) {
- return $this->app->config->get('filesystem.' . $name, $default);
- }
-
- return $this->app->config->get('filesystem');
- }
-
- /**
- * 获取磁盘配置
- * @param string $disk
- * @param null $name
- * @param null $default
- * @return array
- */
- public function getDiskConfig($disk, $name = null, $default = null)
- {
- if ($config = $this->getConfig("disks.{$disk}")) {
- return Arr::get($config, $name, $default);
- }
-
- throw new InvalidArgumentException("Disk [$disk] not found.");
- }
-
- /**
- * 默认驱动
- * @return string|null
- */
- public function getDefaultDriver()
- {
- return $this->getConfig('default');
- }
-}
diff --git a/vendor/topthink/framework/src/think/Http.php b/vendor/topthink/framework/src/think/Http.php
index 4e49c88..157078c 100644
--- a/vendor/topthink/framework/src/think/Http.php
+++ b/vendor/topthink/framework/src/think/Http.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -24,12 +24,6 @@ use Throwable;
*/
class Http
{
-
- /**
- * @var App
- */
- protected $app;
-
/**
* 应用名称
* @var string
@@ -54,10 +48,8 @@ class Http
*/
protected $isBind = false;
- public function __construct(App $app)
+ public function __construct(protected App $app)
{
- $this->app = $app;
-
$this->routePath = $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR;
}
@@ -91,7 +83,7 @@ class Http
*/
public function path(string $path)
{
- if (substr($path, -1) != DIRECTORY_SEPARATOR) {
+ if (str_ends_with($path, DIRECTORY_SEPARATOR)) {
$path .= DIRECTORY_SEPARATOR;
}
@@ -284,5 +276,4 @@ class Http
// 写入日志
$this->app->log->save();
}
-
}
diff --git a/vendor/topthink/framework/src/think/Lang.php b/vendor/topthink/framework/src/think/Lang.php
index b891084..d62c986 100644
--- a/vendor/topthink/framework/src/think/Lang.php
+++ b/vendor/topthink/framework/src/think/Lang.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -186,33 +186,15 @@ class Lang
*/
protected function parse(string $file): array
{
- $type = pathinfo($file, PATHINFO_EXTENSION);
+ $type = pathinfo($file, PATHINFO_EXTENSION);
+ $result = match ($type) {
+ 'php' => include $file,
+ 'yml','yaml'=> function_exists('yaml_parse_file') ? yaml_parse_file($file) : [],
+ 'json' => json_decode(file_get_contents($file), true),
+ default => [],
+ };
- switch ($type) {
- case 'php':
- $result = include $file;
- break;
- case 'yml':
- case 'yaml':
- if (function_exists('yaml_parse_file')) {
- $result = yaml_parse_file($file);
- }
- break;
- case 'json':
- $data = file_get_contents($file);
-
- if (false !== $data) {
- $data = json_decode($data, true);
-
- if (json_last_error() === JSON_ERROR_NONE) {
- $result = $data;
- }
- }
-
- break;
- }
-
- return isset($result) && is_array($result) ? $result : [];
+ return is_array($result) ? $result : [];
}
/**
@@ -226,7 +208,7 @@ class Lang
{
$range = $range ?: $this->range;
- if ($this->config['allow_group'] && strpos($name, '.')) {
+ if ($this->config['allow_group'] && str_contains($name, '.')) {
[$name1, $name2] = explode('.', $name, 2);
return isset($this->lang[$range][strtolower($name1)][$name2]);
}
@@ -255,7 +237,7 @@ class Lang
return $this->lang[$range] ?? [];
}
- if ($this->config['allow_group'] && strpos($name, '.')) {
+ if ($this->config['allow_group'] && str_contains($name, '.')) {
[$name1, $name2] = explode('.', $name, 2);
$value = $this->lang[$range][strtolower($name1)][$name2] ?? $name;
@@ -286,5 +268,4 @@ class Lang
return $value;
}
-
}
diff --git a/vendor/topthink/framework/src/think/Log.php b/vendor/topthink/framework/src/think/Log.php
index c31210c..d8dec64 100644
--- a/vendor/topthink/framework/src/think/Log.php
+++ b/vendor/topthink/framework/src/think/Log.php
@@ -2,18 +2,20 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
use InvalidArgumentException;
use Psr\Log\LoggerInterface;
+use Psr\Log\LoggerTrait;
+use Stringable;
use think\event\LogWrite;
use think\helper\Arr;
use think\log\Channel;
@@ -26,15 +28,16 @@ use think\log\ChannelSet;
*/
class Log extends Manager implements LoggerInterface
{
+ use LoggerTrait;
const EMERGENCY = 'emergency';
- const ALERT = 'alert';
- const CRITICAL = 'critical';
- const ERROR = 'error';
- const WARNING = 'warning';
- const NOTICE = 'notice';
- const INFO = 'info';
- const DEBUG = 'debug';
- const SQL = 'sql';
+ const ALERT = 'alert';
+ const CRITICAL = 'critical';
+ const ERROR = 'error';
+ const WARNING = 'warning';
+ const NOTICE = 'notice';
+ const INFO = 'info';
+ const DEBUG = 'debug';
+ const SQL = 'sql';
protected $namespace = '\\think\\log\\driver\\';
@@ -42,7 +45,7 @@ class Log extends Manager implements LoggerInterface
* 默认驱动
* @return string|null
*/
- public function getDefaultDriver()
+ public function getDefaultDriver(): ?string
{
return $this->getConfig('default');
}
@@ -66,11 +69,11 @@ class Log extends Manager implements LoggerInterface
/**
* 获取渠道配置
* @param string $channel
- * @param null $name
- * @param null $default
+ * @param string $name
+ * @param mixed $default
* @return array
*/
- public function getChannelConfig($channel, $name = null, $default = null)
+ public function getChannelConfig(string $channel, string $name = null, $default = null)
{
if ($config = $this->getConfig("channels.{$channel}")) {
return Arr::get($config, $name, $default);
@@ -84,7 +87,7 @@ class Log extends Manager implements LoggerInterface
* @param string|array $name 渠道名
* @return Channel|ChannelSet
*/
- public function channel($name = null)
+ public function channel(string|array $name = null)
{
if (is_array($name)) {
return new ChannelSet($this, $name);
@@ -102,7 +105,7 @@ class Log extends Manager implements LoggerInterface
{
$driver = parent::createDriver($name);
- $lazy = !$this->getChannelConfig($name, "realtime_write", false) && !$this->app->runningInConsole();
+ $lazy = !$this->getChannelConfig($name, "realtime_write", false) && !$this->app->runningInConsole();
$allow = array_merge($this->getConfig("level", []), $this->getChannelConfig($name, "level", []));
return new Channel($name, $driver, $allow, $lazy, $this->app->event);
@@ -119,7 +122,7 @@ class Log extends Manager implements LoggerInterface
* @param string|array $channel 日志通道名
* @return $this
*/
- public function clear($channel = '*')
+ public function clear(string|array $channel = '*')
{
if ('*' == $channel) {
$channel = array_keys($this->drivers);
@@ -136,7 +139,7 @@ class Log extends Manager implements LoggerInterface
* @param string|array $channel 日志通道名
* @return $this
*/
- public function close($channel = '*')
+ public function close(string|array $channel = '*')
{
if ('*' == $channel) {
$channel = array_keys($this->drivers);
@@ -217,120 +220,24 @@ class Log extends Manager implements LoggerInterface
/**
* 记录日志信息
* @access public
- * @param string $level 日志级别
- * @param mixed $message 日志信息
+ * @param mixed $level 日志级别
+ * @param string|Stringable $message 日志信息
* @param array $context 替换内容
* @return void
*/
- public function log($level, $message, array $context = []): void
+ public function log($level, string|Stringable $message, array $context = []): void
{
$this->record($message, $level, $context);
}
- /**
- * 记录emergency信息
- * @access public
- * @param mixed $message 日志信息
- * @param array $context 替换内容
- * @return void
- */
- public function emergency($message, array $context = []): void
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
- /**
- * 记录警报信息
- * @access public
- * @param mixed $message 日志信息
- * @param array $context 替换内容
- * @return void
- */
- public function alert($message, array $context = []): void
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
- /**
- * 记录紧急情况
- * @access public
- * @param mixed $message 日志信息
- * @param array $context 替换内容
- * @return void
- */
- public function critical($message, array $context = []): void
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
- /**
- * 记录错误信息
- * @access public
- * @param mixed $message 日志信息
- * @param array $context 替换内容
- * @return void
- */
- public function error($message, array $context = []): void
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
- /**
- * 记录warning信息
- * @access public
- * @param mixed $message 日志信息
- * @param array $context 替换内容
- * @return void
- */
- public function warning($message, array $context = []): void
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
- /**
- * 记录notice信息
- * @access public
- * @param mixed $message 日志信息
- * @param array $context 替换内容
- * @return void
- */
- public function notice($message, array $context = []): void
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
- /**
- * 记录一般信息
- * @access public
- * @param mixed $message 日志信息
- * @param array $context 替换内容
- * @return void
- */
- public function info($message, array $context = []): void
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
- /**
- * 记录调试信息
- * @access public
- * @param mixed $message 日志信息
- * @param array $context 替换内容
- * @return void
- */
- public function debug($message, array $context = []): void
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
/**
* 记录sql信息
* @access public
- * @param mixed $message 日志信息
+ * @param string|Stringable $message 日志信息
* @param array $context 替换内容
* @return void
*/
- public function sql($message, array $context = []): void
+ public function sql(string|Stringable $message, array $context = []): void
{
$this->log(__FUNCTION__, $message, $context);
}
diff --git a/vendor/topthink/framework/src/think/Manager.php b/vendor/topthink/framework/src/think/Manager.php
index ca3f6a5..93d3aed 100644
--- a/vendor/topthink/framework/src/think/Manager.php
+++ b/vendor/topthink/framework/src/think/Manager.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -17,9 +17,6 @@ use think\helper\Str;
abstract class Manager
{
- /** @var App */
- protected $app;
-
/**
* 驱动
* @var array
@@ -32,9 +29,8 @@ abstract class Manager
*/
protected $namespace = null;
- public function __construct(App $app)
+ public function __construct(protected App $app)
{
- $this->app = $app;
}
/**
@@ -93,8 +89,8 @@ abstract class Manager
*/
protected function resolveClass(string $type): string
{
- if ($this->namespace || false !== strpos($type, '\\')) {
- $class = false !== strpos($type, '\\') ? $type : $this->namespace . Str::studly($type);
+ if ($this->namespace || str_contains($type, '\\')) {
+ $class = str_contains($type, '\\') ? $type : $this->namespace . Str::studly($type);
if (class_exists($class)) {
return $class;
diff --git a/vendor/topthink/framework/src/think/Middleware.php b/vendor/topthink/framework/src/think/Middleware.php
index a3db0f2..6c12976 100644
--- a/vendor/topthink/framework/src/think/Middleware.php
+++ b/vendor/topthink/framework/src/think/Middleware.php
@@ -2,18 +2,17 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Slince
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
use Closure;
-use InvalidArgumentException;
use LogicException;
use think\exception\Handle;
use Throwable;
@@ -30,15 +29,8 @@ class Middleware
*/
protected $queue = [];
- /**
- * 应用对象
- * @var App
- */
- protected $app;
-
- public function __construct(App $app)
+ public function __construct(protected App $app)
{
- $this->app = $app;
}
/**
@@ -62,7 +54,7 @@ class Middleware
* @param string $type 中间件类型
* @return void
*/
- public function add($middleware, string $type = 'global'): void
+ public function add(array|string|Closure $middleware, string $type = 'global'): void
{
$middleware = $this->buildMiddleware($middleware, $type);
@@ -78,7 +70,7 @@ class Middleware
* @param mixed $middleware
* @return void
*/
- public function route($middleware): void
+ public function route(array|string|Closure $middleware): void
{
$this->add($middleware, 'route');
}
@@ -89,7 +81,7 @@ class Middleware
* @param mixed $middleware
* @return void
*/
- public function controller($middleware): void
+ public function controller(array|string|Closure $middleware): void
{
$this->add($middleware, 'controller');
}
@@ -100,7 +92,7 @@ class Middleware
* @param mixed $middleware
* @param string $type 中间件类型
*/
- public function unshift($middleware, string $type = 'global')
+ public function unshift(array|string|Closure $middleware, string $type = 'global')
{
$middleware = $this->buildMiddleware($middleware, $type);
@@ -188,11 +180,11 @@ class Middleware
/**
* 解析中间件
* @access protected
- * @param mixed $middleware
+ * @param array|string|Closure $middleware
* @param string $type 中间件类型
* @return array
*/
- protected function buildMiddleware($middleware, string $type): array
+ protected function buildMiddleware(array|string|Closure $middleware, string $type): array
{
if (is_array($middleware)) {
[$middleware, $params] = $middleware;
@@ -202,10 +194,6 @@ class Middleware
return [$middleware, $params ?? []];
}
- if (!is_string($middleware)) {
- throw new InvalidArgumentException('The middleware is invalid');
- }
-
//中间件别名检查
$alias = $this->app->config->get('middleware.alias', []);
@@ -253,5 +241,4 @@ class Middleware
}
return -1;
}
-
}
diff --git a/vendor/topthink/framework/src/think/Pipeline.php b/vendor/topthink/framework/src/think/Pipeline.php
index 77151f3..d20f413 100644
--- a/vendor/topthink/framework/src/think/Pipeline.php
+++ b/vendor/topthink/framework/src/think/Pipeline.php
@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
@@ -103,5 +103,4 @@ class Pipeline
}
throw $e;
}
-
}
diff --git a/vendor/topthink/framework/src/think/Request.php b/vendor/topthink/framework/src/think/Request.php
index 99f4f80..5d9f154 100644
--- a/vendor/topthink/framework/src/think/Request.php
+++ b/vendor/topthink/framework/src/think/Request.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -315,7 +315,7 @@ class Request implements ArrayAccess
$header = [];
$server = $_SERVER;
foreach ($server as $key => $val) {
- if (0 === strpos($key, 'HTTP_')) {
+ if (str_starts_with($key, 'HTTP_')) {
$key = str_replace('_', '-', strtolower(substr($key, 5)));
$header[$key] = $val;
}
@@ -500,7 +500,7 @@ class Request implements ArrayAccess
{
if (!$this->baseUrl) {
$str = $this->url();
- $this->baseUrl = strpos($str, '?') ? strstr($str, '?', true) : $str;
+ $this->baseUrl = str_contains($str, '?') ? strstr($str, '?', true) : $str;
}
return $complete ? $this->domain() . $this->baseUrl : $this->baseUrl;
@@ -526,7 +526,7 @@ class Request implements ArrayAccess
$url = $this->server('ORIG_SCRIPT_NAME');
} elseif (($pos = strpos($this->server('PHP_SELF'), '/' . $script_name)) !== false) {
$url = substr($this->server('SCRIPT_NAME'), 0, $pos) . '/' . $script_name;
- } elseif ($this->server('DOCUMENT_ROOT') && strpos($this->server('SCRIPT_FILENAME'), $this->server('DOCUMENT_ROOT')) === 0) {
+ } elseif ($this->server('DOCUMENT_ROOT') && str_starts_with($this->server('SCRIPT_FILENAME'), $this->server('DOCUMENT_ROOT'))) {
$url = str_replace('\\', '/', str_replace($this->server('DOCUMENT_ROOT'), '', $this->server('SCRIPT_FILENAME')));
}
}
@@ -558,7 +558,7 @@ class Request implements ArrayAccess
{
if (!$this->root) {
$file = $this->baseFile();
- if ($file && 0 !== strpos($this->url(), $file)) {
+ if ($file && !str_starts_with($this->url(), $file)) {
$file = str_replace('\\', '/', dirname($file));
}
$this->root = rtrim($file, '/');
@@ -575,7 +575,7 @@ class Request implements ArrayAccess
public function rootUrl(): string
{
$base = $this->root();
- $root = strpos($base, '.') ? ltrim(dirname($base), DIRECTORY_SEPARATOR) : $base;
+ $root = str_contains($base, '.') ? ltrim(dirname($base), DIRECTORY_SEPARATOR) : $base;
if ('' != $root) {
$root = '/' . ltrim($root, '/');
@@ -611,16 +611,16 @@ class Request implements ArrayAccess
unset($this->get[$this->varPathinfo]);
} elseif ($this->server('PATH_INFO')) {
$pathinfo = $this->server('PATH_INFO');
- } elseif (false !== strpos(PHP_SAPI, 'cli')) {
- $pathinfo = strpos($this->server('REQUEST_URI'), '?') ? strstr($this->server('REQUEST_URI'), '?', true) : $this->server('REQUEST_URI');
+ } elseif (str_contains(PHP_SAPI, 'cli')) {
+ $pathinfo = str_contains($this->server('REQUEST_URI'), '?') ? strstr($this->server('REQUEST_URI'), '?', true) : $this->server('REQUEST_URI');
}
// 分析PATHINFO信息
if (!isset($pathinfo)) {
foreach ($this->pathinfoFetch as $type) {
if ($this->server($type)) {
- $pathinfo = (0 === strpos($this->server($type), $this->server('SCRIPT_NAME'))) ?
- substr($this->server($type), strlen($this->server('SCRIPT_NAME'))) : $this->server($type);
+ $pathinfo = str_starts_with($this->server($type), $this->server('SCRIPT_NAME')) ?
+ substr($this->server($type), strlen($this->server('SCRIPT_NAME'))) : $this->server($type);
break;
}
}
@@ -828,7 +828,7 @@ class Request implements ArrayAccess
*/
public function isCgi(): bool
{
- return strpos(PHP_SAPI, 'cgi') === 0;
+ return str_starts_with(PHP_SAPI, 'cgi');
}
/**
@@ -845,18 +845,11 @@ class Request implements ArrayAccess
$method = $this->method(true);
// 自动获取请求变量
- switch ($method) {
- case 'POST':
- $vars = $this->post(false);
- break;
- case 'PUT':
- case 'DELETE':
- case 'PATCH':
- $vars = $this->put(false);
- break;
- default:
- $vars = [];
- }
+ $vars = match ($method) {
+ 'POST' => $this->post(false),
+ 'PUT','DELETE','PATCH' => $this->put(false),
+ default => [],
+ };
// 当前请求参数和URL地址中的参数合并
$this->param = array_merge($this->param, $this->get(false), $vars, $this->route(false));
@@ -878,7 +871,7 @@ class Request implements ArrayAccess
* @param string|array $filter 过滤方法
* @return mixed
*/
- public function all($name = '', $filter = '')
+ public function all(string|array $name = '', string|array $filter = '')
{
$data = array_merge($this->param(), $this->file() ?: []);
@@ -929,12 +922,12 @@ class Request implements ArrayAccess
/**
* 获取路由参数
* @access public
- * @param string|array $name 变量名
+ * @param string|array|bool $name 变量名
* @param mixed $default 默认值
* @param string|array $filter 过滤方法
* @return mixed
*/
- public function route($name = '', $default = null, $filter = '')
+ public function route(string|array|bool $name = '', $default = null, string|array $filter = '')
{
if (is_array($name)) {
return $this->only($name, $this->route, $filter);
@@ -946,12 +939,12 @@ class Request implements ArrayAccess
/**
* 获取GET参数
* @access public
- * @param string|array $name 变量名
+ * @param string|array|bool $name 变量名
* @param mixed $default 默认值
* @param string|array $filter 过滤方法
* @return mixed
*/
- public function get($name = '', $default = null, $filter = '')
+ public function get(string|array|bool $name = '', $default = null, string|array $filter = '')
{
if (is_array($name)) {
return $this->only($name, $this->get, $filter);
@@ -963,11 +956,11 @@ class Request implements ArrayAccess
/**
* 获取中间件传递的参数
* @access public
- * @param mixed $name 变量名
+ * @param string $name 变量名
* @param mixed $default 默认值
* @return mixed
*/
- public function middleware($name, $default = null)
+ public function middleware(string $name, $default = null)
{
return $this->middleware[$name] ?? $default;
}
@@ -975,12 +968,12 @@ class Request implements ArrayAccess
/**
* 获取POST参数
* @access public
- * @param string|array $name 变量名
+ * @param bool|string|array $name 变量名
* @param mixed $default 默认值
* @param string|array $filter 过滤方法
* @return mixed
*/
- public function post($name = '', $default = null, $filter = '')
+ public function post(string|array|bool $name = '', $default = null, string|array $filter = '')
{
if (is_array($name)) {
return $this->only($name, $this->post, $filter);
@@ -992,12 +985,12 @@ class Request implements ArrayAccess
/**
* 获取PUT参数
* @access public
- * @param string|array $name 变量名
+ * @param string|array|bool $name 变量名
* @param mixed $default 默认值
* @param string|array $filter 过滤方法
* @return mixed
*/
- public function put($name = '', $default = null, $filter = '')
+ public function put(string|array|bool $name = '', $default = null, string|array $filter = '')
{
if (is_array($name)) {
return $this->only($name, $this->put, $filter);
@@ -1006,13 +999,13 @@ class Request implements ArrayAccess
return $this->input($this->put, $name, $default, $filter);
}
- protected function getInputData($content): array
+ protected function getInputData(string $content): array
{
$contentType = $this->contentType();
if ('application/x-www-form-urlencoded' == $contentType) {
parse_str($content, $data);
return $data;
- } elseif (false !== strpos($contentType, 'json')) {
+ } elseif (str_contains($contentType, 'json')) {
return (array) json_decode($content, true);
}
@@ -1027,7 +1020,7 @@ class Request implements ArrayAccess
* @param string|array $filter 过滤方法
* @return mixed
*/
- public function delete($name = '', $default = null, $filter = '')
+ public function delete(string|array|bool $name = '', $default = null, string|array $filter = '')
{
return $this->put($name, $default, $filter);
}
@@ -1040,7 +1033,7 @@ class Request implements ArrayAccess
* @param string|array $filter 过滤方法
* @return mixed
*/
- public function patch($name = '', $default = null, $filter = '')
+ public function patch(string|array|bool $name = '', $default = null, string|array $filter = '')
{
return $this->put($name, $default, $filter);
}
@@ -1053,7 +1046,7 @@ class Request implements ArrayAccess
* @param string|array $filter 过滤方法
* @return mixed
*/
- public function request($name = '', $default = null, $filter = '')
+ public function request(string|array|bool $name = '', $default = null, string|array $filter = '')
{
if (is_array($name)) {
return $this->only($name, $this->request, $filter);
@@ -1073,11 +1066,8 @@ class Request implements ArrayAccess
{
if (empty($name)) {
return $this->env->get();
- } else {
- $name = strtoupper($name);
}
-
- return $this->env->get($name, $default);
+ return $this->env->get(strtoupper($name), $default);
}
/**
@@ -1134,11 +1124,8 @@ class Request implements ArrayAccess
{
if (empty($name)) {
return $this->server;
- } else {
- $name = strtoupper($name);
}
-
- return $this->server[$name] ?? $default;
+ return $this->server[strtoupper($name)] ?? $default;
}
/**
@@ -1151,7 +1138,7 @@ class Request implements ArrayAccess
{
$files = $this->file;
if (!empty($files)) {
- if (strpos($name, '.')) {
+ if (str_contains($name, '.')) {
[$name, $sub] = explode('.', $name);
}
@@ -1246,7 +1233,6 @@ class Request implements ArrayAccess
}
$name = str_replace('_', '-', strtolower($name));
-
return $this->header[$name] ?? $default;
}
@@ -1259,7 +1245,7 @@ class Request implements ArrayAccess
* @param string|array $filter 过滤函数
* @return mixed
*/
- public function input(array $data = [], $name = '', $default = null, $filter = '')
+ public function input(array $data = [], string|bool $name = '', $default = null, string|array $filter = '')
{
if (false === $name) {
// 获取原始数据
@@ -1269,7 +1255,7 @@ class Request implements ArrayAccess
$name = (string) $name;
if ('' != $name) {
// 解析name
- if (strpos($name, '/')) {
+ if (str_contains($name, '/')) {
[$name, $type] = explode('/', $name);
}
@@ -1317,31 +1303,15 @@ class Request implements ArrayAccess
*/
protected function typeCast(&$data, string $type)
{
- switch (strtolower($type)) {
- // 数组
- case 'a':
- $data = (array) $data;
- break;
- // 数字
- case 'd':
- $data = (int) $data;
- break;
- // 浮点
- case 'f':
- $data = (float) $data;
- break;
- // 布尔
- case 'b':
- $data = (boolean) $data;
- break;
- // 字符串
- case 's':
- if (is_scalar($data)) {
- $data = (string) $data;
- } else {
- throw new \InvalidArgumentException('variable type error:' . gettype($data));
- }
- break;
+ $type = strtolower($type);
+ if (in_array($type, ['a', 'b', 'd', 'f', 's'])) {
+ $data = match ($type) {
+ 'a' => (array) $data, // 数组
+ 'b' => (bool) $data, // 布尔
+ 'd' => (int) $data, // 数字
+ 'f' => (float) $data, // 浮点
+ 's' => is_scalar($data) ? (string) $data : throw new \InvalidArgumentException('variable type error:' . gettype($data)), //字符串
+ };
}
}
@@ -1389,7 +1359,7 @@ class Request implements ArrayAccess
$filter = [];
} else {
$filter = $filter ?: $this->filter;
- if (is_string($filter) && false === strpos($filter, '/')) {
+ if (is_string($filter) && !str_contains($filter, '/')) {
$filter = explode(',', $filter);
} else {
$filter = (array) $filter;
@@ -1422,7 +1392,7 @@ class Request implements ArrayAccess
$value = call_user_func($filter, $value);
} elseif (is_scalar($value)) {
- if (is_string($filter) && false !== strpos($filter, '/')) {
+ if (is_string($filter) && str_contains($filter, '/')) {
// 正则过滤
if (!preg_match($filter, $value)) {
// 匹配不成功返回默认值
@@ -1558,7 +1528,7 @@ class Request implements ArrayAccess
{
$acceptType = $this->type();
- return false !== strpos($acceptType, 'json');
+ return str_contains($acceptType, 'json');
}
/**
@@ -1676,17 +1646,11 @@ class Request implements ArrayAccess
*/
public function isValidIP(string $ip, string $type = ''): bool
{
- switch (strtolower($type)) {
- case 'ipv4':
- $flag = FILTER_FLAG_IPV4;
- break;
- case 'ipv6':
- $flag = FILTER_FLAG_IPV6;
- break;
- default:
- $flag = 0;
- break;
- }
+ $flag = match (strtolower($type)) {
+ 'ipv4' => FILTER_FLAG_IPV4,
+ 'ipv6' => FILTER_FLAG_IPV6,
+ default => 0,
+ };
return boolval(filter_var($ip, FILTER_VALIDATE_IP, $flag));
}
@@ -1726,7 +1690,7 @@ class Request implements ArrayAccess
{
if ($this->server('HTTP_VIA') && stristr($this->server('HTTP_VIA'), "wap")) {
return true;
- } elseif ($this->server('HTTP_ACCEPT') && strpos(strtoupper($this->server('HTTP_ACCEPT')), "VND.WAP.WML")) {
+ } elseif ($this->server('HTTP_ACCEPT') && str_contains(strtoupper($this->server('HTTP_ACCEPT')), "VND.WAP.WML")) {
return true;
} elseif ($this->server('HTTP_X_WAP_PROFILE') || $this->server('HTTP_PROFILE')) {
return true;
@@ -1784,7 +1748,7 @@ class Request implements ArrayAccess
$host = strval($this->server('HTTP_X_FORWARDED_HOST') ?: $this->server('HTTP_HOST'));
}
- return true === $strict && strpos($host, ':') ? strstr($host, ':', true) : $host;
+ return true === $strict && str_contains($host, ':') ? strstr($host, ':', true) : $host;
}
/**
@@ -1827,7 +1791,7 @@ class Request implements ArrayAccess
$contentType = $this->header('Content-Type');
if ($contentType) {
- if (strpos($contentType, ';')) {
+ if (str_contains($contentType, ';')) {
[$type] = explode(';', $contentType);
} else {
$type = $contentType;
@@ -2155,24 +2119,21 @@ class Request implements ArrayAccess
}
// ArrayAccess
- #[\ReturnTypeWillChange]
- public function offsetExists($name): bool
+ public function offsetExists(mixed $name): bool
{
return $this->has($name);
}
- #[\ReturnTypeWillChange]
- public function offsetGet($name)
+ public function offsetGet(mixed $name): mixed
{
return $this->param($name);
}
- #[\ReturnTypeWillChange]
- public function offsetSet($name, $value)
- {}
-
- #[\ReturnTypeWillChange]
- public function offsetUnset($name)
- {}
+ public function offsetSet(mixed $name, mixed $value): void
+ {
+ }
+ public function offsetUnset(mixed $name): void
+ {
+ }
}
diff --git a/vendor/topthink/framework/src/think/Response.php b/vendor/topthink/framework/src/think/Response.php
index 49f26dc..62bce6c 100644
--- a/vendor/topthink/framework/src/think/Response.php
+++ b/vendor/topthink/framework/src/think/Response.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -102,7 +102,7 @@ abstract class Response
*/
public static function create($data = '', string $type = 'html', int $code = 200): Response
{
- $class = false !== strpos($type, '\\') ? $type : '\\think\\response\\' . ucfirst(strtolower($type));
+ $class = str_contains($type, '\\') ? $type : '\\think\\response\\' . ucfirst(strtolower($type));
return Container::getInstance()->invokeClass($class, [$data, $code]);
}
@@ -260,10 +260,11 @@ abstract class Response
*/
public function content($content)
{
- if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([
- $content,
- '__toString',
- ])
+ if (
+ null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([
+ $content,
+ '__toString',
+ ])
) {
throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content)));
}
@@ -387,10 +388,11 @@ abstract class Response
if (null == $this->content) {
$content = $this->output($this->data);
- if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([
- $content,
- '__toString',
- ])
+ if (
+ null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([
+ $content,
+ '__toString',
+ ])
) {
throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content)));
}
diff --git a/vendor/topthink/framework/src/think/Route.php b/vendor/topthink/framework/src/think/Route.php
index 60eba4a..b891256 100644
--- a/vendor/topthink/framework/src/think/Route.php
+++ b/vendor/topthink/framework/src/think/Route.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -57,6 +57,8 @@ class Route
'url_lazy_route' => false,
// 是否强制使用路由
'url_route_must' => false,
+ // 是否区分大小写
+ 'url_case_sensitive' => false,
// 合并路由规则
'route_rule_merge' => false,
// 路由是否完全匹配
@@ -85,12 +87,6 @@ class Route
'url_common_param' => true,
];
- /**
- * 当前应用
- * @var App
- */
- protected $app;
-
/**
* 请求对象
* @var Request
@@ -138,12 +134,6 @@ class Route
*/
protected $lazy = false;
- /**
- * 路由是否测试模式
- * @var bool
- */
- protected $isTest = false;
-
/**
* (分组)路由规则是否合并解析
* @var bool
@@ -156,9 +146,8 @@ class Route
*/
protected $removeSlash = false;
- public function __construct(App $app)
+ public function __construct(protected App $app)
{
- $this->app = $app;
$this->ruleName = new RuleName();
$this->setDefaultDomain();
@@ -187,7 +176,7 @@ class Route
// 注册全局MISS路由
$this->miss(function () {
return Response::create('', 'html', 204)->header(['Allow' => 'GET, POST, PUT, DELETE']);
- }, 'options')->allowCrossDomain();
+ }, 'options');
}
public function config(string $name = null)
@@ -211,27 +200,6 @@ class Route
return $this;
}
- /**
- * 设置路由为测试模式
- * @access public
- * @param bool $test 路由是否测试模式
- * @return void
- */
- public function setTestMode(bool $test): void
- {
- $this->isTest = $test;
- }
-
- /**
- * 检查路由是否为测试模式
- * @access public
- * @return bool
- */
- public function isTest(): bool
- {
- return $this->isTest;
- }
-
/**
* 设置路由域名及分组(包括资源路由)是否合并解析
* @access public
@@ -317,7 +285,7 @@ class Route
* @param mixed $rule 路由规则
* @return Domain
*/
- public function domain($name, $rule = null): Domain
+ public function domain(string|array $name, $rule = null): Domain
{
// 支持多个域名使用相同路由规则
$domainName = is_array($name) ? array_shift($name) : $name;
@@ -399,14 +367,14 @@ class Route
{
if (is_null($domain)) {
$domain = $this->host;
- } elseif (false === strpos($domain, '.') && $this->request) {
+ } elseif (!str_contains($domain, '.') && $this->request) {
$domain .= '.' . $this->request->rootDomain();
}
if ($this->request) {
$subDomain = $this->request->subDomain();
- if (strpos($subDomain, '.')) {
+ if (str_contains($subDomain, '.')) {
$name = '*' . strstr($subDomain, '.');
}
}
@@ -518,12 +486,6 @@ class Route
*/
public function rule(string $rule, $route = null, string $method = '*'): RuleItem
{
- if ($route instanceof Response) {
- // 兼容之前的路由到响应对象,感觉不需要,使用场景很少,闭包就能实现
- $route = function () use ($route) {
- return $route;
- };
- }
return $this->group->addRule($rule, $route, $method);
}
@@ -547,11 +509,11 @@ class Route
/**
* 注册路由分组
* @access public
- * @param string|\Closure $name 分组名称或者参数
+ * @param string|Closure $name 分组名称或者参数
* @param mixed $route 分组路由
* @return RuleGroup
*/
- public function group($name, $route = null): RuleGroup
+ public function group(string|Closure $name, $route = null): RuleGroup
{
if ($name instanceof Closure) {
$route = $name;
@@ -726,7 +688,7 @@ class Route
* @param array|bool $resource 资源
* @return $this
*/
- public function rest($name, $resource = [])
+ public function rest(string|array $name, array|bool $resource = [])
{
if (is_array($name)) {
$this->rest = $resource ? $name : array_merge($this->rest, $name);
@@ -759,7 +721,7 @@ class Route
* @param string $method 请求类型
* @return RuleItem
*/
- public function miss($route, string $method = '*'): RuleItem
+ public function miss(string|Closure $route, string $method = '*'): RuleItem
{
return $this->group->miss($route, $method);
}
@@ -770,7 +732,7 @@ class Route
* @param Closure|bool $withRoute
* @return Response
*/
- public function dispatch(Request $request, $withRoute = true)
+ public function dispatch(Request $request, Closure|bool $withRoute = true)
{
$this->request = $request;
$this->host = $this->request->host(true);
diff --git a/vendor/topthink/framework/src/think/Service.php b/vendor/topthink/framework/src/think/Service.php
index d9e8960..9d0559f 100644
--- a/vendor/topthink/framework/src/think/Service.php
+++ b/vendor/topthink/framework/src/think/Service.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -22,11 +22,8 @@ use think\event\RouteLoaded;
*/
abstract class Service
{
- protected $app;
-
- public function __construct(App $app)
+ public function __construct(protected App $app)
{
- $this->app = $app;
}
/**
@@ -34,7 +31,7 @@ abstract class Service
* @access protected
* @param string $path 路由路径
*/
- protected function loadRoutesFrom($path)
+ protected function loadRoutesFrom(string $path)
{
$this->registerRoutes(function () use ($path) {
include $path;
diff --git a/vendor/topthink/framework/src/think/Session.php b/vendor/topthink/framework/src/think/Session.php
index 6c84faf..7faccb7 100644
--- a/vendor/topthink/framework/src/think/Session.php
+++ b/vendor/topthink/framework/src/think/Session.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
diff --git a/vendor/topthink/framework/src/think/Validate.php b/vendor/topthink/framework/src/think/Validate.php
index 0788406..ba66215 100644
--- a/vendor/topthink/framework/src/think/Validate.php
+++ b/vendor/topthink/framework/src/think/Validate.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -65,6 +65,7 @@ class Validate
'number' => ':attribute must be numeric',
'integer' => ':attribute must be integer',
'float' => ':attribute must be float',
+ 'string' => ':attribute must be string',
'boolean' => ':attribute must be bool',
'email' => ':attribute not a valid email address',
'mobile' => ':attribute not a valid mobile',
@@ -110,6 +111,9 @@ class Validate
'fileSize' => 'filesize not match',
'fileExt' => 'extensions to upload is not allowed',
'fileMime' => 'mimetype to upload is not allowed',
+ 'startWith' => ':attribute must start with :rule',
+ 'endWith' => ':attribute must end with :rule',
+ 'contain' => ':attribute must contain :rule',
];
/**
@@ -126,10 +130,10 @@ class Validate
'alpha' => '/^[A-Za-z]+$/',
'alphaNum' => '/^[A-Za-z0-9]+$/',
'alphaDash' => '/^[A-Za-z0-9\-\_]+$/',
- 'chs' => '/^[\x{4e00}-\x{9fa5}\x{9fa6}-\x{9fef}\x{3400}-\x{4db5}\x{20000}-\x{2ebe0}]+$/u',
- 'chsAlpha' => '/^[\x{4e00}-\x{9fa5}\x{9fa6}-\x{9fef}\x{3400}-\x{4db5}\x{20000}-\x{2ebe0}a-zA-Z]+$/u',
- 'chsAlphaNum' => '/^[\x{4e00}-\x{9fa5}\x{9fa6}-\x{9fef}\x{3400}-\x{4db5}\x{20000}-\x{2ebe0}a-zA-Z0-9]+$/u',
- 'chsDash' => '/^[\x{4e00}-\x{9fa5}\x{9fa6}-\x{9fef}\x{3400}-\x{4db5}\x{20000}-\x{2ebe0}a-zA-Z0-9\_\-]+$/u',
+ 'chs' => '/^[\p{Han}]+$/u',
+ 'chsAlpha' => '/^[\p{Han}a-zA-Z]+$/u',
+ 'chsAlphaNum' => '/^[\p{Han}a-zA-Z0-9]+$/u',
+ 'chsDash' => '/^[\p{Han}a-zA-Z0-9\_\-]+$/u',
'mobile' => '/^1[3-9]\d{9}$/',
'idCard' => '/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}$)/',
'zip' => '/\d{6}/',
@@ -283,7 +287,7 @@ class Validate
* @param mixed $rule 验证规则或者字段描述信息
* @return $this
*/
- public function rule($name, $rule = '')
+ public function rule(string|array $name, $rule = '')
{
if (is_array($name)) {
$this->rule = $name + $this->rule;
@@ -323,7 +327,7 @@ class Validate
* @param string $msg 验证提示信息
* @return void
*/
- public function setTypeMsg($type, string $msg = null): void
+ public function setTypeMsg(string|array $type, string $msg = null): void
{
if (is_array($type)) {
$this->typeMsg = array_merge($this->typeMsg, $type);
@@ -416,7 +420,7 @@ class Validate
* @param mixed $rule 验证规则 true 移除所有规则
* @return $this
*/
- public function remove($field, $rule = null)
+ public function remove(string|array $field, $rule = null)
{
if (is_array($field)) {
foreach ($field as $key => $rule) {
@@ -444,7 +448,7 @@ class Validate
* @param mixed $rule 验证规则
* @return $this
*/
- public function append($field, $rule = null)
+ public function append(string|array $field, $rule = null)
{
if (is_array($field)) {
foreach ($field as $key => $rule) {
@@ -490,7 +494,7 @@ class Validate
foreach ($rules as $key => $rule) {
// field => 'rule1|rule2...' field => ['rule1','rule2',...]
- if (strpos($key, '|')) {
+ if (str_contains($key, '|')) {
// 字段|描述 用于指定属性名称
[$key, $title] = explode('|', $key);
} else {
@@ -631,7 +635,7 @@ class Validate
if (isset($this->type[$type])) {
$result = call_user_func_array($this->type[$type], [$value, $rule, $data, $field, $title]);
- } elseif ('must' == $info || 0 === strpos($info, 'require') || (!is_null($value) && '' !== $value)) {
+ } elseif ('must' == $info || str_starts_with($info, 'require') || (!is_null($value) && '' !== $value)) {
$result = call_user_func_array([$this, $type], [$value, $rule, $data, $field, $title]);
} else {
$result = true;
@@ -642,7 +646,7 @@ class Validate
// 验证失败 返回错误信息
if (!empty($msg[$i])) {
$message = $msg[$i];
- if (is_string($message) && strpos($message, '{%') === 0) {
+ if (is_string($message) && str_starts_with($message, '{%')) {
$message = $this->lang->get(substr($message, 2, -1));
}
} else {
@@ -652,10 +656,10 @@ class Validate
return $message;
} elseif (true !== $result) {
// 返回自定义错误信息
- if (is_string($result) && false !== strpos($result, ':')) {
+ if (is_string($result) && str_contains($result, ':')) {
$result = str_replace(':attribute', $title, $result);
- if (strpos($result, ':rule') && is_scalar($rule)) {
+ if (str_contains($result, ':rule') && is_scalar($rule)) {
$result = str_replace(':rule', (string) $rule, $result);
}
}
@@ -686,7 +690,7 @@ class Validate
return [$key, $rule, $key];
}
- if (strpos($rule, ':')) {
+ if (str_contains($rule, ':')) {
[$type, $rule] = explode(':', $rule, 2);
if (isset($this->alias[$type])) {
// 判断别名
@@ -717,7 +721,7 @@ class Validate
public function confirm($value, $rule, array $data = [], string $field = ''): bool
{
if ('' == $rule) {
- if (strpos($field, '_confirm')) {
+ if (str_contains($field, '_confirm')) {
$rule = strstr($field, '_confirm', true);
} else {
$rule = $field . '_confirm';
@@ -826,65 +830,39 @@ class Validate
*/
public function is($value, string $rule, array $data = []): bool
{
- switch (Str::camel($rule)) {
- case 'require':
- // 必须
- $result = !empty($value) || '0' == $value;
- break;
- case 'accepted':
- // 接受
- $result = in_array($value, ['1', 'on', 'yes']);
- break;
- case 'date':
- // 是否是一个有效日期
- $result = false !== strtotime($value);
- break;
- case 'activeUrl':
- // 是否为有效的网址
- $result = checkdnsrr($value);
- break;
- case 'boolean':
- case 'bool':
- // 是否为布尔值
- $result = in_array($value, [true, false, 0, 1, '0', '1'], true);
- break;
- case 'number':
- $result = ctype_digit((string) $value);
- break;
- case 'alphaNum':
- $result = ctype_alnum($value);
- break;
- case 'array':
- // 是否为数组
- $result = is_array($value);
- break;
- case 'file':
- $result = $value instanceof File;
- break;
- case 'image':
- $result = $value instanceof File && in_array($this->getImageType($value->getRealPath()), [1, 2, 3, 6]);
- break;
- case 'token':
- $result = $this->token($value, '__token__', $data);
- break;
- default:
- if (isset($this->type[$rule])) {
- // 注册的验证规则
- $result = call_user_func_array($this->type[$rule], [$value]);
- } elseif (function_exists('ctype_' . $rule)) {
- // ctype验证规则
- $ctypeFun = 'ctype_' . $rule;
- $result = $ctypeFun($value);
- } elseif (isset($this->filter[$rule])) {
- // Filter_var验证规则
- $result = $this->filter($value, $this->filter[$rule]);
- } else {
- // 正则验证
- $result = $this->regex($value, $rule);
- }
- }
+ $call = function ($value, $rule) {
+ if (isset($this->type[$rule])) {
+ // 注册的验证规则
+ $result = call_user_func_array($this->type[$rule], [$value]);
+ } elseif (function_exists('ctype_' . $rule)) {
+ // ctype验证规则
+ $ctypeFun = 'ctype_' . $rule;
+ $result = $ctypeFun($value);
+ } elseif (isset($this->filter[$rule])) {
+ // Filter_var验证规则
+ $result = $this->filter($value, $this->filter[$rule]);
+ } else {
+ // 正则验证
+ $result = $this->regex($value, $rule);
+ }
+ return $result;
+ };
- return $result;
+ return match (Str::camel($rule)) {
+ 'require' => !empty($value) || '0' == $value, // 必须
+ 'accepted' => in_array($value, ['1', 'on', 'yes']), // 接受
+ 'date' => false !== strtotime($value), // 是否是一个有效日期
+ 'activeUrl' => checkdnsrr($value), // 是否为有效的网址
+ 'boolean','bool' => in_array($value, [true, false, 0, 1, '0', '1'], true), // 是否为布尔值
+ 'number' => ctype_digit((string) $value),
+ 'alphaNum' => ctype_alnum($value),
+ 'array' => is_array($value), // 是否为数组
+ 'string' => is_string($value),
+ 'file' => $value instanceof File,
+ 'image' => $value instanceof File && in_array($this->getImageType($value->getRealPath()), [1, 2, 3, 6]),
+ 'token' => $this->token($value, '__token__', $data),
+ default => $call($value, $rule),
+ };
}
// 判断图像类型
@@ -948,6 +926,42 @@ class Validate
return $this->filter($value, [FILTER_VALIDATE_IP, 'ipv6' == $rule ? FILTER_FLAG_IPV6 : FILTER_FLAG_IPV4]);
}
+ /**
+ * 检测是否以某个字符串开头
+ * @access public
+ * @param mixed $value 字段值
+ * @param string $rule 验证规则
+ * @return bool
+ */
+ public function startWith($value, string $rule): bool
+ {
+ return is_string($value) && str_starts_with($value, $rule);
+ }
+
+ /**
+ * 检测是否以某个字符串结尾
+ * @access public
+ * @param mixed $value 字段值
+ * @param string $rule 验证规则
+ * @return bool
+ */
+ public function endWith($value, string $rule): bool
+ {
+ return is_string($value) && str_ends_with($value, $rule);
+ }
+
+ /**
+ * 检测是否以包含某个字符串
+ * @access public
+ * @param mixed $value 字段值
+ * @param string $rule 验证规则
+ * @return bool
+ */
+ public function contain($value, string $rule): bool
+ {
+ return is_string($value) && str_contains($value, $rule);
+ }
+
/**
* 检测上传文件后缀
* @access public
@@ -1127,7 +1141,7 @@ class Validate
$rule = explode(',', $rule);
}
- if (false !== strpos($rule[0], '\\')) {
+ if (str_contains($rule[0], '\\')) {
// 指定模型类
$db = new $rule[0];
} else {
@@ -1137,7 +1151,7 @@ class Validate
$key = $rule[1] ?? $field;
$map = [];
- if (strpos($key, '^')) {
+ if (str_contains($key, '^')) {
// 支持多个字段验证
$fields = explode('^', $key);
foreach ($fields as $key) {
@@ -1177,7 +1191,7 @@ class Validate
*/
public function filter($value, $rule): bool
{
- if (is_string($rule) && strpos($rule, ',')) {
+ if (is_string($rule) && str_contains($rule, ',')) {
[$rule, $param] = explode(',', $rule);
} elseif (is_array($rule)) {
$param = $rule[1] ?? 0;
@@ -1340,7 +1354,7 @@ class Validate
$length = mb_strlen((string) $value);
}
- if (is_string($rule) && strpos($rule, ',')) {
+ if (is_string($rule) && str_contains($rule, ',')) {
// 长度区间
[$min, $max] = explode(',', $rule);
return $length >= $min && $length <= $max;
@@ -1509,7 +1523,7 @@ class Validate
$rule = $this->defaultRegex[$rule];
}
- if (is_string($rule) && 0 !== strpos($rule, '/') && !preg_match('/\/[imsU]{0,4}$/', $rule)) {
+ if (is_string($rule) && !str_starts_with($rule, '/') && !preg_match('/\/[imsU]{0,4}$/', $rule)) {
// 不是正则表达式则两端补上/
$rule = '/^' . $rule . '$/';
}
@@ -1537,7 +1551,7 @@ class Validate
{
if (is_numeric($key)) {
$value = $key;
- } elseif (is_string($key) && strpos($key, '.')) {
+ } elseif (is_string($key) && str_contains($key, '.')) {
// 支持多维数组验证
foreach (explode('.', $key) as $key) {
if (!isset($data[$key])) {
@@ -1572,7 +1586,7 @@ class Validate
$msg = $this->message[$attribute];
} elseif (isset($this->typeMsg[$type])) {
$msg = $this->typeMsg[$type];
- } elseif (0 === strpos($type, 'require')) {
+ } elseif (str_starts_with($type, 'require')) {
$msg = $this->typeMsg['require'];
} else {
$msg = $title . $this->lang->get('not conform to the rules');
@@ -1595,7 +1609,7 @@ class Validate
*/
protected function parseErrorMsg(string $msg, $rule, string $title)
{
- if (0 === strpos($msg, '{%')) {
+ if (str_starts_with($msg, '{%')) {
$msg = $this->lang->get(substr($msg, 2, -1));
} elseif ($this->lang->has($msg)) {
$msg = $this->lang->get($msg);
@@ -1610,9 +1624,9 @@ class Validate
$rule = implode(',', $rule);
}
- if (is_scalar($rule) && false !== strpos($msg, ':')) {
+ if (is_scalar($rule) && str_contains($msg, ':')) {
// 变量替换
- if (is_string($rule) && strpos($rule, ',')) {
+ if (is_string($rule) && str_contains($rule, ',')) {
$array = array_pad(explode(',', $rule), 3, '');
} else {
$array = array_pad([], 3, '');
@@ -1624,7 +1638,7 @@ class Validate
$msg
);
- if (strpos($msg, ':rule')) {
+ if (str_contains($msg, ':rule')) {
$msg = str_replace(':rule', (string) $rule, $msg);
}
}
diff --git a/vendor/topthink/framework/src/think/View.php b/vendor/topthink/framework/src/think/View.php
index 2e71088..73579f4 100644
--- a/vendor/topthink/framework/src/think/View.php
+++ b/vendor/topthink/framework/src/think/View.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think;
@@ -53,7 +53,7 @@ class View extends Manager
* @param mixed $value 变量值
* @return $this
*/
- public function assign($name, $value = null)
+ public function assign(string|array $name, $value = null)
{
if (is_array($name)) {
$this->data = array_merge($this->data, $name);
@@ -115,11 +115,7 @@ class View extends Manager
{
// 页面缓存
ob_start();
- if (PHP_VERSION > 8.0) {
- ob_implicit_flush(false);
- } else {
- ob_implicit_flush(0);
- }
+ ob_implicit_flush(false);
// 渲染输出
try {
@@ -187,5 +183,4 @@ class View extends Manager
{
return $this->app->config->get('view.type', 'php');
}
-
}
diff --git a/vendor/topthink/framework/src/think/cache/Driver.php b/vendor/topthink/framework/src/think/cache/Driver.php
index 7dc0d30..48e22ce 100644
--- a/vendor/topthink/framework/src/think/cache/Driver.php
+++ b/vendor/topthink/framework/src/think/cache/Driver.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\cache;
@@ -64,7 +64,7 @@ abstract class Driver implements CacheInterface, CacheHandlerInterface
* @param integer|DateTimeInterface|DateInterval $expire 有效期
* @return int
*/
- protected function getExpireTime($expire): int
+ protected function getExpireTime(int|DateTimeInterface|DateInterval $expire): int
{
if ($expire instanceof DateTimeInterface) {
$expire = $expire->getTimestamp() - time();
@@ -74,7 +74,7 @@ abstract class Driver implements CacheInterface, CacheHandlerInterface
->format('U') - time();
}
- return (int) $expire;
+ return $expire;
}
/**
@@ -147,10 +147,10 @@ abstract class Driver implements CacheInterface, CacheHandlerInterface
* @access public
* @param string $name 缓存变量名
* @param mixed $value 存储数据
- * @param int $expire 有效时间 0为永久
+ * @param int|DateInterval $expire 有效时间 0为永久
* @return mixed
*/
- public function remember(string $name, $value, $expire = null)
+ public function remember(string $name, $value, int|DateInterval $expire = null)
{
if ($this->has($name)) {
if (($hit = $this->get($name)) !== null) {
@@ -193,7 +193,7 @@ abstract class Driver implements CacheInterface, CacheHandlerInterface
* @param string|array $name 标签名
* @return TagSet
*/
- public function tag($name): TagSet
+ public function tag(string|array $name): TagSet
{
$name = (array) $name;
$key = implode('-', $name);
@@ -251,7 +251,7 @@ abstract class Driver implements CacheInterface, CacheHandlerInterface
* @param string $data 缓存数据
* @return mixed
*/
- protected function unserialize($data)
+ protected function unserialize(string $data)
{
if (is_numeric($data)) {
return $data;
@@ -301,7 +301,7 @@ abstract class Driver implements CacheInterface, CacheHandlerInterface
* @return iterable
* @throws InvalidArgumentException
*/
- public function getMultiple($keys, $default = null): iterable
+ public function getMultiple(iterable $keys, mixed $default = null): iterable
{
$result = [];
@@ -319,7 +319,7 @@ abstract class Driver implements CacheInterface, CacheHandlerInterface
* @param null|int|\DateInterval $ttl 有效时间 0为永久
* @return bool
*/
- public function setMultiple($values, $ttl = null): bool
+ public function setMultiple(iterable $values, int|DateInterval $ttl = null): bool
{
foreach ($values as $key => $val) {
$result = $this->set($key, $val, $ttl);
@@ -339,7 +339,7 @@ abstract class Driver implements CacheInterface, CacheHandlerInterface
* @return bool
* @throws InvalidArgumentException
*/
- public function deleteMultiple($keys): bool
+ public function deleteMultiple(iterable $keys): bool
{
foreach ($keys as $key) {
$result = $this->delete($key);
diff --git a/vendor/topthink/framework/src/think/cache/TagSet.php b/vendor/topthink/framework/src/think/cache/TagSet.php
index 5ba2076..7582c32 100644
--- a/vendor/topthink/framework/src/think/cache/TagSet.php
+++ b/vendor/topthink/framework/src/think/cache/TagSet.php
@@ -2,43 +2,31 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\cache;
+use DateInterval;
+
/**
* 标签集合
*/
class TagSet
{
- /**
- * 标签的缓存Key
- * @var array
- */
- protected $tag;
-
- /**
- * 缓存句柄
- * @var Driver
- */
- protected $handler;
-
/**
* 架构函数
* @access public
* @param array $tag 缓存标签
* @param Driver $cache 缓存对象
*/
- public function __construct(array $tag, Driver $cache)
+ public function __construct(protected array $tag, protected Driver $handler)
{
- $this->tag = $tag;
- $this->handler = $cache;
}
/**
@@ -46,10 +34,10 @@ class TagSet
* @access public
* @param string $name 缓存变量名
* @param mixed $value 存储数据
- * @param integer|\DateTime $expire 有效时间(秒)
+ * @param integer|DateInterval $expire 有效时间(秒)
* @return bool
*/
- public function set(string $name, $value, $expire = null): bool
+ public function set(string $name, $value, int|DateInterval $expire = null): bool
{
$this->handler->set($name, $value, $expire);
@@ -78,10 +66,10 @@ class TagSet
* 写入缓存
* @access public
* @param iterable $values 缓存数据
- * @param null|int|\DateInterval $ttl 有效时间 0为永久
+ * @param null|int|DateInterval $ttl 有效时间 0为永久
* @return bool
*/
- public function setMultiple($values, $ttl = null): bool
+ public function setMultiple(iterable $values, int|DateInterval $ttl = null): bool
{
foreach ($values as $key => $val) {
$result = $this->set($key, $val, $ttl);
diff --git a/vendor/topthink/framework/src/think/cache/driver/File.php b/vendor/topthink/framework/src/think/cache/driver/File.php
index b36b069..f3a1780 100644
--- a/vendor/topthink/framework/src/think/cache/driver/File.php
+++ b/vendor/topthink/framework/src/think/cache/driver/File.php
@@ -2,16 +2,17 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types = 1);
namespace think\cache\driver;
+use DateInterval;
use FilesystemIterator;
use think\App;
use think\cache\Driver;
@@ -51,7 +52,7 @@ class File extends Driver
$this->options['path'] = $app->getRuntimePath() . 'cache';
}
- if (substr($this->options['path'], -1) != DIRECTORY_SEPARATOR) {
+ if (!str_ends_with($this->options['path'], DIRECTORY_SEPARATOR)) {
$this->options['path'] .= DIRECTORY_SEPARATOR;
}
}
@@ -108,7 +109,7 @@ class File extends Driver
$content = gzuncompress($content);
}
- return is_string($content) ? ['content' => $content, 'expire' => $expire] : null;
+ return is_string($content) ? ['content' => (string) $content, 'expire' => $expire] : null;
}
}
@@ -118,7 +119,7 @@ class File extends Driver
* @param string $name 缓存变量名
* @return bool
*/
- public function has($name): bool
+ public function has(string $name): bool
{
return $this->getRaw($name) !== null;
}
@@ -130,7 +131,7 @@ class File extends Driver
* @param mixed $default 默认值
* @return mixed
*/
- public function get($name, $default = null)
+ public function get(string $name, mixed $default = null): mixed
{
$this->readTimes++;
@@ -142,12 +143,12 @@ class File extends Driver
/**
* 写入缓存
* @access public
- * @param string $name 缓存变量名
- * @param mixed $value 存储数据
- * @param int|\DateTime $expire 有效时间 0为永久
+ * @param string $name 缓存变量名
+ * @param mixed $value 存储数据
+ * @param int|\DateInterval|null $expire 有效时间 0为永久
* @return bool
*/
- public function set($name, $value, $expire = null): bool
+ public function set(string $name, mixed $value, int|DateInterval $expire = null): bool
{
$this->writeTimes++;
@@ -175,8 +176,14 @@ class File extends Driver
$data = gzcompress($data, 3);
}
- $data = "\n" . $data;
- $result = file_put_contents($filename, $data);
+ $data = "\n" . $data;
+
+ if (str_contains($filename, '://') && !str_starts_with($filename, 'file://')) {
+ //虚拟文件不加锁
+ $result = file_put_contents($filename, $data);
+ } else {
+ $result = file_put_contents($filename, $data, LOCK_EX);
+ }
if ($result) {
clearstatcache();
@@ -224,7 +231,7 @@ class File extends Driver
* @param string $name 缓存变量名
* @return bool
*/
- public function delete($name): bool
+ public function delete(string $name): bool
{
$this->writeTimes++;
@@ -300,5 +307,4 @@ class File extends Driver
return true;
}
-
}
diff --git a/vendor/topthink/framework/src/think/cache/driver/Memcache.php b/vendor/topthink/framework/src/think/cache/driver/Memcache.php
index 2fbbb9c..7f41914 100644
--- a/vendor/topthink/framework/src/think/cache/driver/Memcache.php
+++ b/vendor/topthink/framework/src/think/cache/driver/Memcache.php
@@ -2,16 +2,17 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\cache\driver;
+use DateInterval;
use think\cache\Driver;
/**
@@ -64,8 +65,8 @@ class Memcache extends Driver
foreach ($hosts as $i => $host) {
$port = $ports[$i] ?? $ports[0];
$this->options['timeout'] > 0 ?
- $this->handler->addServer($host, (int) $port, $this->options['persistent'], 1, (int) $this->options['timeout']) :
- $this->handler->addServer($host, (int) $port, $this->options['persistent'], 1);
+ $this->handler->addServer($host, (int) $port, $this->options['persistent'], 1, (int) $this->options['timeout']) :
+ $this->handler->addServer($host, (int) $port, $this->options['persistent'], 1);
}
}
@@ -75,7 +76,7 @@ class Memcache extends Driver
* @param string $name 缓存变量名
* @return bool
*/
- public function has($name): bool
+ public function has(string $name): bool
{
$key = $this->getCacheKey($name);
@@ -89,7 +90,7 @@ class Memcache extends Driver
* @param mixed $default 默认值
* @return mixed
*/
- public function get($name, $default = null)
+ public function get(string $name, mixed $default = null): mixed
{
$this->readTimes++;
@@ -106,7 +107,7 @@ class Memcache extends Driver
* @param int|\DateTime $expire 有效时间(秒)
* @return bool
*/
- public function set($name, $value, $expire = null): bool
+ public function set(string $name, mixed $value, int|DateInterval $expire = null): bool
{
$this->writeTimes++;
@@ -170,15 +171,15 @@ class Memcache extends Driver
* @param bool|false $ttl
* @return bool
*/
- public function delete($name, $ttl = false): bool
+ public function delete(string $name, $ttl = false): bool
{
$this->writeTimes++;
$key = $this->getCacheKey($name);
return false === $ttl ?
- $this->handler->delete($key) :
- $this->handler->delete($key, $ttl);
+ $this->handler->delete($key) :
+ $this->handler->delete($key, $ttl);
}
/**
@@ -205,5 +206,4 @@ class Memcache extends Driver
$this->handler->delete($key);
}
}
-
}
diff --git a/vendor/topthink/framework/src/think/cache/driver/Memcached.php b/vendor/topthink/framework/src/think/cache/driver/Memcached.php
index 71edb05..4c4aa89 100644
--- a/vendor/topthink/framework/src/think/cache/driver/Memcached.php
+++ b/vendor/topthink/framework/src/think/cache/driver/Memcached.php
@@ -2,16 +2,17 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\cache\driver;
+use DateInterval;
use think\cache\Driver;
/**
@@ -89,7 +90,7 @@ class Memcached extends Driver
* @param string $name 缓存变量名
* @return bool
*/
- public function has($name): bool
+ public function has(string $name): bool
{
$key = $this->getCacheKey($name);
@@ -103,7 +104,7 @@ class Memcached extends Driver
* @param mixed $default 默认值
* @return mixed
*/
- public function get($name, $default = null)
+ public function get(string $name, mixed $default = null): mixed
{
$this->readTimes++;
@@ -117,10 +118,10 @@ class Memcached extends Driver
* @access public
* @param string $name 缓存变量名
* @param mixed $value 存储数据
- * @param integer|\DateTime $expire 有效时间(秒)
+ * @param integer|DateInterval $expire 有效时间(秒)
* @return bool
*/
- public function set($name, $value, $expire = null): bool
+ public function set(string $name, mixed $value, int|DateInterval $expire = null): bool
{
$this->writeTimes++;
@@ -184,15 +185,15 @@ class Memcached extends Driver
* @param bool|false $ttl
* @return bool
*/
- public function delete($name, $ttl = false): bool
+ public function delete(string $name, $ttl = false): bool
{
$this->writeTimes++;
$key = $this->getCacheKey($name);
return false === $ttl ?
- $this->handler->delete($key) :
- $this->handler->delete($key, $ttl);
+ $this->handler->delete($key) :
+ $this->handler->delete($key, $ttl);
}
/**
@@ -217,5 +218,4 @@ class Memcached extends Driver
{
$this->handler->deleteMulti($keys);
}
-
}
diff --git a/vendor/topthink/framework/src/think/cache/driver/Redis.php b/vendor/topthink/framework/src/think/cache/driver/Redis.php
index 791b27b..22317b3 100644
--- a/vendor/topthink/framework/src/think/cache/driver/Redis.php
+++ b/vendor/topthink/framework/src/think/cache/driver/Redis.php
@@ -2,16 +2,17 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\cache\driver;
+use DateInterval;
use think\cache\Driver;
/**
@@ -97,7 +98,7 @@ class Redis extends Driver
* @param string $name 缓存变量名
* @return bool
*/
- public function has($name): bool
+ public function has(string $name): bool
{
return $this->handler->exists($this->getCacheKey($name)) ? true : false;
}
@@ -109,7 +110,7 @@ class Redis extends Driver
* @param mixed $default 默认值
* @return mixed
*/
- public function get($name, $default = null)
+ public function get(string $name, mixed $default = null): mixed
{
$this->readTimes++;
$key = $this->getCacheKey($name);
@@ -127,10 +128,10 @@ class Redis extends Driver
* @access public
* @param string $name 缓存变量名
* @param mixed $value 存储数据
- * @param integer|\DateTime $expire 有效时间(秒)
+ * @param integer|DateInterval $expire 有效时间(秒)
* @return bool
*/
- public function set($name, $value, $expire = null): bool
+ public function set(string $name, mixed $value, int|DateInterval $expire = null): bool
{
$this->writeTimes++;
@@ -187,7 +188,7 @@ class Redis extends Driver
* @param string $name 缓存变量名
* @return bool
*/
- public function delete($name): bool
+ public function delete(string $name): bool
{
$this->writeTimes++;
@@ -245,5 +246,4 @@ class Redis extends Driver
$key = $this->getCacheKey($name);
return $this->handler->sMembers($key);
}
-
}
diff --git a/vendor/topthink/framework/src/think/cache/driver/Wincache.php b/vendor/topthink/framework/src/think/cache/driver/Wincache.php
index 8b3e8b8..7358371 100644
--- a/vendor/topthink/framework/src/think/cache/driver/Wincache.php
+++ b/vendor/topthink/framework/src/think/cache/driver/Wincache.php
@@ -2,16 +2,17 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\cache\driver;
+use DateInterval;
use think\cache\Driver;
/**
@@ -69,7 +70,7 @@ class Wincache extends Driver
* @param mixed $default 默认值
* @return mixed
*/
- public function get($name, $default = null)
+ public function get(string $name, mixed $default = null): mixed
{
$this->readTimes++;
@@ -83,10 +84,10 @@ class Wincache extends Driver
* @access public
* @param string $name 缓存变量名
* @param mixed $value 存储数据
- * @param integer|\DateTime $expire 有效时间(秒)
+ * @param integer|DateInterval $expire 有效时间(秒)
* @return bool
*/
- public function set($name, $value, $expire = null): bool
+ public function set(string $name, mixed $value, int|DateInterval $expire = null): bool
{
$this->writeTimes++;
@@ -143,7 +144,7 @@ class Wincache extends Driver
* @param string $name 缓存变量名
* @return bool
*/
- public function delete($name): bool
+ public function delete(string $name): bool
{
$this->writeTimes++;
@@ -171,5 +172,4 @@ class Wincache extends Driver
{
wincache_ucache_delete($keys);
}
-
}
diff --git a/vendor/topthink/framework/src/think/console/Command.php b/vendor/topthink/framework/src/think/console/Command.php
index bd3fb20..473869d 100644
--- a/vendor/topthink/framework/src/think/console/Command.php
+++ b/vendor/topthink/framework/src/think/console/Command.php
@@ -459,7 +459,7 @@ abstract class Command
*/
public function addUsage(string $usage)
{
- if (0 !== strpos($usage, $this->name)) {
+ if (!str_starts_with($usage, $this->name)) {
$usage = sprintf('%s %s', $this->name, $usage);
}
diff --git a/vendor/topthink/framework/src/think/console/Input.php b/vendor/topthink/framework/src/think/console/Input.php
index 9ae9077..71769e3 100644
--- a/vendor/topthink/framework/src/think/console/Input.php
+++ b/vendor/topthink/framework/src/think/console/Input.php
@@ -82,7 +82,7 @@ class Input
$this->parseArgument($token);
} elseif ($parseOptions && '--' == $token) {
$parseOptions = false;
- } elseif ($parseOptions && 0 === strpos($token, '--')) {
+ } elseif ($parseOptions && str_starts_with($token, '--')) {
$this->parseLongOption($token);
} elseif ($parseOptions && '-' === $token[0] && '-' !== $token) {
$this->parseShortOption($token);
@@ -267,7 +267,7 @@ class Input
foreach ($this->tokens as $token) {
foreach ($values as $value) {
- if ($token === $value || 0 === strpos($token, $value . '=')) {
+ if ($token === $value || str_starts_with($token, $value . '=')) {
return true;
}
}
@@ -291,7 +291,7 @@ class Input
$token = array_shift($tokens);
foreach ($values as $value) {
- if ($token === $value || 0 === strpos($token, $value . '=')) {
+ if ($token === $value || str_starts_with($token, $value . '=')) {
if (false !== $pos = strpos($token, '=')) {
return substr($token, $pos + 1);
}
@@ -378,7 +378,7 @@ class Input
* @param string|int $name 参数名或位置
* @return bool
*/
- public function hasArgument($name): bool
+ public function hasArgument(string|int $name): bool
{
return $this->definition->hasArgument($name);
}
diff --git a/vendor/topthink/framework/src/think/console/command/Make.php b/vendor/topthink/framework/src/think/console/command/Make.php
index a74e9e8..ac2453d 100644
--- a/vendor/topthink/framework/src/think/console/command/Make.php
+++ b/vendor/topthink/framework/src/think/console/command/Make.php
@@ -74,17 +74,17 @@ abstract class Make extends Command
protected function getClassName(string $name): string
{
- if (strpos($name, '\\') !== false) {
+ if (str_contains($name, '\\')) {
return $name;
}
- if (strpos($name, '@')) {
+ if (str_contains($name, '@')) {
[$app, $name] = explode('@', $name);
} else {
$app = '';
}
- if (strpos($name, '/') !== false) {
+ if (str_contains($name, '/')) {
$name = str_replace('/', '\\', $name);
}
diff --git a/vendor/topthink/framework/src/think/console/command/RouteList.php b/vendor/topthink/framework/src/think/console/command/RouteList.php
index cfc7293..546cf4d 100644
--- a/vendor/topthink/framework/src/think/console/command/RouteList.php
+++ b/vendor/topthink/framework/src/think/console/command/RouteList.php
@@ -68,7 +68,7 @@ class RouteList extends Command
$files = is_dir($path) ? scandir($path) : [];
foreach ($files as $file) {
- if (strpos($file, '.php')) {
+ if (str_contains($file, '.php')) {
include $path . $file;
}
}
diff --git a/vendor/topthink/framework/src/think/console/command/ServiceDiscover.php b/vendor/topthink/framework/src/think/console/command/ServiceDiscover.php
index e90f433..5de73f8 100644
--- a/vendor/topthink/framework/src/think/console/command/ServiceDiscover.php
+++ b/vendor/topthink/framework/src/think/console/command/ServiceDiscover.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\console\command;
diff --git a/vendor/topthink/framework/src/think/console/command/VendorPublish.php b/vendor/topthink/framework/src/think/console/command/VendorPublish.php
index 3998765..e1f3ce1 100644
--- a/vendor/topthink/framework/src/think/console/command/VendorPublish.php
+++ b/vendor/topthink/framework/src/think/console/command/VendorPublish.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\console\command;
diff --git a/vendor/topthink/framework/src/think/console/command/make/Command.php b/vendor/topthink/framework/src/think/console/command/make/Command.php
index 9549a02..7fca7f0 100644
--- a/vendor/topthink/framework/src/think/console/command/make/Command.php
+++ b/vendor/topthink/framework/src/think/console/command/make/Command.php
@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
@@ -51,5 +51,4 @@ class Command extends Make
{
return parent::getNamespace($app) . '\\command';
}
-
}
diff --git a/vendor/topthink/framework/src/think/console/command/make/Controller.php b/vendor/topthink/framework/src/think/console/command/make/Controller.php
index 4a8d226..c4a23ac 100644
--- a/vendor/topthink/framework/src/think/console/command/make/Controller.php
+++ b/vendor/topthink/framework/src/think/console/command/make/Controller.php
@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
@@ -52,5 +52,4 @@ class Controller extends Make
{
return parent::getNamespace($app) . '\\controller';
}
-
}
diff --git a/vendor/topthink/framework/src/think/console/command/make/Event.php b/vendor/topthink/framework/src/think/console/command/make/Event.php
index 6b16689..fa8052f 100644
--- a/vendor/topthink/framework/src/think/console/command/make/Event.php
+++ b/vendor/topthink/framework/src/think/console/command/make/Event.php
@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
diff --git a/vendor/topthink/framework/src/think/console/command/make/Listener.php b/vendor/topthink/framework/src/think/console/command/make/Listener.php
index 5c92673..48265ac 100644
--- a/vendor/topthink/framework/src/think/console/command/make/Listener.php
+++ b/vendor/topthink/framework/src/think/console/command/make/Listener.php
@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
diff --git a/vendor/topthink/framework/src/think/console/command/make/Middleware.php b/vendor/topthink/framework/src/think/console/command/make/Middleware.php
index 3b68b4a..bd410b7 100644
--- a/vendor/topthink/framework/src/think/console/command/make/Middleware.php
+++ b/vendor/topthink/framework/src/think/console/command/make/Middleware.php
@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
diff --git a/vendor/topthink/framework/src/think/console/command/make/Model.php b/vendor/topthink/framework/src/think/console/command/make/Model.php
index cb7a23c..4ae6889 100644
--- a/vendor/topthink/framework/src/think/console/command/make/Model.php
+++ b/vendor/topthink/framework/src/think/console/command/make/Model.php
@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
diff --git a/vendor/topthink/framework/src/think/console/command/make/Service.php b/vendor/topthink/framework/src/think/console/command/make/Service.php
index c4bbaa0..e95d14a 100644
--- a/vendor/topthink/framework/src/think/console/command/make/Service.php
+++ b/vendor/topthink/framework/src/think/console/command/make/Service.php
@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
diff --git a/vendor/topthink/framework/src/think/console/command/make/Subscribe.php b/vendor/topthink/framework/src/think/console/command/make/Subscribe.php
index a1dc2a8..a702fb8 100644
--- a/vendor/topthink/framework/src/think/console/command/make/Subscribe.php
+++ b/vendor/topthink/framework/src/think/console/command/make/Subscribe.php
@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
diff --git a/vendor/topthink/framework/src/think/console/command/make/Validate.php b/vendor/topthink/framework/src/think/console/command/make/Validate.php
index 8d36431..09e5062 100644
--- a/vendor/topthink/framework/src/think/console/command/make/Validate.php
+++ b/vendor/topthink/framework/src/think/console/command/make/Validate.php
@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
@@ -35,5 +35,4 @@ class Validate extends Make
{
return parent::getNamespace($app) . '\\validate';
}
-
}
diff --git a/vendor/topthink/framework/src/think/console/command/optimize/Route.php b/vendor/topthink/framework/src/think/console/command/optimize/Route.php
index 56f7f5a..30ef76a 100644
--- a/vendor/topthink/framework/src/think/console/command/optimize/Route.php
+++ b/vendor/topthink/framework/src/think/console/command/optimize/Route.php
@@ -51,7 +51,7 @@ class Route extends Command
$files = is_dir($path) ? scandir($path) : [];
foreach ($files as $file) {
- if (strpos($file, '.php')) {
+ if (str_contains($file, '.php')) {
include $path . $file;
}
}
diff --git a/vendor/topthink/framework/src/think/console/command/optimize/Schema.php b/vendor/topthink/framework/src/think/console/command/optimize/Schema.php
index 6ce3e64..3ee3f42 100644
--- a/vendor/topthink/framework/src/think/console/command/optimize/Schema.php
+++ b/vendor/topthink/framework/src/think/console/command/optimize/Schema.php
@@ -40,7 +40,7 @@ class Schema extends Command
return;
}
$table = $input->getOption('table');
- if (false === strpos($table, '.')) {
+ if (!str_contains($table, '.')) {
$dbName = $connection->getConfig('database');
} else {
[$dbName, $table] = explode('.', $table);
@@ -64,10 +64,15 @@ class Schema extends Command
$list = is_dir($path) ? scandir($path) : [];
foreach ($list as $file) {
- if (0 === strpos($file, '.')) {
+ if (str_starts_with($file, '.')) {
continue;
}
$class = '\\' . $namespace . '\\model\\' . pathinfo($file, PATHINFO_FILENAME);
+
+ if (!class_exists($class)) {
+ continue;
+ }
+
$this->buildModelSchema($class);
}
}
diff --git a/vendor/topthink/framework/src/think/console/input/Option.php b/vendor/topthink/framework/src/think/console/input/Option.php
index d7e6514..8554087 100644
--- a/vendor/topthink/framework/src/think/console/input/Option.php
+++ b/vendor/topthink/framework/src/think/console/input/Option.php
@@ -67,7 +67,7 @@ class Option
*/
public function __construct($name, $shortcut = null, $mode = null, $description = '', $default = null)
{
- if (0 === strpos($name, '--')) {
+ if (str_starts_with($name, '--')) {
$name = substr($name, 2);
}
diff --git a/vendor/topthink/framework/src/think/console/output/Ask.php b/vendor/topthink/framework/src/think/console/output/Ask.php
index 0058d05..01bc219 100644
--- a/vendor/topthink/framework/src/think/console/output/Ask.php
+++ b/vendor/topthink/framework/src/think/console/output/Ask.php
@@ -169,7 +169,7 @@ class Ask
$ofs = 0;
foreach ($autocomplete as $value) {
- if (0 === strpos($value, $ret) && $i !== strlen($value)) {
+ if (str_starts_with($value, $ret) && $i !== strlen($value)) {
$matches[$numMatches++] = $value;
}
}
diff --git a/vendor/topthink/framework/src/think/console/output/Descriptor.php b/vendor/topthink/framework/src/think/console/output/Descriptor.php
index 84d487c..2985ddb 100644
--- a/vendor/topthink/framework/src/think/console/output/Descriptor.php
+++ b/vendor/topthink/framework/src/think/console/output/Descriptor.php
@@ -51,7 +51,7 @@ class Descriptor
$this->describeConsole($object, $options);
break;
default:
- throw new \InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_class($object)));
+ throw new \InvalidArgumentException(sprintf('Object of type "%s" is not describable.', $object::class));
}
}
@@ -86,7 +86,7 @@ class Descriptor
$spacingWidth = $totalWidth - strlen($argument->getName()) + 2;
$this->writeText(sprintf(" %s %s%s%s", $argument->getName(), str_repeat(' ', $spacingWidth), // + 17 = 2 spaces + + + 2 spaces
- preg_replace('/\s*\R\s*/', PHP_EOL . str_repeat(' ', $totalWidth + 17), $argument->getDescription()), $default), $options);
+ preg_replace('/\s*[\r\n]\s*/', PHP_EOL . str_repeat(' ', $totalWidth + 17), $argument->getDescription()), $default), $options);
}
/**
@@ -121,7 +121,7 @@ class Descriptor
$spacingWidth = $totalWidth - strlen($synopsis) + 2;
$this->writeText(sprintf(" %s %s%s%s%s", $synopsis, str_repeat(' ', $spacingWidth), // + 17 = 2 spaces + + + 2 spaces
- preg_replace('/\s*\R\s*/', "\n" . str_repeat(' ', $totalWidth + 17), $option->getDescription()), $default, $option->isArray() ? ' (multiple values allowed) ' : ''), $options);
+ preg_replace('/\s*[\r\n]\s*/', "\n" . str_repeat(' ', $totalWidth + 17), $option->getDescription()), $default, $option->isArray() ? ' (multiple values allowed) ' : ''), $options);
}
/**
diff --git a/vendor/topthink/framework/src/think/console/output/driver/Console.php b/vendor/topthink/framework/src/think/console/output/driver/Console.php
index 3061f55..5c0a9ef 100644
--- a/vendor/topthink/framework/src/think/console/output/driver/Console.php
+++ b/vendor/topthink/framework/src/think/console/output/driver/Console.php
@@ -75,7 +75,7 @@ class Console
$this->formatter->setDecorated($decorated);
do {
- $title = sprintf(' [%s] ', get_class($e));
+ $title = sprintf(' [%s] ', $e::class);
$len = $this->stringWidth($title);
diff --git a/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php b/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php
index da5e696..992b0dd 100644
--- a/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php
+++ b/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php
@@ -2,16 +2,18 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\contract;
+use DateInterval;
+
/**
* 缓存驱动接口
*/
@@ -23,7 +25,7 @@ interface CacheHandlerInterface
* @param string $name 缓存变量名
* @return bool
*/
- public function has($name);
+ public function has(string $name): bool;
/**
* 读取缓存
@@ -32,17 +34,17 @@ interface CacheHandlerInterface
* @param mixed $default 默认值
* @return mixed
*/
- public function get($name, $default = null);
+ public function get(string $name, mixed $default = null): mixed;
/**
* 写入缓存
* @access public
* @param string $name 缓存变量名
* @param mixed $value 存储数据
- * @param integer|\DateTime $expire 有效时间(秒)
+ * @param integer|DateInterval $expire 有效时间(秒)
* @return bool
*/
- public function set($name, $value, $expire = null);
+ public function set(string $name, mixed $value, int|DateInterval $expire = null): bool;
/**
* 自增缓存(针对数值缓存)
@@ -68,14 +70,14 @@ interface CacheHandlerInterface
* @param string $name 缓存变量名
* @return bool
*/
- public function delete($name);
+ public function delete(string $name): bool;
/**
* 清除缓存
* @access public
* @return bool
*/
- public function clear();
+ public function clear(): bool;
/**
* 删除缓存标签
@@ -84,5 +86,4 @@ interface CacheHandlerInterface
* @return void
*/
public function clearTag(array $keys);
-
}
diff --git a/vendor/topthink/framework/src/think/contract/ModelRelationInterface.php b/vendor/topthink/framework/src/think/contract/ModelRelationInterface.php
index 1f6f994..545b21d 100644
--- a/vendor/topthink/framework/src/think/contract/ModelRelationInterface.php
+++ b/vendor/topthink/framework/src/think/contract/ModelRelationInterface.php
@@ -2,19 +2,18 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\contract;
use Closure;
-use think\Collection;
-use think\db\Query;
+use think\db\BaseQuery as Query;
use think\Model;
/**
@@ -27,9 +26,9 @@ interface ModelRelationInterface
* @access public
* @param array $subRelation 子关联
* @param Closure $closure 闭包查询条件
- * @return Collection
+ * @return mixed
*/
- public function getRelation(array $subRelation = [], Closure $closure = null): Collection;
+ public function getRelation(array $subRelation = [], Closure $closure = null);
/**
* 预载入关联查询
@@ -85,7 +84,7 @@ interface ModelRelationInterface
* @param string $joinType JOIN类型
* @return Query
*/
- public function has(string $operator = '>=', int $count = 1, string $id = '*', string $joinType = 'INNER'): Query;
+ public function has(string $operator = '>=', int $count = 1, string $id = '*', string $joinType = 'INNER', Query $query = null): Query;
/**
* 根据关联条件查询当前模型
diff --git a/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php b/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php
index 0b2e414..99782e1 100644
--- a/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php
+++ b/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\contract;
diff --git a/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php b/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php
index 9be93d2..c361364 100644
--- a/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php
+++ b/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\contract;
diff --git a/vendor/topthink/framework/src/think/event/AppInit.php b/vendor/topthink/framework/src/think/event/AppInit.php
index dda820b..fa27ea6 100644
--- a/vendor/topthink/framework/src/think/event/AppInit.php
+++ b/vendor/topthink/framework/src/think/event/AppInit.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\event;
@@ -16,4 +16,5 @@ namespace think\event;
* AppInit事件类
*/
class AppInit
-{}
+{
+}
diff --git a/vendor/topthink/framework/src/think/event/HttpEnd.php b/vendor/topthink/framework/src/think/event/HttpEnd.php
index c40da57..de0b4c3 100644
--- a/vendor/topthink/framework/src/think/event/HttpEnd.php
+++ b/vendor/topthink/framework/src/think/event/HttpEnd.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\event;
@@ -16,4 +16,5 @@ namespace think\event;
* HttpEnd事件类
*/
class HttpEnd
-{}
+{
+}
diff --git a/vendor/topthink/framework/src/think/event/HttpRun.php b/vendor/topthink/framework/src/think/event/HttpRun.php
index ce67e93..4a6d3ff 100644
--- a/vendor/topthink/framework/src/think/event/HttpRun.php
+++ b/vendor/topthink/framework/src/think/event/HttpRun.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\event;
@@ -16,4 +16,5 @@ namespace think\event;
* HttpRun事件类
*/
class HttpRun
-{}
+{
+}
diff --git a/vendor/topthink/framework/src/think/event/LogRecord.php b/vendor/topthink/framework/src/think/event/LogRecord.php
index 237468d..3fd6767 100644
--- a/vendor/topthink/framework/src/think/event/LogRecord.php
+++ b/vendor/topthink/framework/src/think/event/LogRecord.php
@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
diff --git a/vendor/topthink/framework/src/think/event/LogWrite.php b/vendor/topthink/framework/src/think/event/LogWrite.php
index a787301..f339fba 100644
--- a/vendor/topthink/framework/src/think/event/LogWrite.php
+++ b/vendor/topthink/framework/src/think/event/LogWrite.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\event;
@@ -17,15 +17,7 @@ namespace think\event;
*/
class LogWrite
{
- /** @var string */
- public $channel;
-
- /** @var array */
- public $log;
-
- public function __construct($channel, $log)
+ public function __construct(public string $channel, public array $log)
{
- $this->channel = $channel;
- $this->log = $log;
}
}
diff --git a/vendor/topthink/framework/src/think/event/RouteLoaded.php b/vendor/topthink/framework/src/think/event/RouteLoaded.php
index ace7992..6b1b527 100644
--- a/vendor/topthink/framework/src/think/event/RouteLoaded.php
+++ b/vendor/topthink/framework/src/think/event/RouteLoaded.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\event;
@@ -17,5 +17,4 @@ namespace think\event;
*/
class RouteLoaded
{
-
}
diff --git a/vendor/topthink/framework/src/think/exception/ClassNotFoundException.php b/vendor/topthink/framework/src/think/exception/ClassNotFoundException.php
index c4cda77..93ec89f 100644
--- a/vendor/topthink/framework/src/think/exception/ClassNotFoundException.php
+++ b/vendor/topthink/framework/src/think/exception/ClassNotFoundException.php
@@ -17,12 +17,9 @@ use Throwable;
class ClassNotFoundException extends RuntimeException implements NotFoundExceptionInterface
{
- protected $class;
-
- public function __construct(string $message, string $class = '', Throwable $previous = null)
+ public function __construct(string $message, protected string $class = '', Throwable $previous = null)
{
$this->message = $message;
- $this->class = $class;
parent::__construct($message, 0, $previous);
}
diff --git a/vendor/topthink/framework/src/think/exception/ErrorException.php b/vendor/topthink/framework/src/think/exception/ErrorException.php
index d1a2378..e8ae7ec 100644
--- a/vendor/topthink/framework/src/think/exception/ErrorException.php
+++ b/vendor/topthink/framework/src/think/exception/ErrorException.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 麦当苗儿
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\exception;
diff --git a/vendor/topthink/framework/src/think/exception/FileException.php b/vendor/topthink/framework/src/think/exception/FileException.php
index 228a189..505f7ba 100644
--- a/vendor/topthink/framework/src/think/exception/FileException.php
+++ b/vendor/topthink/framework/src/think/exception/FileException.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\exception;
diff --git a/vendor/topthink/framework/src/think/exception/FuncNotFoundException.php b/vendor/topthink/framework/src/think/exception/FuncNotFoundException.php
index ee2bcad..0f65376 100644
--- a/vendor/topthink/framework/src/think/exception/FuncNotFoundException.php
+++ b/vendor/topthink/framework/src/think/exception/FuncNotFoundException.php
@@ -8,12 +8,9 @@ use Throwable;
class FuncNotFoundException extends RuntimeException implements NotFoundExceptionInterface
{
- protected $func;
-
- public function __construct(string $message, string $func = '', Throwable $previous = null)
+ public function __construct(string $message, protected string $func = '', Throwable $previous = null)
{
$this->message = $message;
- $this->func = $func;
parent::__construct($message, 0, $previous);
}
diff --git a/vendor/topthink/framework/src/think/exception/Handle.php b/vendor/topthink/framework/src/think/exception/Handle.php
index 1f783bc..7d64e13 100644
--- a/vendor/topthink/framework/src/think/exception/Handle.php
+++ b/vendor/topthink/framework/src/think/exception/Handle.php
@@ -26,9 +26,6 @@ use Throwable;
*/
class Handle
{
- /** @var App */
- protected $app;
-
protected $ignoreReport = [
HttpException::class,
HttpResponseException::class,
@@ -39,9 +36,8 @@ class Handle
protected $isJson = false;
- public function __construct(App $app)
+ public function __construct(protected App $app)
{
- $this->app = $app;
}
/**
@@ -100,7 +96,7 @@ class Handle
* @param Throwable $e
* @return Response
*/
- public function render($request, Throwable $e): Response
+ public function render(Request $request, Throwable $e): Response
{
$this->isJson = $request->isJson();
if ($e instanceof HttpResponseException) {
@@ -156,7 +152,7 @@ class Handle
$nextException = $exception;
do {
$traces[] = [
- 'name' => get_class($nextException),
+ 'name' => $nextException::class,
'file' => $nextException->getFile(),
'line' => $nextException->getLine(),
'code' => $this->getCode($nextException),
@@ -261,10 +257,10 @@ class Handle
$lang = $this->app->lang;
- if (strpos($message, ':')) {
+ if (str_contains($message, ':')) {
$name = strstr($message, ':', true);
$message = $lang->has($name) ? $lang->get($name) . strstr($message, ':') : $message;
- } elseif (strpos($message, ',')) {
+ } elseif (str_contains($message, ',')) {
$name = strstr($message, ',', true);
$message = $lang->has($name) ? $lang->get($name) . ':' . substr(strstr($message, ','), 1) : $message;
} elseif ($lang->has($message)) {
diff --git a/vendor/topthink/framework/src/think/exception/HttpException.php b/vendor/topthink/framework/src/think/exception/HttpException.php
index 45302e5..7ccc670 100644
--- a/vendor/topthink/framework/src/think/exception/HttpException.php
+++ b/vendor/topthink/framework/src/think/exception/HttpException.php
@@ -19,14 +19,8 @@ use Exception;
*/
class HttpException extends \RuntimeException
{
- private $statusCode;
- private $headers;
-
- public function __construct(int $statusCode, string $message = '', Exception $previous = null, array $headers = [], $code = 0)
+ public function __construct(private int $statusCode, string $message = '', Exception $previous = null, private array $headers = [], $code = 0)
{
- $this->statusCode = $statusCode;
- $this->headers = $headers;
-
parent::__construct($message, $code, $previous);
}
diff --git a/vendor/topthink/framework/src/think/exception/HttpResponseException.php b/vendor/topthink/framework/src/think/exception/HttpResponseException.php
index 607813d..fc22fb4 100644
--- a/vendor/topthink/framework/src/think/exception/HttpResponseException.php
+++ b/vendor/topthink/framework/src/think/exception/HttpResponseException.php
@@ -19,14 +19,8 @@ use think\Response;
*/
class HttpResponseException extends \RuntimeException
{
- /**
- * @var Response
- */
- protected $response;
-
- public function __construct(Response $response)
+ public function __construct(protected Response $response)
{
- $this->response = $response;
}
public function getResponse()
diff --git a/vendor/topthink/framework/src/think/exception/InvalidArgumentException.php b/vendor/topthink/framework/src/think/exception/InvalidArgumentException.php
index 8ccd6f6..d7603c9 100644
--- a/vendor/topthink/framework/src/think/exception/InvalidArgumentException.php
+++ b/vendor/topthink/framework/src/think/exception/InvalidArgumentException.php
@@ -11,12 +11,11 @@
declare (strict_types = 1);
namespace think\exception;
-use Psr\Cache\InvalidArgumentException as Psr6CacheInvalidArgumentInterface;
use Psr\SimpleCache\InvalidArgumentException as SimpleCacheInvalidArgumentInterface;
/**
* 非法数据异常
*/
-class InvalidArgumentException extends \InvalidArgumentException implements Psr6CacheInvalidArgumentInterface, SimpleCacheInvalidArgumentInterface
+class InvalidArgumentException extends \InvalidArgumentException implements SimpleCacheInvalidArgumentInterface
{
}
diff --git a/vendor/topthink/framework/src/think/facade/App.php b/vendor/topthink/framework/src/think/facade/App.php
index e9f8105..b30d4ac 100644
--- a/vendor/topthink/framework/src/think/facade/App.php
+++ b/vendor/topthink/framework/src/think/facade/App.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
diff --git a/vendor/topthink/framework/src/think/facade/Cache.php b/vendor/topthink/framework/src/think/facade/Cache.php
index aac105d..14350ec 100644
--- a/vendor/topthink/framework/src/think/facade/Cache.php
+++ b/vendor/topthink/framework/src/think/facade/Cache.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
diff --git a/vendor/topthink/framework/src/think/facade/Config.php b/vendor/topthink/framework/src/think/facade/Config.php
index 4ce73dd..e392af6 100644
--- a/vendor/topthink/framework/src/think/facade/Config.php
+++ b/vendor/topthink/framework/src/think/facade/Config.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
diff --git a/vendor/topthink/framework/src/think/facade/Console.php b/vendor/topthink/framework/src/think/facade/Console.php
index 30dd935..ca2bb43 100644
--- a/vendor/topthink/framework/src/think/facade/Console.php
+++ b/vendor/topthink/framework/src/think/facade/Console.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
diff --git a/vendor/topthink/framework/src/think/facade/Cookie.php b/vendor/topthink/framework/src/think/facade/Cookie.php
index 960f4a3..1d29c27 100644
--- a/vendor/topthink/framework/src/think/facade/Cookie.php
+++ b/vendor/topthink/framework/src/think/facade/Cookie.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
diff --git a/vendor/topthink/framework/src/think/facade/Env.php b/vendor/topthink/framework/src/think/facade/Env.php
index bed2538..44f4a2a 100644
--- a/vendor/topthink/framework/src/think/facade/Env.php
+++ b/vendor/topthink/framework/src/think/facade/Env.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
diff --git a/vendor/topthink/framework/src/think/facade/Event.php b/vendor/topthink/framework/src/think/facade/Event.php
index c09d816..6429669 100644
--- a/vendor/topthink/framework/src/think/facade/Event.php
+++ b/vendor/topthink/framework/src/think/facade/Event.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
diff --git a/vendor/topthink/framework/src/think/facade/Filesystem.php b/vendor/topthink/framework/src/think/facade/Filesystem.php
deleted file mode 100644
index 53706a8..0000000
--- a/vendor/topthink/framework/src/think/facade/Filesystem.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
-// +----------------------------------------------------------------------
-declare (strict_types = 1);
-
-namespace think\facade;
-
-use think\Facade;
-use think\filesystem\Driver;
-
-/**
- * Class Filesystem
- * @package think\facade
- * @mixin \think\Filesystem
- * @method static Driver disk(string $name = null) ,null|string
- * @method static mixed getConfig(null|string $name = null, mixed $default = null) 获取缓存配置
- * @method static array getDiskConfig(string $disk, null $name = null, null $default = null) 获取磁盘配置
- * @method static string|null getDefaultDriver() 默认驱动
- */
-class Filesystem extends Facade
-{
- protected static function getFacadeClass()
- {
- return 'filesystem';
- }
-}
diff --git a/vendor/topthink/framework/src/think/facade/Lang.php b/vendor/topthink/framework/src/think/facade/Lang.php
index b460fe2..ff22bfd 100644
--- a/vendor/topthink/framework/src/think/facade/Lang.php
+++ b/vendor/topthink/framework/src/think/facade/Lang.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
diff --git a/vendor/topthink/framework/src/think/facade/Log.php b/vendor/topthink/framework/src/think/facade/Log.php
index 7c43d37..cf07882 100644
--- a/vendor/topthink/framework/src/think/facade/Log.php
+++ b/vendor/topthink/framework/src/think/facade/Log.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
diff --git a/vendor/topthink/framework/src/think/facade/Middleware.php b/vendor/topthink/framework/src/think/facade/Middleware.php
index 4203f82..426501c 100644
--- a/vendor/topthink/framework/src/think/facade/Middleware.php
+++ b/vendor/topthink/framework/src/think/facade/Middleware.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
diff --git a/vendor/topthink/framework/src/think/facade/Request.php b/vendor/topthink/framework/src/think/facade/Request.php
index 6531f46..f665444 100644
--- a/vendor/topthink/framework/src/think/facade/Request.php
+++ b/vendor/topthink/framework/src/think/facade/Request.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
@@ -115,10 +115,10 @@ use think\route\Rule;
* @method static mixed __set(string $name, mixed $value) 设置中间传递数据
* @method static mixed __get(string $name) 获取中间传递数据的值
* @method static boolean __isset(string $name) 检测中间传递数据的值
- * @method static bool offsetExists($name)
- * @method static mixed offsetGet($name)
- * @method static mixed offsetSet($name, $value)
- * @method static mixed offsetUnset($name)
+ * @method static bool offsetExists(mixed $name)
+ * @method static mixed offsetGet(mixed $name)
+ * @method static mixed offsetSet(mixed $name, $value)
+ * @method static mixed offsetUnset(mixed $name)
*/
class Request extends Facade
{
diff --git a/vendor/topthink/framework/src/think/facade/Route.php b/vendor/topthink/framework/src/think/facade/Route.php
index 1b9a872..550359e 100644
--- a/vendor/topthink/framework/src/think/facade/Route.php
+++ b/vendor/topthink/framework/src/think/facade/Route.php
@@ -2,18 +2,17 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
use think\Facade;
-use think\Response;
use think\route\Dispatch;
use think\route\Domain;
use think\route\Rule;
@@ -21,7 +20,6 @@ use think\route\RuleGroup;
use think\route\RuleItem;
use think\route\RuleName;
use think\route\Url as UrlBuild;
-use think\route\ResourceRegister as Resource;
/**
* @see \think\Route
@@ -29,8 +27,6 @@ use think\route\ResourceRegister as Resource;
* @mixin \think\Route
* @method static mixed config(string $name = null)
* @method static \think\Route lazy(bool $lazy = true) 设置路由域名及分组(包括资源路由)是否延迟解析
- * @method static void setTestMode(bool $test) 设置路由为测试模式
- * @method static bool isTest() 检查路由是否为测试模式
* @method static \think\Route mergeRuleRegex(bool $merge = true) 设置路由域名及分组(包括资源路由)是否合并解析
* @method static void setGroup(RuleGroup $group) 设置当前分组
* @method static RuleGroup getGroup(string $name = null) 获取指定标识的路由分组 不指定则获取当前分组
@@ -66,7 +62,7 @@ use think\route\ResourceRegister as Resource;
* @method static \think\Route rest(string|array $name, array|bool $resource = []) rest方法定义和修改
* @method static array|null getRest(string $name = null) 获取rest方法定义的参数
* @method static RuleItem miss(string|\Closure $route, string $method = '*') 注册未匹配路由规则后的处理
- * @method static Response dispatch(\think\Request $request, \Closure|bool $withRoute = true) 路由调度
+ * @method static Response dispatch(\think\Request $request, Closure|bool $withRoute = true) 路由调度
* @method static Dispatch|false check() 检测URL路由
* @method static Dispatch url(string $url) 默认URL解析
* @method static UrlBuild buildUrl(string $url = '', array $vars = []) URL生成 支持路由反射
diff --git a/vendor/topthink/framework/src/think/facade/Session.php b/vendor/topthink/framework/src/think/facade/Session.php
index 68bf993..1e5e12a 100644
--- a/vendor/topthink/framework/src/think/facade/Session.php
+++ b/vendor/topthink/framework/src/think/facade/Session.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
diff --git a/vendor/topthink/framework/src/think/facade/Validate.php b/vendor/topthink/framework/src/think/facade/Validate.php
index 6db6d34..195fb56 100644
--- a/vendor/topthink/framework/src/think/facade/Validate.php
+++ b/vendor/topthink/framework/src/think/facade/Validate.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
diff --git a/vendor/topthink/framework/src/think/facade/View.php b/vendor/topthink/framework/src/think/facade/View.php
index acde3b5..c3e2d54 100644
--- a/vendor/topthink/framework/src/think/facade/View.php
+++ b/vendor/topthink/framework/src/think/facade/View.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\facade;
diff --git a/vendor/topthink/framework/src/think/file/UploadedFile.php b/vendor/topthink/framework/src/think/file/UploadedFile.php
index 7dff766..2909966 100644
--- a/vendor/topthink/framework/src/think/file/UploadedFile.php
+++ b/vendor/topthink/framework/src/think/file/UploadedFile.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\file;
@@ -81,28 +81,14 @@ class UploadedFile extends File
*/
protected function getErrorMessage(): string
{
- switch ($this->error) {
- case 1:
- case 2:
- $message = 'upload File size exceeds the maximum value';
- break;
- case 3:
- $message = 'only the portion of file is uploaded';
- break;
- case 4:
- $message = 'no file to uploaded';
- break;
- case 6:
- $message = 'upload temp dir not found';
- break;
- case 7:
- $message = 'file write error';
- break;
- default:
- $message = 'unknown upload error';
- }
-
- return $message;
+ return match ($this->error) {
+ 1,2 => 'upload File size exceeds the maximum value',
+ 3 => 'only the portion of file is uploaded',
+ 4 => 'no file to uploaded',
+ 6 => 'upload temp dir not found',
+ 7 => 'file write error',
+ default => 'unknown upload error',
+ };
}
/**
diff --git a/vendor/topthink/framework/src/think/filesystem/CacheStore.php b/vendor/topthink/framework/src/think/filesystem/CacheStore.php
deleted file mode 100644
index 0a62399..0000000
--- a/vendor/topthink/framework/src/think/filesystem/CacheStore.php
+++ /dev/null
@@ -1,54 +0,0 @@
-
-// +----------------------------------------------------------------------
-declare (strict_types = 1);
-
-namespace think\filesystem;
-
-use League\Flysystem\Cached\Storage\AbstractCache;
-use Psr\SimpleCache\CacheInterface;
-
-class CacheStore extends AbstractCache
-{
- protected $store;
-
- protected $key;
-
- protected $expire;
-
- public function __construct(CacheInterface $store, $key = 'flysystem', $expire = null)
- {
- $this->key = $key;
- $this->store = $store;
- $this->expire = $expire;
- }
-
- /**
- * Store the cache.
- */
- public function save()
- {
- $contents = $this->getForStorage();
-
- $this->store->set($this->key, $contents, $this->expire);
- }
-
- /**
- * Load the cache.
- */
- public function load()
- {
- $contents = $this->store->get($this->key);
-
- if (!is_null($contents)) {
- $this->setFromStorage($contents);
- }
- }
-}
diff --git a/vendor/topthink/framework/src/think/filesystem/Driver.php b/vendor/topthink/framework/src/think/filesystem/Driver.php
deleted file mode 100644
index 0e61cf4..0000000
--- a/vendor/topthink/framework/src/think/filesystem/Driver.php
+++ /dev/null
@@ -1,144 +0,0 @@
-
-// +----------------------------------------------------------------------
-declare (strict_types = 1);
-
-namespace think\filesystem;
-
-use League\Flysystem\AdapterInterface;
-use League\Flysystem\Adapter\AbstractAdapter;
-use League\Flysystem\Cached\CachedAdapter;
-use League\Flysystem\Cached\Storage\Memory as MemoryStore;
-use League\Flysystem\Filesystem;
-use RuntimeException;
-use think\Cache;
-use think\File;
-
-/**
- * Class Driver
- * @package think\filesystem
- * @mixin Filesystem
- */
-abstract class Driver
-{
-
- /** @var Cache */
- protected $cache;
-
- /** @var Filesystem */
- protected $filesystem;
-
- /**
- * 配置参数
- * @var array
- */
- protected $config = [];
-
- public function __construct(Cache $cache, array $config)
- {
- $this->cache = $cache;
- $this->config = array_merge($this->config, $config);
-
- $adapter = $this->createAdapter();
- $this->filesystem = $this->createFilesystem($adapter);
- }
-
- protected function createCacheStore($config)
- {
- if (true === $config) {
- return new MemoryStore;
- }
-
- return new CacheStore(
- $this->cache->store($config['store']),
- $config['prefix'] ?? 'flysystem',
- $config['expire'] ?? null
- );
- }
-
- abstract protected function createAdapter(): AdapterInterface;
-
- protected function createFilesystem(AdapterInterface $adapter): Filesystem
- {
- if (!empty($this->config['cache'])) {
- $adapter = new CachedAdapter($adapter, $this->createCacheStore($this->config['cache']));
- }
-
- $config = array_intersect_key($this->config, array_flip(['visibility', 'disable_asserts', 'url']));
-
- return new Filesystem($adapter, count($config) > 0 ? $config : null);
- }
-
- /**
- * 获取文件完整路径
- * @param string $path
- * @return string
- */
- public function path(string $path): string
- {
- $adapter = $this->filesystem->getAdapter();
-
- if ($adapter instanceof AbstractAdapter) {
- return $adapter->applyPathPrefix($path);
- }
-
- return $path;
- }
-
- protected function concatPathToUrl($url, $path)
- {
- return rtrim($url, '/') . '/' . ltrim($path, '/');
- }
-
- public function url(string $path): string
- {
- throw new RuntimeException('This driver does not support retrieving URLs.');
- }
-
- /**
- * 保存文件
- * @param string $path 路径
- * @param File $file 文件
- * @param null|string|\Closure $rule 文件名规则
- * @param array $options 参数
- * @return bool|string
- */
- public function putFile(string $path, File $file, $rule = null, array $options = [])
- {
- return $this->putFileAs($path, $file, $file->hashName($rule), $options);
- }
-
- /**
- * 指定文件名保存文件
- * @param string $path 路径
- * @param File $file 文件
- * @param string $name 文件名
- * @param array $options 参数
- * @return bool|string
- */
- public function putFileAs(string $path, File $file, string $name, array $options = [])
- {
- $stream = fopen($file->getRealPath(), 'r');
- $path = trim($path . '/' . $name, '/');
-
- $result = $this->putStream($path, $stream, $options);
-
- if (is_resource($stream)) {
- fclose($stream);
- }
-
- return $result ? $path : false;
- }
-
- public function __call($method, $parameters)
- {
- return $this->filesystem->$method(...$parameters);
- }
-}
diff --git a/vendor/topthink/framework/src/think/filesystem/driver/Local.php b/vendor/topthink/framework/src/think/filesystem/driver/Local.php
deleted file mode 100644
index 5749335..0000000
--- a/vendor/topthink/framework/src/think/filesystem/driver/Local.php
+++ /dev/null
@@ -1,59 +0,0 @@
-
-// +----------------------------------------------------------------------
-declare (strict_types = 1);
-
-namespace think\filesystem\driver;
-
-use League\Flysystem\AdapterInterface;
-use League\Flysystem\Adapter\Local as LocalAdapter;
-use think\filesystem\Driver;
-
-class Local extends Driver
-{
- /**
- * 配置参数
- * @var array
- */
- protected $config = [
- 'root' => '',
- ];
-
- protected function createAdapter(): AdapterInterface
- {
- $permissions = $this->config['permissions'] ?? [];
-
- $links = ($this->config['links'] ?? null) === 'skip'
- ? LocalAdapter::SKIP_LINKS
- : LocalAdapter::DISALLOW_LINKS;
-
- return new LocalAdapter(
- $this->config['root'],
- LOCK_EX,
- $links,
- $permissions
- );
- }
-
- /**
- * 获取文件访问地址
- * @param string $path 文件路径
- * @return string
- */
- public function url(string $path): string
- {
- $path = str_replace('\\', '/', $path);
-
- if (isset($this->config['url'])) {
- return $this->concatPathToUrl($this->config['url'], $path);
- }
- return parent::url($path);
- }
-}
diff --git a/vendor/topthink/framework/src/think/initializer/BootService.php b/vendor/topthink/framework/src/think/initializer/BootService.php
index bab6d39..0545f3c 100644
--- a/vendor/topthink/framework/src/think/initializer/BootService.php
+++ b/vendor/topthink/framework/src/think/initializer/BootService.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\initializer;
diff --git a/vendor/topthink/framework/src/think/initializer/Error.php b/vendor/topthink/framework/src/think/initializer/Error.php
index 201d947..4e8d02e 100644
--- a/vendor/topthink/framework/src/think/initializer/Error.php
+++ b/vendor/topthink/framework/src/think/initializer/Error.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 麦当苗儿
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\initializer;
@@ -55,7 +55,9 @@ class Error
if ($this->app->runningInConsole()) {
$handler->renderForConsole(new ConsoleOutput, $e);
} else {
- $handler->render($this->app->request, $e)->send();
+ $response = $handler->render($this->app->request, $e);
+ $response->send();
+ $this->app->http->end($response);
}
}
diff --git a/vendor/topthink/framework/src/think/initializer/RegisterService.php b/vendor/topthink/framework/src/think/initializer/RegisterService.php
index b682a0b..77c62b8 100644
--- a/vendor/topthink/framework/src/think/initializer/RegisterService.php
+++ b/vendor/topthink/framework/src/think/initializer/RegisterService.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\initializer;
diff --git a/vendor/topthink/framework/src/think/log/Channel.php b/vendor/topthink/framework/src/think/log/Channel.php
index 1de96f1..ee7c33e 100644
--- a/vendor/topthink/framework/src/think/log/Channel.php
+++ b/vendor/topthink/framework/src/think/log/Channel.php
@@ -2,17 +2,19 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\log;
use Psr\Log\LoggerInterface;
+use Psr\Log\LoggerTrait;
+use Stringable;
use think\contract\LogHandlerInterface;
use think\Event;
use think\event\LogRecord;
@@ -20,11 +22,14 @@ use think\event\LogWrite;
class Channel implements LoggerInterface
{
- protected $name;
- protected $logger;
+ use LoggerTrait;
+
+ /**
+ * 事件
+ * @var Event
+ */
protected $event;
- protected $lazy = true;
/**
* 日志信息
* @var array
@@ -37,25 +42,14 @@ class Channel implements LoggerInterface
*/
protected $close = false;
- /**
- * 允许写入类型
- * @var array
- */
- protected $allow = [];
-
- public function __construct(string $name, LogHandlerInterface $logger, array $allow, bool $lazy = true, Event $event = null)
+ public function __construct(protected string $name, protected LogHandlerInterface $logger, protected array $allow = [], protected bool $lazy = true, Event $event = null)
{
- $this->name = $name;
- $this->logger = $logger;
- $this->allow = $allow;
- $this->lazy = $lazy;
- $this->event = $event;
}
/**
* 关闭通道
*/
- public function close()
+ public function close(): void
{
$this->clear();
$this->close = true;
@@ -64,7 +58,7 @@ class Channel implements LoggerInterface
/**
* 清空日志
*/
- public function clear()
+ public function clear(): void
{
$this->log = [];
}
@@ -84,6 +78,10 @@ class Channel implements LoggerInterface
return $this;
}
+ if ($msg instanceof Stringable) {
+ $msg = $msg->__toString();
+ }
+
if (is_string($msg) && !empty($context)) {
$replace = [];
foreach ($context as $key => $val) {
@@ -150,131 +148,16 @@ class Channel implements LoggerInterface
return false;
}
- /**
- * System is unusable.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function emergency($message, array $context = [])
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function alert($message, array $context = [])
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function critical($message, array $context = [])
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function error($message, array $context = [])
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function warning($message, array $context = [])
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function notice($message, array $context = [])
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function info($message, array $context = [])
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function debug($message, array $context = [])
- {
- $this->log(__FUNCTION__, $message, $context);
- }
-
/**
* Logs with an arbitrary level.
*
* @param mixed $level
- * @param string $message
+ * @param string|Stringable $message
* @param array $context
*
* @return void
*/
- public function log($level, $message, array $context = [])
+ public function log($level, string|Stringable $message, array $context = []): void
{
$this->record($message, $level, $context);
}
diff --git a/vendor/topthink/framework/src/think/log/ChannelSet.php b/vendor/topthink/framework/src/think/log/ChannelSet.php
index 6dcb0bd..0a227af 100644
--- a/vendor/topthink/framework/src/think/log/ChannelSet.php
+++ b/vendor/topthink/framework/src/think/log/ChannelSet.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\log;
@@ -21,13 +21,8 @@ use think\Log;
*/
class ChannelSet
{
- protected $log;
- protected $channels;
-
- public function __construct(Log $log, array $channels)
+ public function __construct(protected Log $log, protected array $channels)
{
- $this->log = $log;
- $this->channels = $channels;
}
public function __call($method, $arguments)
diff --git a/vendor/topthink/framework/src/think/log/driver/Socket.php b/vendor/topthink/framework/src/think/log/driver/Socket.php
index 2cfb943..427dab6 100644
--- a/vendor/topthink/framework/src/think/log/driver/Socket.php
+++ b/vendor/topthink/framework/src/think/log/driver/Socket.php
@@ -22,8 +22,6 @@ use think\contract\LogHandlerInterface;
*/
class Socket implements LogHandlerInterface
{
- protected $app;
-
protected $config = [
// socket服务器地址
'host' => 'localhost',
@@ -66,10 +64,8 @@ class Socket implements LogHandlerInterface
* @param App $app
* @param array $config 缓存参数
*/
- public function __construct(App $app, array $config = [])
+ public function __construct(protected App $app, array $config = [])
{
- $this->app = $app;
-
if (!empty($config)) {
$this->config = array_merge($this->config, $config);
}
diff --git a/vendor/topthink/framework/src/think/middleware/AllowCrossDomain.php b/vendor/topthink/framework/src/think/middleware/AllowCrossDomain.php
index b7ab842..7f258ed 100644
--- a/vendor/topthink/framework/src/think/middleware/AllowCrossDomain.php
+++ b/vendor/topthink/framework/src/think/middleware/AllowCrossDomain.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\middleware;
@@ -44,14 +44,14 @@ class AllowCrossDomain
* @param array $header
* @return Response
*/
- public function handle($request, Closure $next, ? array $header = [])
+ public function handle(Request $request, Closure $next, array $header = []): Response
{
$header = !empty($header) ? array_merge($this->header, $header) : $this->header;
if (!isset($header['Access-Control-Allow-Origin'])) {
$origin = $request->header('origin');
- if ($origin && ('' == $this->cookieDomain || strpos($origin, $this->cookieDomain))) {
+ if ($origin && ('' == $this->cookieDomain || str_contains($origin, $this->cookieDomain))) {
$header['Access-Control-Allow-Origin'] = $origin;
} else {
$header['Access-Control-Allow-Origin'] = '*';
diff --git a/vendor/topthink/framework/src/think/middleware/CheckRequestCache.php b/vendor/topthink/framework/src/think/middleware/CheckRequestCache.php
index b114351..c3e7e57 100644
--- a/vendor/topthink/framework/src/think/middleware/CheckRequestCache.php
+++ b/vendor/topthink/framework/src/think/middleware/CheckRequestCache.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\middleware;
@@ -58,7 +58,7 @@ class CheckRequestCache
* @param mixed $cache
* @return Response
*/
- public function handle($request, Closure $next, $cache = null)
+ public function handle(Request $request, Closure $next, $cache = null): Response
{
if ($request->isGet() && false !== $cache) {
if (false === $this->config['request_cache_key']) {
@@ -70,11 +70,11 @@ class CheckRequestCache
if ($cache) {
if (is_array($cache)) {
- [$key, $expire, $tag] = array_pad($cache, 3, null);
+ [$key, $expire, $tag] = array_pad($cache, 3, '');
} else {
$key = md5($request->url(true));
$expire = $cache;
- $tag = null;
+ $tag = '';
}
$key = $this->parseCacheKey($request, $key);
@@ -136,7 +136,7 @@ class CheckRequestCache
*/
protected function parseCacheKey($request, $key)
{
- if ($key instanceof \Closure) {
+ if ($key instanceof Closure) {
$key = call_user_func($key, $request);
}
@@ -148,24 +148,24 @@ class CheckRequestCache
if (true === $key) {
// 自动缓存功能
$key = '__URL__';
- } elseif (strpos($key, '|')) {
+ } elseif (str_contains($key, '|')) {
[$key, $fun] = explode('|', $key);
}
// 特殊规则替换
- if (false !== strpos($key, '__')) {
+ if (str_contains($key, '__')) {
$key = str_replace(['__CONTROLLER__', '__ACTION__', '__URL__'], [$request->controller(), $request->action(), md5($request->url(true))], $key);
}
- if (false !== strpos($key, ':')) {
+ if (str_contains($key, ':')) {
$param = $request->param();
foreach ($param as $item => $val) {
- if (is_string($val) && false !== strpos($key, ':' . $item)) {
+ if (is_string($val) && str_contains($key, ':' . $item)) {
$key = str_replace(':' . $item, (string) $val, $key);
}
}
- } elseif (strpos($key, ']')) {
+ } elseif (str_contains($key, ']')) {
if ('[' . $request->ext() . ']' == $key) {
// 缓存某个后缀的请求
$key = md5($request->url());
diff --git a/vendor/topthink/framework/src/think/middleware/FormTokenCheck.php b/vendor/topthink/framework/src/think/middleware/FormTokenCheck.php
index efbb77b..542d396 100644
--- a/vendor/topthink/framework/src/think/middleware/FormTokenCheck.php
+++ b/vendor/topthink/framework/src/think/middleware/FormTokenCheck.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\middleware;
@@ -31,7 +31,7 @@ class FormTokenCheck
* @param string $token 表单令牌Token名称
* @return Response
*/
- public function handle(Request $request, Closure $next, string $token = null)
+ public function handle(Request $request, Closure $next, string $token = null): Response
{
$check = $request->checkToken($token ?: '__token__');
@@ -41,5 +41,4 @@ class FormTokenCheck
return $next($request);
}
-
}
diff --git a/vendor/topthink/framework/src/think/middleware/LoadLangPack.php b/vendor/topthink/framework/src/think/middleware/LoadLangPack.php
index af0324b..82e6a98 100644
--- a/vendor/topthink/framework/src/think/middleware/LoadLangPack.php
+++ b/vendor/topthink/framework/src/think/middleware/LoadLangPack.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\middleware;
@@ -25,14 +25,10 @@ use think\Response;
*/
class LoadLangPack
{
- protected $app;
- protected $lang;
protected $config;
- public function __construct(App $app, Lang $lang, Config $config)
+ public function __construct(protected App $app, protected Lang $lang, Config $config)
{
- $this->app = $app;
- $this->lang = $lang;
$this->config = $lang->getConfig();
}
@@ -43,7 +39,7 @@ class LoadLangPack
* @param Closure $next
* @return Response
*/
- public function handle($request, Closure $next)
+ public function handle(Request $request, Closure $next): Response
{
// 自动侦测当前语言
$langset = $this->detect($request);
@@ -108,11 +104,10 @@ class LoadLangPack
* @param string $langSet 语言
* @return void
*/
- protected function saveToCookie(Cookie $cookie, string $langSet)
+ protected function saveToCookie(Cookie $cookie, string $langSet): void
{
if ($this->config['use_cookie']) {
$cookie->set($this->config['cookie_var'], $langSet);
}
}
-
}
diff --git a/vendor/topthink/framework/src/think/middleware/SessionInit.php b/vendor/topthink/framework/src/think/middleware/SessionInit.php
index 55cea3b..3f2c454 100644
--- a/vendor/topthink/framework/src/think/middleware/SessionInit.php
+++ b/vendor/topthink/framework/src/think/middleware/SessionInit.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\middleware;
@@ -23,17 +23,8 @@ use think\Session;
*/
class SessionInit
{
-
- /** @var App */
- protected $app;
-
- /** @var Session */
- protected $session;
-
- public function __construct(App $app, Session $session)
+ public function __construct(protected App $app, protected Session $session)
{
- $this->app = $app;
- $this->session = $session;
}
/**
@@ -43,7 +34,7 @@ class SessionInit
* @param Closure $next
* @return Response
*/
- public function handle($request, Closure $next)
+ public function handle(Request $request, Closure $next): Response
{
// Session初始化
$varSessionId = $this->app->config->get('session.var_session_id');
@@ -73,7 +64,7 @@ class SessionInit
return $response;
}
- public function end(Response $response)
+ public function end(Response $response): void
{
$this->session->save();
}
diff --git a/vendor/topthink/framework/src/think/response/File.php b/vendor/topthink/framework/src/think/response/File.php
index 1e45f2f..22a442c 100644
--- a/vendor/topthink/framework/src/think/response/File.php
+++ b/vendor/topthink/framework/src/think/response/File.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st
// +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare(strict_types=1);
namespace think\response;
@@ -151,7 +151,7 @@ class File extends Response
{
$this->name = $filename;
- if ($extension && false === strpos($filename, '.')) {
+ if ($extension && !str_contains($filename, '.')) {
$this->name .= '.' . pathinfo($this->data, PATHINFO_EXTENSION);
}
diff --git a/vendor/topthink/framework/src/think/response/Html.php b/vendor/topthink/framework/src/think/response/Html.php
index c158f78..11170f2 100644
--- a/vendor/topthink/framework/src/think/response/Html.php
+++ b/vendor/topthink/framework/src/think/response/Html.php
@@ -2,13 +2,13 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
+// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st